path
stringlengths
5
300
repo_name
stringlengths
6
76
content
stringlengths
26
1.05M
ajax/libs/react-bootstrap-table/1.2.6/react-bootstrap-table.min.js
jdh8/cdnjs
!function e(t,o,n){function r(s,l){if(!o[s]){if(!t[s]){var i="function"==typeof require&&require;if(!l&&i)return i(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=o[s]={exports:{}};t[s][0].call(d.exports,function(e){var o=t[s][1][e];return r(o?o:e)},d,d.exports,e,t,o,n)}return o[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({"./src/index.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=n(e("./BootstrapTable")),a=n(e("./TableHeaderColumn")),s=e("./store/TableDataStore").TableDataSet;"undefined"!=typeof window&&(window.BootstrapTable=r,window.TableHeaderColumn=a),t.exports={BootstrapTable:r,TableHeaderColumn:a,TableDataSet:s}},{"./BootstrapTable":"/Users/allen/Node/react-bootstrap-table/src/BootstrapTable.js","./TableHeaderColumn":"/Users/allen/Node/react-bootstrap-table/src/TableHeaderColumn.js","./store/TableDataStore":"/Users/allen/Node/react-bootstrap-table/src/store/TableDataStore.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/events/events.js":[function(e,t,o){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function a(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function l(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!a(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,o,n,a,i,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(o=this._events[e],l(o))return!1;if(r(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:for(n=arguments.length,a=new Array(n-1),i=1;n>i;i++)a[i-1]=arguments[i];o.apply(this,a)}else if(s(o)){for(n=arguments.length,a=new Array(n-1),i=1;n>i;i++)a[i-1]=arguments[i];for(c=o.slice(),n=c.length,i=0;n>i;i++)c[i].apply(this,a)}return!0},n.prototype.addListener=function(e,t){var o;if(!r(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned){var o;o=l(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function o(){this.removeListener(e,o),n||(n=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var n=!1;return o.listener=t,this.on(e,o),this},n.prototype.removeListener=function(e,t){var o,n,a,l;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=this._events[e],a=o.length,n=-1,o===t||r(o.listener)&&o.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(o)){for(l=a;l-- >0;)if(o[l]===t||o[l].listener&&o[l].listener===t){n=l;break}if(0>n)return this;1===o.length?(o.length=0,delete this._events[e]):o.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,o;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[e],r(o))this.removeListener(e,o);else for(;o.length;)this.removeListener(e,o[o.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var o;return o=e._events&&e._events[t]?r(e._events[t])?1:e._events[t].length:0}},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js":[function(e,t,o){function n(){if(!l){l=!0;for(var e,t=s.length;t;){e=s,s=[];for(var o=-1;++o<t;)e[o]();t=s.length}l=!1}}function r(){}var a=t.exports={},s=[],l=!1;a.nextTick=function(e){s.push(e),l||setTimeout(n,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=r,a.addListener=r,a.once=r,a.off=r,a.removeListener=r,a.removeAllListeners=r,a.emit=r,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js":[function(e,t,o){!function(){"use strict";function e(){for(var t="",n=0;n<arguments.length;n++){var r=arguments[n];if(r){var a=typeof r;if("string"===a||"number"===a)t+=" "+r;else if(Array.isArray(r))t+=" "+e.apply(null,r);else if("object"===a)for(var s in r)o.call(r,s)&&r[s]&&(t+=" "+s)}}return t.substr(1)}var o={}.hasOwnProperty;"undefined"!=typeof t&&t.exports?t.exports=e:"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",function(){return e}):window.classNames=e}()},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/CSSCore.js":[function(e,t,o){(function(o){"use strict";var n=e("./invariant"),r={addClass:function(e,t){return/\s/.test(t)?"production"!==o.env.NODE_ENV?n(!1,'CSSCore.addClass takes only a single class name. "%s" contains multiple classes.',t):n(!1):void 0,t&&(e.classList?e.classList.add(t):r.hasClass(e,t)||(e.className=e.className+" "+t)),e},removeClass:function(e,t){return/\s/.test(t)?"production"!==o.env.NODE_ENV?n(!1,'CSSCore.removeClass takes only a single class name. "%s" contains multiple classes.',t):n(!1):void 0,t&&(e.classList?e.classList.remove(t):r.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),e},conditionClass:function(e,t,o){return(o?r.addClass:r.removeClass)(e,t)},hasClass:function(e,t){return/\s/.test(t)?"production"!==o.env.NODE_ENV?n(!1,"CSS.hasClass takes only a single class name."):n(!1):void 0,e.classList?!!t&&e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}};t.exports=r}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/EventListener.js":[function(e,t,o){(function(o){"use strict";var n=e("./emptyFunction"),r={listen:function(e,t,o){return e.addEventListener?(e.addEventListener(t,o,!1),{remove:function(){e.removeEventListener(t,o,!1)}}):e.attachEvent?(e.attachEvent("on"+t,o),{remove:function(){e.detachEvent("on"+t,o)}}):void 0},capture:function(e,t,r){return e.addEventListener?(e.addEventListener(t,r,!0),{remove:function(){e.removeEventListener(t,r,!0)}}):("production"!==o.env.NODE_ENV&&console.error("Attempted to listen to events during the capture phase on a browser that does not support the capture phase. Your application will not receive some events."),{remove:n})},registerDefault:function(){}};t.exports=r}).call(this,e("_process"))},{"./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js":[function(e,t,o){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/camelize.js":[function(e,t,o){"use strict";function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/camelizeStyleName.js":[function(e,t,o){"use strict";function n(e){return r(e.replace(a,"ms-"))}var r=e("./camelize"),a=/^-ms-/;t.exports=n},{"./camelize":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/camelize.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/containsNode.js":[function(e,t,o){"use strict";function n(e,t){var o=!0;e:for(;o;){var n=e,a=t;if(o=!1,n&&a){if(n===a)return!0;if(r(n))return!1;if(r(a)){e=n,t=a.parentNode,o=!0;continue e}return n.contains?n.contains(a):n.compareDocumentPosition?!!(16&n.compareDocumentPosition(a)):!1}return!1}}var r=e("./isTextNode");t.exports=n},{"./isTextNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/isTextNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/createArrayFromMixed.js":[function(e,t,o){"use strict";function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function r(e){return n(e)?Array.isArray(e)?e.slice():a(e):[e]}var a=e("./toArray");t.exports=r},{"./toArray":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/toArray.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/createNodesFromMarkup.js":[function(e,t,o){(function(o){"use strict";function n(e){var t=e.match(d);return t&&t[1].toLowerCase()}function r(e,t){var r=c;c?void 0:"production"!==o.env.NODE_ENV?i(!1,"createNodesFromMarkup dummy not initialized"):i(!1);var a=n(e),d=a&&l(a);if(d){r.innerHTML=d[1]+e+d[2];for(var u=d[0];u--;)r=r.lastChild}else r.innerHTML=e;var p=r.getElementsByTagName("script");p.length&&(t?void 0:"production"!==o.env.NODE_ENV?i(!1,"createNodesFromMarkup(...): Unexpected <script> element rendered."):i(!1),s(p).forEach(t));for(var b=s(r.childNodes);r.lastChild;)r.removeChild(r.lastChild);return b}var a=e("./ExecutionEnvironment"),s=e("./createArrayFromMixed"),l=e("./getMarkupWrap"),i=e("./invariant"),c=a.canUseDOM?document.createElement("div"):null,d=/^\s*<(\w+)/;t.exports=r}).call(this,e("_process"))},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","./createArrayFromMixed":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/createArrayFromMixed.js","./getMarkupWrap":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getMarkupWrap.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js":[function(e,t,o){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js":[function(e,t,o){(function(e){"use strict";var o={};"production"!==e.env.NODE_ENV&&Object.freeze(o),t.exports=o}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/focusNode.js":[function(e,t,o){"use strict";function n(e){try{e.focus()}catch(t){}}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getActiveElement.js":[function(e,t,o){"use strict";function n(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getMarkupWrap.js":[function(e,t,o){(function(o){"use strict";function n(e){return s?void 0:"production"!==o.env.NODE_ENV?a(!1,"Markup wrapping node not initialized"):a(!1),p.hasOwnProperty(e)||(e="*"),l.hasOwnProperty(e)||("*"===e?s.innerHTML="<link />":s.innerHTML="<"+e+"></"+e+">",l[e]=!s.firstChild),l[e]?p[e]:null}var r=e("./ExecutionEnvironment"),a=e("./invariant"),s=r.canUseDOM?document.createElement("div"):null,l={},i=[1,'<select multiple="true">',"</select>"],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],u=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:i,option:i,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:d,th:d},b=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];b.forEach(function(e){p[e]=u,l[e]=!0}),t.exports=n}).call(this,e("_process"))},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getUnboundedScrollPosition.js":[function(e,t,o){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/hyphenate.js":[function(e,t,o){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/hyphenateStyleName.js":[function(e,t,o){"use strict";function n(e){return r(e).replace(a,"-ms-")}var r=e("./hyphenate"),a=/^ms-/;t.exports=n},{"./hyphenate":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/hyphenate.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js":[function(e,t,o){(function(e){"use strict";var o=function(t,o,n,r,a,s,l,i){if("production"!==e.env.NODE_ENV&&void 0===o)throw new Error("invariant requires an error message argument");if(!t){var c;if(void 0===o)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[n,r,a,s,l,i],u=0;c=new Error("Invariant Violation: "+o.replace(/%s/g,function(){return d[u++]}))}throw c.framesToPop=1,c}};t.exports=o}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/isNode.js":[function(e,t,o){"use strict";function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/isTextNode.js":[function(e,t,o){"use strict";function n(e){return r(e)&&3==e.nodeType}var r=e("./isNode");t.exports=n},{"./isNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/isNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js":[function(e,t,o){(function(o){"use strict";var n=e("./invariant"),r=function(e){var t,r={};e instanceof Object&&!Array.isArray(e)?void 0:"production"!==o.env.NODE_ENV?n(!1,"keyMirror(...): Argument must be an object."):n(!1);for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js":[function(e,t,o){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/mapObject.js":[function(e,t,o){"use strict";function n(e,t,o){if(!e)return null;var n={};for(var a in e)r.call(e,a)&&(n[a]=t.call(o,e[a],a,e));return n}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/memoizeStringOnly.js":[function(e,t,o){"use strict";function n(e){var t={};return function(o){return t.hasOwnProperty(o)||(t[o]=e.call(this,o)),t[o]}}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/performance.js":[function(e,t,o){"use strict";var n,r=e("./ExecutionEnvironment");r.canUseDOM&&(n=window.performance||window.msPerformance||window.webkitPerformance),t.exports=n||{}},{"./ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/performanceNow.js":[function(e,t,o){"use strict";var n=e("./performance"),r=n;r&&r.now||(r=Date);var a=r.now.bind(r);t.exports=a},{"./performance":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/performance.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/shallowEqual.js":[function(e,t,o){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(var a=r.bind(t),s=0;s<o.length;s++)if(!a(o[s])||e[o[s]]!==t[o[s]])return!1;return!0}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/toArray.js":[function(e,t,o){(function(o){"use strict";function n(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?"production"!==o.env.NODE_ENV?r(!1,"toArray: Array-like object expected"):r(!1):void 0,"number"!=typeof t?"production"!==o.env.NODE_ENV?r(!1,"toArray: Object needs a length property"):r(!1):void 0,0===t||t-1 in e?void 0:"production"!==o.env.NODE_ENV?r(!1,"toArray: Object should have keys for indices"):r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var a=Array(t),s=0;t>s;s++)a[s]=e[s];return a}var r=e("./invariant");t.exports=n}).call(this,e("_process"))},{"./invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js":[function(e,t,o){(function(o){"use strict";var n=e("./emptyFunction"),r=n;"production"!==o.env.NODE_ENV&&(r=function(e,t){for(var o=arguments.length,n=Array(o>2?o-2:0),r=2;o>r;r++)n[r-2]=arguments[r];if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){var a=0,s="Warning: "+t.replace(/%s/g,function(){return n[a++]});"undefined"!=typeof console&&console.error(s);try{throw new Error(s)}catch(l){}}}),t.exports=r}).call(this,e("_process"))},{"./emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-dom/index.js":[function(e,t,o){"use strict";t.exports=e("react/lib/ReactDOM")},{"react/lib/ReactDOM":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOM.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastContainer.js":[function(e,t,o){"use strict";function n(){}var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a=e("react"),s=e("react-addons-update"),l=a.createFactory(e("./ToastMessage"));t.exports=a.createClass({displayName:"ToastContainer",error:function(e,t,o){this._notify(this.props.toastType.error,e,t,o)},info:function(e,t,o){this._notify(this.props.toastType.info,e,t,o)},success:function(e,t,o){this._notify(this.props.toastType.success,e,t,o)},warning:function(e,t,o){this._notify(this.props.toastType.warning,e,t,o)},clear:function(){var e,t=this.refs;for(e in t)t[e].hideToast(!1)},getDefaultProps:function(){return{toastType:{error:"error",info:"info",success:"success",warning:"warning"},id:"toast-container",toastMessageFactory:l,preventDuplicates:!1,newestOnTop:!0,onClick:n}},getInitialState:function(){return{toasts:[],toastId:0,previousMessage:null}},render:function(){return this._render(this.props,this.state)},_notify:function(e,t,o,n){var r=this.props,a=this.state;if(!r.preventDuplicates||a.previousMessage!==t){var l=a.toastId++,i=l,c=s(n||{},{$merge:{type:e,title:o,message:t,toastId:i,key:l,ref:"toasts__"+l,handleOnClick:this._handle_toast_on_click,handleRemove:this._handle_toast_remove}}),d={};d[""+(r.newestOnTop?"$unshift":"$push")]=[c];var u=s(a,{toasts:d,previousMessage:{$set:t}});this.setState(u)}},_handle_toast_on_click:function(e){this.props.onClick(e),e.defaultPrevented||(e.preventDefault(),e.stopPropagation())},_handle_toast_remove:function(e){var t=this,o=this.state;o.toasts[""+(this.props.newestOnTop?"reduceRight":"reduce")](function(n,r,a){return n||r.toastId!==e?!1:(t.setState(s(o,{toasts:{$splice:[[a,1]]}})),!0)},!1)},_render:function(e,t){return a.createElement("div",r({},e,{"aria-live":"polite",role:"alert"}),t.toasts.map(function(t){return e.toastMessageFactory(t)}))}})},{"./ToastMessage":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/react.js","react-addons-update":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react-addons-update/index.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/animationMixin.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/CSSCore"),r=e("react/lib/ReactTransitionEvents"),a=e("react-dom"),s=17,l=Object.prototype.toString;t.exports={getDefaultProps:function(){return{transition:null,showAnimation:"animated bounceIn",hideAnimation:"animated bounceOut",timeOut:5e3,extendedTimeOut:1e3}},componentWillMount:function(){this.classNameQueue=[],this.isHiding=!1,this.intervalId=null},componentDidMount:function(){var e=this,t=this.props;this._show(t);var o=function s(){e.isHiding&&(e._set_is_hiding(!1),r.removeEndEventListener(n,s),e._handle_remove())},n=a.findDOMNode(this);r.addEndEventListener(n,o),0<t.timeOut&&this._set_interval_id(setTimeout(this.hideToast,t.timeOut))},componentWillUnmount:function(){this.intervalId&&clearTimeout(this.intervalId)},_set_transition:function(e){var t=e?"leave":"enter",o=a.findDOMNode(this),s=this.props.transition+"-"+t,l=s+"-active",i=function c(e){e&&e.target!==o||(n.removeClass(o,s),n.removeClass(o,l),r.removeEndEventListener(o,c))};r.addEndEventListener(o,i),n.addClass(o,s),this._queue_class(l)},_clear_transition:function(e){var t=a.findDOMNode(this),o=e?"leave":"enter",r=this.props.transition+"-"+o,s=r+"-active";n.removeClass(t,r),n.removeClass(t,s)},_set_animation:function(e){var t=a.findDOMNode(this),o=this._get_animation_classes(e),s=function l(e){e&&e.target!==t||(o.forEach(function(e){n.removeClass(t,e)}),r.removeEndEventListener(t,l))};r.addEndEventListener(t,s),o.forEach(function(e){n.addClass(t,e)})},_get_animation_classes:function(e){var t=this.props,o=e?t.hideAnimation:t.showAnimation;return"[object Array]"===l.call(o)?o:"string"==typeof o?o.split(" "):void 0},_clear_animation:function(e){var t=this,o=this._get_animation_classes(e);o.forEach(function(e){n.removeClass(a.findDOMNode(t),e)})},_queue_class:function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this._flush_class_name_queue,s))},_flush_class_name_queue:function(){this.isMounted()&&this.classNameQueue.forEach(n.addClass.bind(n,a.findDOMNode(this))),this.classNameQueue.length=0,this.timeout=null},_show:function(){var e=this.props;e.transition?this._set_transition():e.showAnimation&&this._set_animation()},handleMouseEnter:function(){if(clearTimeout(this.intervalId),this._set_interval_id(null),this.isHiding){this._set_is_hiding(!1);var e=this.props;e.hideAnimation?this._clear_animation(!0):e.transition&&this._clear_transition(!0)}},handleMouseLeave:function(){var e=this.props;!this.isHiding&&(0<e.timeOut||0<e.extendedTimeOut)&&this._set_interval_id(setTimeout(this.hideToast,e.extendedTimeOut))},hideToast:function(e){var t=this.props;this.isHiding||null==this.intervalId&&!e||(this._set_is_hiding(!0),t.transition?this._set_transition(!0):t.hideAnimation?this._set_animation(!0):this._handle_remove())},_set_interval_id:function(e){this.intervalId=e},_set_is_hiding:function(e){this.isHiding=e}}},{"fbjs/lib/CSSCore":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/CSSCore.js","react-dom":"/Users/allen/Node/react-bootstrap-table/node_modules/react-dom/index.js","react/lib/ReactTransitionEvents":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactTransitionEvents.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/index.js":[function(e,t,o){"use strict";function n(){}var r=e("react"),a=e("react-addons-update"),s=e("classnames"),l={displayName:"ToastMessage",getDefaultProps:function(){var e={error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"};return{className:"toast",iconClassNames:e,titleClassName:"toast-title",messageClassName:"toast-message",tapToDismiss:!0,closeButton:!1}},handleOnClick:function(e){var t=this.props;t.handleOnClick(e),t.tapToDismiss&&this.hideToast(!0)},_handle_close_button_click:function(e){e.stopPropagation(),this.hideToast(!0)},_handle_remove:function(){var e=this.props;e.handleRemove(e.toastId)},_render_close_button:function(e){return e.closeButton?r.createElement("button",{className:"toast-close-button",role:"button",onClick:this._handle_close_button_click,dangerouslySetInnerHTML:{__html:"&times;"}}):!1},_render_title_element:function(e){return e.title?r.createElement("div",{className:e.titleClassName},e.title):!1},_render_message_element:function(e){return e.message?r.createElement("div",{className:e.messageClassName},e.message):!1},render:function(){var e=this.props,t=e.iconClassName||e.iconClassNames[e.type],o={};return o[e.className]=!0,o[t]=!0,r.createElement("div",{className:s(o),style:e.style||{},onClick:this.handleOnClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},this._render_close_button(e),this._render_title_element(e),this._render_message_element(e))}},i=r.createClass(a(l,{displayName:{$set:"ToastMessage.animation"},mixins:{$set:[e("./animationMixin")]}})),c=r.createClass(a(l,{displayName:{$set:"ToastMessage.jQuery"},mixins:{$set:[e("./jQueryMixin")]}}));l.handleMouseEnter=n,l.handleMouseLeave=n,l.hideToast=n;var d=t.exports=r.createClass(l);d.animation=i,d.jQuery=c},{"./animationMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/animationMixin.js","./jQueryMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/jQueryMixin.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/react.js","react-addons-update":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react-addons-update/index.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/jQueryMixin.js":[function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){e[t.showMethod]({duration:t.showDuration,easing:t.showEasing})}var a=e("react-dom"),s=n(a);t.exports={getDefaultProps:function(){return{style:{display:"none"},showMethod:"fadeIn",showDuration:300,showEasing:"swing",hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",timeOut:5e3,extendedTimeOut:1e3}},getInitialState:function(){return{intervalId:null,isHiding:!1}},componentDidMount:function(){var e=this.props;r(this._get_$_node(),e),0<e.timeOut&&this._set_interval_id(setTimeout(this.hideToast,e.timeOut))},handleMouseEnter:function(){clearTimeout(this.state.intervalId),this._set_interval_id(null),this._set_is_hiding(!1),r(this._get_$_node().stop(!0,!0),this.props)},handleMouseLeave:function(){var e=this.props;!this.state.isHiding&&(0<e.timeOut||0<e.extendedTimeOut)&&this._set_interval_id(setTimeout(this.hideToast,e.extendedTimeOut))},hideToast:function(e){var t=this.state,o=this.props;t.isHiding||null==t.intervalId&&!e||(this.setState({isHiding:!0}),this._get_$_node()[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:this._handle_remove}))},_get_$_node:function(){return jQuery(s["default"].findDOMNode(this))},_set_interval_id:function(e){this.setState({intervalId:e})},_set_is_hiding:function(e){this.setState({isHiding:e})}}},{"react-dom":"/Users/allen/Node/react-bootstrap-table/node_modules/react-dom/index.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/index.js":[function(e,t,o){"use strict";o.ToastContainer=e("./ToastContainer"),o.ToastMessage=e("./ToastMessage")},{"./ToastContainer":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastContainer.js","./ToastMessage":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/ToastMessage/index.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react-addons-update/index.js":[function(e,t,o){t.exports=e("react/lib/update")},{"react/lib/update":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/update.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/AutoFocusUtils.js":[function(e,t,o){"use strict";var n=e("./ReactMount"),r=e("./findDOMNode"),a=e("fbjs/lib/focusNode"),s={componentDidMount:function(){this.props.autoFocus&&a(r(this))}},l={Mixin:s,focusDOMComponent:function(){a(n.getNode(this._rootNodeID))}};t.exports=l},{"./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/findDOMNode.js","fbjs/lib/focusNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/focusNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/BeforeInputEventPlugin.js":[function(e,t,o){"use strict";function n(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function r(e){ return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function a(e){switch(e){case U.topCompositionStart:return w.compositionStart;case U.topCompositionEnd:return w.compositionEnd;case U.topCompositionUpdate:return w.compositionUpdate}}function s(e,t){return e===U.topKeyDown&&t.keyCode===y}function l(e,t){switch(e){case U.topKeyUp:return-1!==N.indexOf(t.keyCode);case U.topKeyDown:return t.keyCode!==y;case U.topKeyPress:case U.topMouseDown:case U.topBlur:return!0;default:return!1}}function i(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function c(e,t,o,n,r){var c,d;if(E?c=a(e):M?l(e,n)&&(c=w.compositionEnd):s(e,n)&&(c=w.compositionStart),!c)return null;R&&(M||c!==w.compositionStart?c===w.compositionEnd&&M&&(d=M.getData()):M=h.getPooled(t));var u=v.getPooled(c,o,n,r);if(d)u.data=d;else{var p=i(n);null!==p&&(u.data=p)}return m.accumulateTwoPhaseDispatches(u),u}function d(e,t){switch(e){case U.topCompositionEnd:return i(t);case U.topKeyPress:var o=t.which;return o!==O?null:(P=!0,D);case U.topTextInput:var n=t.data;return n===D&&P?null:n;default:return null}}function u(e,t){if(M){if(e===U.topCompositionEnd||l(e,t)){var o=M.getData();return h.release(M),M=null,o}return null}switch(e){case U.topPaste:return null;case U.topKeyPress:return t.which&&!r(t)?String.fromCharCode(t.which):null;case U.topCompositionEnd:return R?null:t.data;default:return null}}function p(e,t,o,n,r){var a;if(a=C?d(e,n):u(e,n),!a)return null;var s=_.getPooled(w.beforeInput,o,n,r);return s.data=a,m.accumulateTwoPhaseDispatches(s),s}var b=e("./EventConstants"),m=e("./EventPropagators"),f=e("fbjs/lib/ExecutionEnvironment"),h=e("./FallbackCompositionState"),v=e("./SyntheticCompositionEvent"),_=e("./SyntheticInputEvent"),g=e("fbjs/lib/keyOf"),N=[9,13,27,32],y=229,E=f.canUseDOM&&"CompositionEvent"in window,j=null;f.canUseDOM&&"documentMode"in document&&(j=document.documentMode);var C=f.canUseDOM&&"TextEvent"in window&&!j&&!n(),R=f.canUseDOM&&(!E||j&&j>8&&11>=j),O=32,D=String.fromCharCode(O),U=b.topLevelTypes,w={beforeInput:{phasedRegistrationNames:{bubbled:g({onBeforeInput:null}),captured:g({onBeforeInputCapture:null})},dependencies:[U.topCompositionEnd,U.topKeyPress,U.topTextInput,U.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:g({onCompositionEnd:null}),captured:g({onCompositionEndCapture:null})},dependencies:[U.topBlur,U.topCompositionEnd,U.topKeyDown,U.topKeyPress,U.topKeyUp,U.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:g({onCompositionStart:null}),captured:g({onCompositionStartCapture:null})},dependencies:[U.topBlur,U.topCompositionStart,U.topKeyDown,U.topKeyPress,U.topKeyUp,U.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:g({onCompositionUpdate:null}),captured:g({onCompositionUpdateCapture:null})},dependencies:[U.topBlur,U.topCompositionUpdate,U.topKeyDown,U.topKeyPress,U.topKeyUp,U.topMouseDown]}},P=!1,M=null,S={eventTypes:w,extractEvents:function(e,t,o,n,r){return[c(e,t,o,n,r),p(e,t,o,n,r)]}};t.exports=S},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPropagators.js","./FallbackCompositionState":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/FallbackCompositionState.js","./SyntheticCompositionEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticCompositionEvent.js","./SyntheticInputEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticInputEvent.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CSSProperty.js":[function(e,t,o){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},a=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){a.forEach(function(t){r[n(t,e)]=r[e]})});var s={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},l={isUnitlessNumber:r,shorthandPropertyExpansions:s};t.exports=l},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CSSPropertyOperations.js":[function(e,t,o){(function(o){"use strict";var n=e("./CSSProperty"),r=e("fbjs/lib/ExecutionEnvironment"),a=e("./ReactPerf"),s=e("fbjs/lib/camelizeStyleName"),l=e("./dangerousStyleValue"),i=e("fbjs/lib/hyphenateStyleName"),c=e("fbjs/lib/memoizeStringOnly"),d=e("fbjs/lib/warning"),u=c(function(e){return i(e)}),p=!1,b="cssFloat";if(r.canUseDOM){var m=document.createElement("div").style;try{m.font=""}catch(f){p=!0}void 0===document.documentElement.style.cssFloat&&(b="styleFloat")}if("production"!==o.env.NODE_ENV)var h=/^(?:webkit|moz|o)[A-Z]/,v=/;\s*$/,_={},g={},N=function(e){_.hasOwnProperty(e)&&_[e]||(_[e]=!0,"production"!==o.env.NODE_ENV?d(!1,"Unsupported style property %s. Did you mean %s?",e,s(e)):void 0)},y=function(e){_.hasOwnProperty(e)&&_[e]||(_[e]=!0,"production"!==o.env.NODE_ENV?d(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):void 0)},E=function(e,t){g.hasOwnProperty(t)&&g[t]||(g[t]=!0,"production"!==o.env.NODE_ENV?d(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,t.replace(v,"")):void 0)},j=function(e,t){e.indexOf("-")>-1?N(e):h.test(e)?y(e):v.test(t)&&E(e,t)};var C={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"production"!==o.env.NODE_ENV&&j(n,r),null!=r&&(t+=u(n)+":",t+=l(n,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var a in t)if(t.hasOwnProperty(a)){"production"!==o.env.NODE_ENV&&j(a,t[a]);var s=l(a,t[a]);if("float"===a&&(a=b),s)r[a]=s;else{var i=p&&n.shorthandPropertyExpansions[a];if(i)for(var c in i)r[c]="";else r[a]=""}}}};a.measureMethods(C,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),t.exports=C}).call(this,e("_process"))},{"./CSSProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CSSProperty.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./dangerousStyleValue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/dangerousStyleValue.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/camelizeStyleName":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/camelizeStyleName.js","fbjs/lib/hyphenateStyleName":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/hyphenateStyleName.js","fbjs/lib/memoizeStringOnly":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/memoizeStringOnly.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CallbackQueue.js":[function(e,t,o){(function(o){"use strict";function n(){this._callbacks=null,this._contexts=null}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("fbjs/lib/invariant");a(n.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){e.length!==t.length?"production"!==o.env.NODE_ENV?s(!1,"Mismatched list of contexts in callback queue"):s(!1):void 0,this._callbacks=null,this._contexts=null;for(var n=0;n<e.length;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ChangeEventPlugin.js":[function(e,t,o){"use strict";function n(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function r(e){var t=j.getPooled(w.change,M,e,C(e));N.accumulateTwoPhaseDispatches(t),E.batchedUpdates(a,t)}function a(e){g.enqueueEvents(e),g.processEventQueue(!1)}function s(e,t){P=e,M=t,P.attachEvent("onchange",r)}function l(){P&&(P.detachEvent("onchange",r),P=null,M=null)}function i(e,t,o){return e===U.topChange?o:void 0}function c(e,t,o){e===U.topFocus?(l(),s(t,o)):e===U.topBlur&&l()}function d(e,t){P=e,M=t,S=e.value,T=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(P,"value",k),P.attachEvent("onpropertychange",p)}function u(){P&&(delete P.value,P.detachEvent("onpropertychange",p),P=null,M=null,S=null,T=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==S&&(S=t,r(e))}}function b(e,t,o){return e===U.topInput?o:void 0}function m(e,t,o){e===U.topFocus?(u(),d(t,o)):e===U.topBlur&&u()}function f(e,t,o){return e!==U.topSelectionChange&&e!==U.topKeyUp&&e!==U.topKeyDown||!P||P.value===S?void 0:(S=P.value,M)}function h(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,o){return e===U.topClick?o:void 0}var _=e("./EventConstants"),g=e("./EventPluginHub"),N=e("./EventPropagators"),y=e("fbjs/lib/ExecutionEnvironment"),E=e("./ReactUpdates"),j=e("./SyntheticEvent"),C=e("./getEventTarget"),R=e("./isEventSupported"),O=e("./isTextInputElement"),D=e("fbjs/lib/keyOf"),U=_.topLevelTypes,w={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})},dependencies:[U.topBlur,U.topChange,U.topClick,U.topFocus,U.topInput,U.topKeyDown,U.topKeyUp,U.topSelectionChange]}},P=null,M=null,S=null,T=null,I=!1;y.canUseDOM&&(I=R("change")&&(!("documentMode"in document)||document.documentMode>8));var x=!1;y.canUseDOM&&(x=R("input")&&(!("documentMode"in document)||document.documentMode>9));var k={get:function(){return T.get.call(this)},set:function(e){S=""+e,T.set.call(this,e)}},V={eventTypes:w,extractEvents:function(e,t,o,r,a){var s,l;if(n(t)?I?s=i:l=c:O(t)?x?s=b:(s=f,l=m):h(t)&&(s=v),s){var d=s(e,t,o);if(d){var u=j.getPooled(w.change,d,r,a);return u.type="change",N.accumulateTwoPhaseDispatches(u),u}}l&&l(e,t,o)}};t.exports=V},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPropagators.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventTarget.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isTextInputElement.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ClientReactRootIndex.js":[function(e,t,o){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMChildrenOperations.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){var n=o>=e.childNodes.length?null:e.childNodes.item(o);e.insertBefore(t,n)}var r=e("./Danger"),a=e("./ReactMultiChildUpdateTypes"),s=e("./ReactPerf"),l=e("./setInnerHTML"),i=e("./setTextContent"),c=e("fbjs/lib/invariant"),d={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,updateTextContent:i,processUpdates:function(e,t){for(var s,d=null,u=null,p=0;p<e.length;p++)if(s=e[p],s.type===a.MOVE_EXISTING||s.type===a.REMOVE_NODE){var b=s.fromIndex,m=s.parentNode.childNodes[b],f=s.parentID;m?void 0:"production"!==o.env.NODE_ENV?c(!1,"processUpdates(): Unable to find child %s of element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",b,f):c(!1),d=d||{},d[f]=d[f]||[],d[f][b]=m,u=u||[],u.push(m)}var h;if(h=t.length&&"string"==typeof t[0]?r.dangerouslyRenderMarkup(t):t,u)for(var v=0;v<u.length;v++)u[v].parentNode.removeChild(u[v]);for(var _=0;_<e.length;_++)switch(s=e[_],s.type){case a.INSERT_MARKUP:n(s.parentNode,h[s.markupIndex],s.toIndex);break;case a.MOVE_EXISTING:n(s.parentNode,d[s.parentID][s.fromIndex],s.toIndex);break;case a.SET_MARKUP:l(s.parentNode,s.content);break;case a.TEXT_CONTENT:i(s.parentNode,s.content);break;case a.REMOVE_NODE:}}};s.measureMethods(d,"DOMChildrenOperations",{updateTextContent:"updateTextContent"}),t.exports=d}).call(this,e("_process"))},{"./Danger":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setInnerHTML.js","./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setTextContent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js":[function(e,t,o){(function(o){"use strict";function n(e,t){return(e&t)===t}var r=e("fbjs/lib/invariant"),a={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=a,s=e.Properties||{},i=e.DOMAttributeNamespaces||{},c=e.DOMAttributeNames||{},d=e.DOMPropertyNames||{},u=e.DOMMutationMethods||{};e.isCustomAttribute&&l._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in s){l.properties.hasOwnProperty(p)?"production"!==o.env.NODE_ENV?r(!1,"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",p):r(!1):void 0;var b=p.toLowerCase(),m=s[p],f={attributeName:b,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseAttribute:n(m,t.MUST_USE_ATTRIBUTE),mustUseProperty:n(m,t.MUST_USE_PROPERTY),hasSideEffects:n(m,t.HAS_SIDE_EFFECTS),hasBooleanValue:n(m,t.HAS_BOOLEAN_VALUE),hasNumericValue:n(m,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:n(m,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:n(m,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(f.mustUseAttribute&&f.mustUseProperty?"production"!==o.env.NODE_ENV?r(!1,"DOMProperty: Cannot require using both attribute and property: %s",p):r(!1):void 0,!f.mustUseProperty&&f.hasSideEffects?"production"!==o.env.NODE_ENV?r(!1,"DOMProperty: Properties that have side effects must use property: %s",p):r(!1):void 0,f.hasBooleanValue+f.hasNumericValue+f.hasOverloadedBooleanValue<=1?void 0:"production"!==o.env.NODE_ENV?r(!1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",p):r(!1),"production"!==o.env.NODE_ENV&&(l.getPossibleStandardName[b]=p),c.hasOwnProperty(p)){var h=c[p];f.attributeName=h,"production"!==o.env.NODE_ENV&&(l.getPossibleStandardName[h]=p)}i.hasOwnProperty(p)&&(f.attributeNamespace=i[p]),d.hasOwnProperty(p)&&(f.propertyName=d[p]),u.hasOwnProperty(p)&&(f.mutationMethod=u[p]),l.properties[p]=f}}},s={},l={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:"production"!==o.env.NODE_ENV?{}:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<l._isCustomAttributeFunctions.length;t++){var o=l._isCustomAttributeFunctions[t];if(o(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var o,n=s[e];return n||(s[e]=n={}),t in n||(o=document.createElement(e),n[t]=o[t]),n[t]},injection:a};t.exports=l}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMPropertyOperations.js":[function(e,t,o){(function(o){"use strict";function n(e){return u.hasOwnProperty(e)?!0:d.hasOwnProperty(e)?!1:c.test(e)?(u[e]=!0,!0):(d[e]=!0,"production"!==o.env.NODE_ENV?i(!1,"Invalid attribute name: `%s`",e):void 0,!1)}function r(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&1>t||e.hasOverloadedBooleanValue&&t===!1}var a=e("./DOMProperty"),s=e("./ReactPerf"),l=e("./quoteAttributeValueForBrowser"),i=e("fbjs/lib/warning"),c=/^[a-zA-Z_][\w\.\-]*$/,d={},u={};if("production"!==o.env.NODE_ENV)var p={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},b={},m=function(e){if(!(p.hasOwnProperty(e)&&p[e]||b.hasOwnProperty(e)&&b[e])){b[e]=!0;var t=e.toLowerCase(),n=a.isCustomAttribute(t)?t:a.getPossibleStandardName.hasOwnProperty(t)?a.getPossibleStandardName[t]:null;"production"!==o.env.NODE_ENV?i(null==n,"Unknown DOM property %s. Did you mean %s?",e,n):void 0}};var f={createMarkupForID:function(e){return a.ID_ATTRIBUTE_NAME+"="+l(e)},setAttributeForID:function(e,t){e.setAttribute(a.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=a.properties.hasOwnProperty(e)?a.properties[e]:null;if(n){if(r(n,t))return"";var s=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?s+'=""':s+"="+l(t)}return a.isCustomAttribute(e)?null==t?"":e+"="+l(t):("production"!==o.env.NODE_ENV&&m(e),null)},createMarkupForCustomAttribute:function(e,t){return n(e)&&null!=t?e+"="+l(t):""},setValueForProperty:function(e,t,n){var s=a.properties.hasOwnProperty(t)?a.properties[t]:null;if(s){var l=s.mutationMethod;if(l)l(e,n);else if(r(s,n))this.deleteValueForProperty(e,t);else if(s.mustUseAttribute){var i=s.attributeName,c=s.attributeNamespace;c?e.setAttributeNS(c,i,""+n):s.hasBooleanValue||s.hasOverloadedBooleanValue&&n===!0?e.setAttribute(i,""):e.setAttribute(i,""+n)}else{var d=s.propertyName;s.hasSideEffects&&""+e[d]==""+n||(e[d]=n)}}else a.isCustomAttribute(t)?f.setValueForAttribute(e,t,n):"production"!==o.env.NODE_ENV&&m(t)},setValueForAttribute:function(e,t,o){n(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){var n=a.properties.hasOwnProperty(t)?a.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var s=n.propertyName,l=a.getDefaultValueForProperty(e.nodeName,s);n.hasSideEffects&&""+e[s]===l||(e[s]=l)}}else a.isCustomAttribute(t)?e.removeAttribute(t):"production"!==o.env.NODE_ENV&&m(t)}};s.measureMethods(f,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),t.exports=f}).call(this,e("_process"))},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./quoteAttributeValueForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/quoteAttributeValueForBrowser.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Danger.js":[function(e,t,o){(function(o){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e("fbjs/lib/ExecutionEnvironment"),a=e("fbjs/lib/createNodesFromMarkup"),s=e("fbjs/lib/emptyFunction"),l=e("fbjs/lib/getMarkupWrap"),i=e("fbjs/lib/invariant"),c=/^(<[^ \/>]+)/,d="data-danger-index",u={dangerouslyRenderMarkup:function(e){r.canUseDOM?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString for server rendering."):i(!1);for(var t,u={},p=0;p<e.length;p++)e[p]?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyRenderMarkup(...): Missing markup."):i(!1),t=n(e[p]),t=l(t)?t:"*",u[t]=u[t]||[],u[t][p]=e[p];var b=[],m=0;for(t in u)if(u.hasOwnProperty(t)){var f,h=u[t];for(f in h)if(h.hasOwnProperty(f)){var v=h[f];h[f]=v.replace(c,"$1 "+d+'="'+f+'" ')}for(var _=a(h.join(""),s),g=0;g<_.length;++g){var N=_[g];N.hasAttribute&&N.hasAttribute(d)?(f=+N.getAttribute(d),N.removeAttribute(d),b.hasOwnProperty(f)?"production"!==o.env.NODE_ENV?i(!1,"Danger: Assigning to an already-occupied result index."):i(!1):void 0,b[f]=N,m+=1):"production"!==o.env.NODE_ENV&&console.error("Danger: Discarding unexpected node:",N)}}return m!==b.length?"production"!==o.env.NODE_ENV?i(!1,"Danger: Did not assign to every index of resultList."):i(!1):void 0,b.length!==e.length?"production"!==o.env.NODE_ENV?i(!1,"Danger: Expected markup to render %s nodes, but rendered %s.",e.length,b.length):i(!1):void 0,b},dangerouslyReplaceNodeWithMarkup:function(e,t){r.canUseDOM?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering."):i(!1),t?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyReplaceNodeWithMarkup(...): Missing markup."):i(!1),"html"===e.tagName.toLowerCase()?"production"!==o.env.NODE_ENV?i(!1,"dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString()."):i(!1):void 0;var n;n="string"==typeof t?a(t,s)[0]:t,e.parentNode.replaceChild(n,e)}};t.exports=u}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/createNodesFromMarkup":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/createNodesFromMarkup.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/getMarkupWrap":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getMarkupWrap.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DefaultEventPluginOrder.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/keyOf"),r=[n({ResponderEventPlugin:null}),n({SimpleEventPlugin:null}),n({TapEventPlugin:null}),n({EnterLeaveEventPlugin:null}),n({ChangeEventPlugin:null}),n({SelectEventPlugin:null}),n({BeforeInputEventPlugin:null})];t.exports=r},{"fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EnterLeaveEventPlugin.js":[function(e,t,o){"use strict";var n=e("./EventConstants"),r=e("./EventPropagators"),a=e("./SyntheticMouseEvent"),s=e("./ReactMount"),l=e("fbjs/lib/keyOf"),i=n.topLevelTypes,c=s.getFirstReactDOM,d={mouseEnter:{registrationName:l({onMouseEnter:null}),dependencies:[i.topMouseOut,i.topMouseOver]},mouseLeave:{registrationName:l({onMouseLeave:null}),dependencies:[i.topMouseOut,i.topMouseOver]}},u=[null,null],p={eventTypes:d,extractEvents:function(e,t,o,n,l){if(e===i.topMouseOver&&(n.relatedTarget||n.fromElement))return null;if(e!==i.topMouseOut&&e!==i.topMouseOver)return null;var p;if(t.window===t)p=t;else{var b=t.ownerDocument;p=b?b.defaultView||b.parentWindow:window}var m,f,h="",v="";if(e===i.topMouseOut?(m=t,h=o,f=c(n.relatedTarget||n.toElement),f?v=s.getID(f):f=p,f=f||p):(m=p,f=t,v=o),m===f)return null;var _=a.getPooled(d.mouseLeave,h,n,l);_.type="mouseleave",_.target=m,_.relatedTarget=f;var g=a.getPooled(d.mouseEnter,v,n,l);return g.type="mouseenter",g.target=f,g.relatedTarget=m,r.accumulateEnterLeaveDispatches(_,g,h,v),u[0]=_,u[1]=g,u}};t.exports=p},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPropagators.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticMouseEvent.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/keyMirror"),r=n({bubbled:null,captured:null}),a=n({topAbort:null,topBlur:null,topCanPlay:null,topCanPlayThrough:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topDurationChange:null,topEmptied:null,topEncrypted:null,topEnded:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topLoadedData:null,topLoadedMetadata:null,topLoadStart:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topPause:null,topPlay:null,topPlaying:null,topProgress:null,topRateChange:null,topReset:null,topScroll:null,topSeeked:null,topSeeking:null,topSelectionChange:null,topStalled:null,topSubmit:null,topSuspend:null,topTextInput:null,topTimeUpdate:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topVolumeChange:null,topWaiting:null,topWheel:null}),s={topLevelTypes:a,PropagationPhases:r};t.exports=s},{"fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginHub.js":[function(e,t,o){(function(o){"use strict";function n(){var e=h&&h.traverseTwoPhase&&h.traverseEnterLeave;"production"!==o.env.NODE_ENV?d(e,"InstanceHandle not injected before use!"):void 0}var r=e("./EventPluginRegistry"),a=e("./EventPluginUtils"),s=e("./ReactErrorUtils"),l=e("./accumulateInto"),i=e("./forEachAccumulated"),c=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),u={},p=null,b=function(e,t){e&&(a.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},m=function(e){return b(e,!0)},f=function(e){return b(e,!1)},h=null,v={injection:{injectMount:a.injection.injectMount,injectInstanceHandle:function(e){h=e,"production"!==o.env.NODE_ENV&&n()},getInstanceHandle:function(){return"production"!==o.env.NODE_ENV&&n(),h},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){"function"!=typeof n?"production"!==o.env.NODE_ENV?c(!1,"Expected %s listener to be a function, instead got type %s",t,typeof n):c(!1):void 0;var a=u[t]||(u[t]={});a[e]=n;var s=r.registrationNameModules[t];s&&s.didPutListener&&s.didPutListener(e,t,n)},getListener:function(e,t){var o=u[t];return o&&o[e]},deleteListener:function(e,t){var o=r.registrationNameModules[t];o&&o.willDeleteListener&&o.willDeleteListener(e,t);var n=u[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in u)if(u[t][e]){var o=r.registrationNameModules[t];o&&o.willDeleteListener&&o.willDeleteListener(e,t),delete u[t][e]}},extractEvents:function(e,t,o,n,a){for(var s,i=r.plugins,c=0;c<i.length;c++){var d=i[c];if(d){var u=d.extractEvents(e,t,o,n,a);u&&(s=l(s,u))}}return s},enqueueEvents:function(e){e&&(p=l(p,e))},processEventQueue:function(e){var t=p;p=null,e?i(t,m):i(t,f),p?"production"!==o.env.NODE_ENV?c(!1,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):c(!1):void 0,s.rethrowCaughtError()},__purge:function(){u={}},__getListenerBank:function(){return u}};t.exports=v}).call(this,e("_process"))},{"./EventPluginRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginRegistry.js","./EventPluginUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginUtils.js", "./ReactErrorUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactErrorUtils.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/forEachAccumulated.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginRegistry.js":[function(e,t,o){(function(o){"use strict";function n(){if(l)for(var e in i){var t=i[e],n=l.indexOf(e);if(n>-1?void 0:"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):s(!1),!c.plugins[n]){t.extractEvents?void 0:"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):s(!1),c.plugins[n]=t;var a=t.eventTypes;for(var d in a)r(a[d],t,d)?void 0:"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",d,e):s(!1)}}}function r(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)?"production"!==o.env.NODE_ENV?s(!1,"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",n):s(!1):void 0,c.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var l in r)if(r.hasOwnProperty(l)){var i=r[l];a(i,t,n)}return!0}return e.registrationName?(a(e.registrationName,t,n),!0):!1}function a(e,t,n){c.registrationNameModules[e]?"production"!==o.env.NODE_ENV?s(!1,"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):s(!1):void 0,c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var s=e("fbjs/lib/invariant"),l=null,i={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){l?"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):s(!1):void 0,l=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];i.hasOwnProperty(r)&&i[r]===a||(i[r]?"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",r):s(!1):void 0,i[r]=a,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;for(var o in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(o)){var n=c.registrationNameModules[t.phasedRegistrationNames[o]];if(n)return n}return null},_resetEventPlugins:function(){l=null;for(var e in i)i.hasOwnProperty(e)&&delete i[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var o in t)t.hasOwnProperty(o)&&delete t[o];var n=c.registrationNameModules;for(var r in n)n.hasOwnProperty(r)&&delete n[r]}};t.exports=c}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginUtils.js":[function(e,t,o){(function(o){"use strict";function n(e){return e===_.topMouseUp||e===_.topTouchEnd||e===_.topTouchCancel}function r(e){return e===_.topMouseMove||e===_.topTouchMove}function a(e){return e===_.topMouseDown||e===_.topTouchStart}function s(e,t,o,n){var r=e.type||"unknown-event";e.currentTarget=v.Mount.getNode(n),t?m.invokeGuardedCallbackWithCatch(r,o,e,n):m.invokeGuardedCallback(r,o,e,n),e.currentTarget=null}function l(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if("production"!==o.env.NODE_ENV&&p(e),Array.isArray(n))for(var a=0;a<n.length&&!e.isPropagationStopped();a++)s(e,t,n[a],r[a]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchIDs=null}function i(e){var t=e._dispatchListeners,n=e._dispatchIDs;if("production"!==o.env.NODE_ENV&&p(e),Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function c(e){var t=i(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function d(e){"production"!==o.env.NODE_ENV&&p(e);var t=e._dispatchListeners,n=e._dispatchIDs;Array.isArray(t)?"production"!==o.env.NODE_ENV?f(!1,"executeDirectDispatch(...): Invalid `event`."):f(!1):void 0;var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function u(e){return!!e._dispatchListeners}var p,b=e("./EventConstants"),m=e("./ReactErrorUtils"),f=e("fbjs/lib/invariant"),h=e("fbjs/lib/warning"),v={Mount:null,injectMount:function(e){v.Mount=e,"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?h(e&&e.getNode&&e.getID,"EventPluginUtils.injection.injectMount(...): Injected Mount module is missing getNode or getID."):void 0)}},_=b.topLevelTypes;"production"!==o.env.NODE_ENV&&(p=function(e){var t=e._dispatchListeners,n=e._dispatchIDs,r=Array.isArray(t),a=Array.isArray(n),s=a?n.length:n?1:0,l=r?t.length:t?1:0;"production"!==o.env.NODE_ENV?h(a===r&&s===l,"EventPluginUtils: Invalid `event`."):void 0});var g={isEndish:n,isMoveish:r,isStartish:a,executeDirectDispatch:d,executeDispatchesInOrder:l,executeDispatchesInOrderStopAtTrue:c,hasDispatches:u,getNode:function(e){return v.Mount.getNode(e)},getID:function(e){return v.Mount.getID(e)},injection:v};t.exports=g}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./ReactErrorUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactErrorUtils.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPropagators.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){var n=t.dispatchConfig.phasedRegistrationNames[o];return g(e,n)}function r(e,t,r){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?f(e,"Dispatching id must not be null"):void 0);var a=t?_.bubbled:_.captured,s=n(e,r,a);s&&(r._dispatchListeners=h(r._dispatchListeners,s),r._dispatchIDs=h(r._dispatchIDs,e))}function a(e){e&&e.dispatchConfig.phasedRegistrationNames&&m.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,r,e)}function s(e){e&&e.dispatchConfig.phasedRegistrationNames&&m.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(e.dispatchMarker,r,e)}function l(e,t,o){if(o&&o.dispatchConfig.registrationName){var n=o.dispatchConfig.registrationName,r=g(e,n);r&&(o._dispatchListeners=h(o._dispatchListeners,r),o._dispatchIDs=h(o._dispatchIDs,e))}}function i(e){e&&e.dispatchConfig.registrationName&&l(e.dispatchMarker,null,e)}function c(e){v(e,a)}function d(e){v(e,s)}function u(e,t,o,n){m.injection.getInstanceHandle().traverseEnterLeave(o,n,l,e,t)}function p(e){v(e,i)}var b=e("./EventConstants"),m=e("./EventPluginHub"),f=e("fbjs/lib/warning"),h=e("./accumulateInto"),v=e("./forEachAccumulated"),_=b.PropagationPhases,g=m.getListener,N={accumulateTwoPhaseDispatches:c,accumulateTwoPhaseDispatchesSkipTarget:d,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:u};t.exports=N}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginHub.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/forEachAccumulated.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/FallbackCompositionState.js":[function(e,t,o){"use strict";function n(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("./getTextContentAccessor");a(n.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[s()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,o=this._startText,n=o.length,r=this.getText(),a=r.length;for(e=0;n>e&&o[e]===r[e];e++);var s=n-e;for(t=1;s>=t&&o[n-t]===r[a-t];t++);var l=t>1?1-t:void 0;return this._fallbackText=r.slice(e,l),this._fallbackText}}),r.addPoolingTo(n),t.exports=n},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js","./getTextContentAccessor":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getTextContentAccessor.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/HTMLDOMPropertyConfig.js":[function(e,t,o){"use strict";var n,r=e("./DOMProperty"),a=e("fbjs/lib/ExecutionEnvironment"),s=r.injection.MUST_USE_ATTRIBUTE,l=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,c=r.injection.HAS_SIDE_EFFECTS,d=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,p=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(a.canUseDOM){var b=document.implementation;n=b&&b.hasFeature&&b.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var m={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:s|i,allowTransparency:s,alt:null,async:i,autoComplete:null,autoPlay:i,capture:s|i,cellPadding:null,cellSpacing:null,charSet:s,challenge:s,checked:l|i,classID:s,className:n?s:l,cols:s|u,colSpan:null,content:null,contentEditable:null,contextMenu:s,controls:l|i,coords:null,crossOrigin:null,data:null,dateTime:s,"default":i,defer:i,dir:null,disabled:s|i,download:p,draggable:null,encType:null,form:s,formAction:s,formEncType:s,formMethod:s,formNoValidate:i,formTarget:s,frameBorder:s,headers:null,height:s,hidden:s|i,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:l,inputMode:s,integrity:null,is:s,keyParams:s,keyType:s,kind:null,label:null,lang:null,list:s,loop:l|i,low:null,manifest:s,marginHeight:null,marginWidth:null,max:null,maxLength:s,media:s,mediaGroup:null,method:null,min:null,minLength:s,multiple:l|i,muted:l|i,name:null,noValidate:i,open:i,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:l|i,rel:null,required:i,role:s,rows:s|u,rowSpan:null,sandbox:null,scope:null,scoped:i,scrolling:null,seamless:s|i,selected:l|i,shape:null,size:s|u,sizes:s,span:u,spellCheck:null,src:null,srcDoc:l,srcLang:null,srcSet:s,start:d,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:l|c,width:s,wmode:s,wrap:null,about:s,datatype:s,inlist:s,prefix:s,property:s,resource:s,"typeof":s,vocab:s,autoCapitalize:null,autoCorrect:null,autoSave:null,color:null,itemProp:s,itemScope:s|i,itemType:s,itemID:s,itemRef:s,results:null,security:s,unselectable:s},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=m},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/LinkedValueUtils.js":[function(e,t,o){(function(o){"use strict";function n(e){null!=e.checkedLink&&null!=e.valueLink?"production"!==o.env.NODE_ENV?c(!1,"Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don't want to use valueLink and vice versa."):c(!1):void 0}function r(e){n(e),null!=e.value||null!=e.onChange?"production"!==o.env.NODE_ENV?c(!1,"Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don't want to use valueLink."):c(!1):void 0}function a(e){n(e),null!=e.checked||null!=e.onChange?"production"!==o.env.NODE_ENV?c(!1,"Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don't want to use checkedLink"):c(!1):void 0}function s(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var l=e("./ReactPropTypes"),i=e("./ReactPropTypeLocations"),c=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),u={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},p={value:function(e,t,o){return!e[t]||u[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,o){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:l.func},b={},m={checkPropTypes:function(e,t,n){for(var r in p){if(p.hasOwnProperty(r))var a=p[r](t,r,e,i.prop);if(a instanceof Error&&!(a.message in b)){b[a.message]=!0;var l=s(n);"production"!==o.env.NODE_ENV?d(!1,"Failed form propType: %s%s",a.message,l):void 0}}},getValue:function(e){return e.valueLink?(r(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(a(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(r(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(a(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=m}).call(this,e("_process"))},{"./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocations.js","./ReactPropTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypes.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js":[function(e,t,o){"use strict";function n(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var o=Object(e),n=Object.prototype.hasOwnProperty,r=1;r<arguments.length;r++){var a=arguments[r];if(null!=a){var s=Object(a);for(var l in s)n.call(s,l)&&(o[l]=s[l])}}return o}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r=function(e){var t=this;if(t.instancePool.length){var o=t.instancePool.pop();return t.call(o,e),o}return new t(e)},a=function(e,t){var o=this;if(o.instancePool.length){var n=o.instancePool.pop();return o.call(n,e,t),n}return new o(e,t)},s=function(e,t,o){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t,o),r}return new n(e,t,o)},l=function(e,t,o,n){var r=this;if(r.instancePool.length){var a=r.instancePool.pop();return r.call(a,e,t,o,n),a}return new r(e,t,o,n)},i=function(e,t,o,n,r){var a=this;if(a.instancePool.length){var s=a.instancePool.pop();return a.call(s,e,t,o,n,r),s}return new a(e,t,o,n,r)},c=function(e){var t=this;e instanceof t?void 0:"production"!==o.env.NODE_ENV?n(!1,"Trying to release an instance into a pool of a different type."):n(!1),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},d=10,u=r,p=function(e,t){var o=e;return o.instancePool=[],o.getPooled=t||u,o.poolSize||(o.poolSize=d),o.release=c,o},b={addPoolingTo:p,oneArgumentPooler:r,twoArgumentPooler:a,threeArgumentPooler:s,fourArgumentPooler:l,fiveArgumentPooler:i};t.exports=b}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/React.js":[function(e,t,o){"use strict";var n=e("./ReactDOM"),r=e("./ReactDOMServer"),a=e("./ReactIsomorphic"),s=e("./Object.assign"),l=e("./deprecated"),i={};s(i,a),s(i,{findDOMNode:l("findDOMNode","ReactDOM","react-dom",n,n.findDOMNode),render:l("render","ReactDOM","react-dom",n,n.render),unmountComponentAtNode:l("unmountComponentAtNode","ReactDOM","react-dom",n,n.unmountComponentAtNode),renderToString:l("renderToString","ReactDOMServer","react-dom/server",r,r.renderToString),renderToStaticMarkup:l("renderToStaticMarkup","ReactDOMServer","react-dom/server",r,r.renderToStaticMarkup)}),i.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n,t.exports=i},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactDOM":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOM.js","./ReactDOMServer":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMServer.js","./ReactIsomorphic":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactIsomorphic.js","./deprecated":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/deprecated.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserComponentMixin.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactInstanceMap"),r=e("./findDOMNode"),a=e("fbjs/lib/warning"),s="_getDOMNodeDidWarn",l={getDOMNode:function(){return"production"!==o.env.NODE_ENV?a(this.constructor[s],"%s.getDOMNode(...) is deprecated. Please use ReactDOM.findDOMNode(instance) instead.",n.get(this).getName()||this.tagName||"Unknown"):void 0,this.constructor[s]=!0,r(this)}};t.exports=l}).call(this,e("_process"))},{"./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/findDOMNode.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserEventEmitter.js":[function(e,t,o){"use strict";function n(e){return Object.prototype.hasOwnProperty.call(e,h)||(e[h]=m++,p[e[h]]={}),p[e[h]]}var r=e("./EventConstants"),a=e("./EventPluginHub"),s=e("./EventPluginRegistry"),l=e("./ReactEventEmitterMixin"),i=e("./ReactPerf"),c=e("./ViewportMetrics"),d=e("./Object.assign"),u=e("./isEventSupported"),p={},b=!1,m=0,f={topAbort:"abort",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},h="_reactListenersID"+String(Math.random()).slice(2),v=d({},l,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var o=t,a=n(o),l=s.registrationNameDependencies[e],i=r.topLevelTypes,c=0;c<l.length;c++){var d=l[c];a.hasOwnProperty(d)&&a[d]||(d===i.topWheel?u("wheel")?v.ReactEventListener.trapBubbledEvent(i.topWheel,"wheel",o):u("mousewheel")?v.ReactEventListener.trapBubbledEvent(i.topWheel,"mousewheel",o):v.ReactEventListener.trapBubbledEvent(i.topWheel,"DOMMouseScroll",o):d===i.topScroll?u("scroll",!0)?v.ReactEventListener.trapCapturedEvent(i.topScroll,"scroll",o):v.ReactEventListener.trapBubbledEvent(i.topScroll,"scroll",v.ReactEventListener.WINDOW_HANDLE):d===i.topFocus||d===i.topBlur?(u("focus",!0)?(v.ReactEventListener.trapCapturedEvent(i.topFocus,"focus",o),v.ReactEventListener.trapCapturedEvent(i.topBlur,"blur",o)):u("focusin")&&(v.ReactEventListener.trapBubbledEvent(i.topFocus,"focusin",o),v.ReactEventListener.trapBubbledEvent(i.topBlur,"focusout",o)),a[i.topBlur]=!0,a[i.topFocus]=!0):f.hasOwnProperty(d)&&v.ReactEventListener.trapBubbledEvent(d,f[d],o),a[d]=!0)}},trapBubbledEvent:function(e,t,o){return v.ReactEventListener.trapBubbledEvent(e,t,o)},trapCapturedEvent:function(e,t,o){return v.ReactEventListener.trapCapturedEvent(e,t,o)},ensureScrollValueMonitoring:function(){if(!b){var e=c.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),b=!0}},eventNameDispatchConfigs:a.eventNameDispatchConfigs,registrationNameModules:a.registrationNameModules,putListener:a.putListener,getListener:a.getListener,deleteListener:a.deleteListener,deleteAllListeners:a.deleteAllListeners});i.measureMethods(v,"ReactBrowserEventEmitter",{putListener:"putListener",deleteListener:"deleteListener"}),t.exports=v},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginHub.js","./EventPluginRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginRegistry.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactEventEmitterMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEventEmitterMixin.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ViewportMetrics":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ViewportMetrics.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isEventSupported.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactChildReconciler.js":[function(e,t,o){(function(o){"use strict";function n(e,t,n){var r=void 0===e[n];"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?i(r,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",n):void 0),null!=t&&r&&(e[n]=a(t,null))}var r=e("./ReactReconciler"),a=e("./instantiateReactComponent"),s=e("./shouldUpdateReactComponent"),l=e("./traverseAllChildren"),i=e("fbjs/lib/warning"),c={instantiateChildren:function(e,t,o){if(null==e)return null;var r={};return l(e,n,r),r},updateChildren:function(e,t,o,n){if(!t&&!e)return null;var l;for(l in t)if(t.hasOwnProperty(l)){var i=e&&e[l],c=i&&i._currentElement,d=t[l];if(null!=i&&s(c,d))r.receiveComponent(i,d,o,n),t[l]=i;else{i&&r.unmountComponent(i,l);var u=a(d,null);t[l]=u}}for(l in e)!e.hasOwnProperty(l)||t&&t.hasOwnProperty(l)||r.unmountComponent(e[l]);return t},unmountChildren:function(e){for(var t in e)if(e.hasOwnProperty(t)){var o=e[t];r.unmountComponent(o)}}};t.exports=c}).call(this,e("_process"))},{"./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/instantiateReactComponent.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/shouldUpdateReactComponent.js","./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/traverseAllChildren.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactChildren.js":[function(e,t,o){"use strict";function n(e){return(""+e).replace(N,"//")}function r(e,t){this.func=e,this.context=t,this.count=0}function a(e,t,o){var n=e.func,r=e.context;n.call(r,t,e.count++)}function s(e,t,o){if(null==e)return e;var n=r.getPooled(t,o);v(e,a,n),r.release(n)}function l(e,t,o,n){this.result=e,this.keyPrefix=t,this.func=o,this.context=n,this.count=0}function i(e,t,o){var r=e.result,a=e.keyPrefix,s=e.func,l=e.context,i=s.call(l,t,e.count++);Array.isArray(i)?c(i,r,o,h.thatReturnsArgument):null!=i&&(f.isValidElement(i)&&(i=f.cloneAndReplaceKey(i,a+(i!==t?n(i.key||"")+"/":"")+o)),r.push(i))}function c(e,t,o,r,a){var s="";null!=o&&(s=n(o)+"/");var c=l.getPooled(t,s,r,a);v(e,i,c),l.release(c)}function d(e,t,o){if(null==e)return e;var n=[];return c(e,n,null,t,o),n}function u(e,t,o){return null}function p(e,t){return v(e,u,null)}function b(e){var t=[];return c(e,t,null,h.thatReturnsArgument),t}var m=e("./PooledClass"),f=e("./ReactElement"),h=e("fbjs/lib/emptyFunction"),v=e("./traverseAllChildren"),_=m.twoArgumentPooler,g=m.fourArgumentPooler,N=/\/(?!\/)/g;r.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},m.addPoolingTo(r,_),l.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},m.addPoolingTo(l,g);var y={forEach:s,map:d,mapIntoWithKeyPrefixInternal:c,count:p,toArray:b};t.exports=y},{"./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/traverseAllChildren.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactClass.js":[function(e,t,o){(function(o){"use strict";function n(){D||(D=!0,"production"!==o.env.NODE_ENV?j(!1,"setProps(...) and replaceProps(...) are deprecated. Instead, call render again at the top level."):void 0)}function r(e,t,n){for(var r in t)t.hasOwnProperty(r)&&("production"!==o.env.NODE_ENV?j("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",h[n],r):void 0)}function a(e,t){var n=U.hasOwnProperty(t)?U[t]:null;P.hasOwnProperty(t)&&(n!==R.OVERRIDE_BASE?"production"!==o.env.NODE_ENV?N(!1,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t):N(!1):void 0),e.hasOwnProperty(t)&&(n!==R.DEFINE_MANY&&n!==R.DEFINE_MANY_MERGED?"production"!==o.env.NODE_ENV?N(!1,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t):N(!1):void 0)}function s(e,t){if(t){"function"==typeof t?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: You're attempting to use a component class as a mixin. Instead, just use a regular object."):N(!1):void 0,m.isValidElement(t)?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object."):N(!1):void 0;var n=e.prototype;t.hasOwnProperty(C)&&w.mixins(e,t.mixins);for(var r in t)if(t.hasOwnProperty(r)&&r!==C){var s=t[r];if(a(n,r),w.hasOwnProperty(r))w[r](e,s);else{var l=U.hasOwnProperty(r),i=n.hasOwnProperty(r),u="function"==typeof s,p=u&&!l&&!i&&t.autobind!==!1;if(p)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[r]=s,n[r]=s;else if(i){var b=U[r];!l||b!==R.DEFINE_MANY_MERGED&&b!==R.DEFINE_MANY?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,r):N(!1):void 0,b===R.DEFINE_MANY_MERGED?n[r]=c(n[r],s):b===R.DEFINE_MANY&&(n[r]=d(n[r],s))}else n[r]=s,"production"!==o.env.NODE_ENV&&"function"==typeof s&&t.displayName&&(n[r].displayName=t.displayName+"_"+r)}}}}function l(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var a=n in w;a?"production"!==o.env.NODE_ENV?N(!1,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n):N(!1):void 0;var s=n in e;s?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n):N(!1):void 0, e[n]=r}}}function i(e,t){e&&t&&"object"==typeof e&&"object"==typeof t?void 0:"production"!==o.env.NODE_ENV?N(!1,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."):N(!1);for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]?"production"!==o.env.NODE_ENV?N(!1,"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n):N(!1):void 0,e[n]=t[n]);return e}function c(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return i(r,o),i(r,n),r}}function d(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function u(e,t){var n=t.bind(e);if("production"!==o.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=t,n.__reactBoundArguments=null;var r=e.constructor.displayName,a=n.bind;n.bind=function(s){for(var l=arguments.length,i=Array(l>1?l-1:0),c=1;l>c;c++)i[c-1]=arguments[c];if(s!==e&&null!==s)"production"!==o.env.NODE_ENV?j(!1,"bind(): React component methods may only be bound to the component instance. See %s",r):void 0;else if(!i.length)return"production"!==o.env.NODE_ENV?j(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",r):void 0,n;var d=a.apply(n,arguments);return d.__reactBoundContext=e,d.__reactBoundMethod=t,d.__reactBoundArguments=i,d}}return n}function p(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var o=e.__reactAutoBindMap[t];e[t]=u(e,o)}}var b=e("./ReactComponent"),m=e("./ReactElement"),f=e("./ReactPropTypeLocations"),h=e("./ReactPropTypeLocationNames"),v=e("./ReactNoopUpdateQueue"),_=e("./Object.assign"),g=e("fbjs/lib/emptyObject"),N=e("fbjs/lib/invariant"),y=e("fbjs/lib/keyMirror"),E=e("fbjs/lib/keyOf"),j=e("fbjs/lib/warning"),C=E({mixins:null}),R=y({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),O=[],D=!1,U={mixins:R.DEFINE_MANY,statics:R.DEFINE_MANY,propTypes:R.DEFINE_MANY,contextTypes:R.DEFINE_MANY,childContextTypes:R.DEFINE_MANY,getDefaultProps:R.DEFINE_MANY_MERGED,getInitialState:R.DEFINE_MANY_MERGED,getChildContext:R.DEFINE_MANY_MERGED,render:R.DEFINE_ONCE,componentWillMount:R.DEFINE_MANY,componentDidMount:R.DEFINE_MANY,componentWillReceiveProps:R.DEFINE_MANY,shouldComponentUpdate:R.DEFINE_ONCE,componentWillUpdate:R.DEFINE_MANY,componentDidUpdate:R.DEFINE_MANY,componentWillUnmount:R.DEFINE_MANY,updateComponent:R.OVERRIDE_BASE},w={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var o=0;o<t.length;o++)s(e,t[o])},childContextTypes:function(e,t){"production"!==o.env.NODE_ENV&&r(e,t,f.childContext),e.childContextTypes=_({},e.childContextTypes,t)},contextTypes:function(e,t){"production"!==o.env.NODE_ENV&&r(e,t,f.context),e.contextTypes=_({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=c(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){"production"!==o.env.NODE_ENV&&r(e,t,f.prop),e.propTypes=_({},e.propTypes,t)},statics:function(e,t){l(e,t)},autobind:function(){}},P={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e),t&&this.updater.enqueueCallback(this,t)},isMounted:function(){return this.updater.isMounted(this)},setProps:function(e,t){"production"!==o.env.NODE_ENV&&n(),this.updater.enqueueSetProps(this,e),t&&this.updater.enqueueCallback(this,t)},replaceProps:function(e,t){"production"!==o.env.NODE_ENV&&n(),this.updater.enqueueReplaceProps(this,e),t&&this.updater.enqueueCallback(this,t)}},M=function(){};_(M.prototype,b.prototype,P);var S={createClass:function(e){var t=function(e,n,r){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?j(this instanceof t,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"):void 0),this.__reactAutoBindMap&&p(this),this.props=e,this.context=n,this.refs=g,this.updater=r||v,this.state=null;var a=this.getInitialState?this.getInitialState():null;"production"!==o.env.NODE_ENV&&"undefined"==typeof a&&this.getInitialState._isMockFunction&&(a=null),"object"!=typeof a||Array.isArray(a)?"production"!==o.env.NODE_ENV?N(!1,"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"):N(!1):void 0,this.state=a};t.prototype=new M,t.prototype.constructor=t,O.forEach(s.bind(null,t)),s(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),"production"!==o.env.NODE_ENV&&(t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved={}),t.prototype.getInitialState&&(t.prototype.getInitialState.isReactClassApproved={})),t.prototype.render?void 0:"production"!==o.env.NODE_ENV?N(!1,"createClass(...): Class specification must implement a `render` method."):N(!1),"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?j(!t.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"):void 0,"production"!==o.env.NODE_ENV?j(!t.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component"):void 0);for(var n in U)t.prototype[n]||(t.prototype[n]=null);return t},injection:{injectMixin:function(e){O.push(e)}}};t.exports=S}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponent.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactNoopUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactNoopUpdateQueue.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocations.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponent.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){this.props=e,this.context=t,this.refs=s,this.updater=o||r}var r=e("./ReactNoopUpdateQueue"),a=e("./canDefineProperty"),s=e("fbjs/lib/emptyObject"),l=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning");if(n.prototype.isReactComponent={},n.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e?"production"!==o.env.NODE_ENV?l(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."):l(!1):void 0,"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?i(null!=e,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."):void 0),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t)},n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e)},"production"!==o.env.NODE_ENV){var c={getDOMNode:["getDOMNode","Use ReactDOM.findDOMNode(component) instead."],isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceProps:["replaceProps","Instead, call render again at the top level."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."],setProps:["setProps","Instead, call render again at the top level."]},d=function(e,t){a&&Object.defineProperty(n.prototype,e,{get:function(){"production"!==o.env.NODE_ENV?i(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1]):void 0}})};for(var u in c)c.hasOwnProperty(u)&&d(u,c[u])}t.exports=n}).call(this,e("_process"))},{"./ReactNoopUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactNoopUpdateQueue.js","./canDefineProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/canDefineProperty.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentBrowserEnvironment.js":[function(e,t,o){"use strict";var n=e("./ReactDOMIDOperations"),r=e("./ReactMount"),a={processChildrenUpdates:n.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:n.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){r.purgeID(e)}};t.exports=a},{"./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentEnvironment.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r=!1,a={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){r?"production"!==o.env.NODE_ENV?n(!1,"ReactCompositeComponent: injectEnvironment() can only be called once."):n(!1):void 0,a.unmountIDFromEnvironment=e.unmountIDFromEnvironment,a.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,a.processChildrenUpdates=e.processChildrenUpdates,r=!0}}};t.exports=a}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCompositeComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){var t=e._currentElement._owner||null;if(t){var o=t.getName();if(o)return" Check the render method of `"+o+"`."}return""}function r(e){}var a=e("./ReactComponentEnvironment"),s=e("./ReactCurrentOwner"),l=e("./ReactElement"),i=e("./ReactInstanceMap"),c=e("./ReactPerf"),d=e("./ReactPropTypeLocations"),u=e("./ReactPropTypeLocationNames"),p=e("./ReactReconciler"),b=e("./ReactUpdateQueue"),m=e("./Object.assign"),f=e("fbjs/lib/emptyObject"),h=e("fbjs/lib/invariant"),v=e("./shouldUpdateReactComponent"),_=e("fbjs/lib/warning");r.prototype.render=function(){var e=i.get(this)._currentElement.type;return e(this.props,this.context,this.updater)};var g=1,N={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=g++,this._rootNodeID=e;var a,c,d=this._processProps(this._currentElement.props),u=this._processContext(n),m=this._currentElement.type,v="prototype"in m;if(v)if("production"!==o.env.NODE_ENV){s.current=this;try{a=new m(d,u,b)}finally{s.current=null}}else a=new m(d,u,b);v&&null!==a&&a!==!1&&!l.isValidElement(a)||(c=a,a=new r(m)),"production"!==o.env.NODE_ENV&&(null==a.render?"production"!==o.env.NODE_ENV?_(!1,"%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`, returned null/false from a stateless component, or tried to render an element whose type is a function that isn't a React component.",m.displayName||m.name||"Component"):void 0:"production"!==o.env.NODE_ENV?_(m.prototype&&m.prototype.isReactComponent||!v||!(a instanceof m),"%s(...): React component classes must extend React.Component.",m.displayName||m.name||"Component"):void 0),a.props=d,a.context=u,a.refs=f,a.updater=b,this._instance=a,i.set(a,this),"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?_(!a.getInitialState||a.getInitialState.isReactClassApproved,"getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_(!a.getDefaultProps||a.getDefaultProps.isReactClassApproved,"getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_(!a.propTypes,"propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_(!a.contextTypes,"contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_("function"!=typeof a.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",this.getName()||"A component"):void 0,"production"!==o.env.NODE_ENV?_("function"!=typeof a.componentDidUnmount,"%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",this.getName()||"A component"):void 0,"production"!==o.env.NODE_ENV?_("function"!=typeof a.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",this.getName()||"A component"):void 0);var N=a.state;void 0===N&&(a.state=N=null),"object"!=typeof N||Array.isArray(N)?"production"!==o.env.NODE_ENV?h(!1,"%s.state: must be set to an object or null",this.getName()||"ReactCompositeComponent"):h(!1):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,a.componentWillMount&&(a.componentWillMount(),this._pendingStateQueue&&(a.state=this._processPendingState(a.props,a.context))),void 0===c&&(c=this._renderValidatedComponent()),this._renderedComponent=this._instantiateReactComponent(c);var y=p.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return a.componentDidMount&&t.getReactMountReady().enqueue(a.componentDidMount,a),y},unmountComponent:function(){var e=this._instance;e.componentWillUnmount&&e.componentWillUnmount(),p.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._instance=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,this._topLevelWrapper=null,i.remove(e)},_maskContext:function(e){var t=null,o=this._currentElement.type,n=o.contextTypes;if(!n)return f;t={};for(var r in n)t[r]=e[r];return t},_processContext:function(e){var t=this._maskContext(e);if("production"!==o.env.NODE_ENV){var n=this._currentElement.type;n.contextTypes&&this._checkPropTypes(n.contextTypes,t,d.context)}return t},_processChildContext:function(e){var t=this._currentElement.type,n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"object"!=typeof t.childContextTypes?"production"!==o.env.NODE_ENV?h(!1,"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",this.getName()||"ReactCompositeComponent"):h(!1):void 0,"production"!==o.env.NODE_ENV&&this._checkPropTypes(t.childContextTypes,r,d.childContext);for(var a in r)a in t.childContextTypes?void 0:"production"!==o.env.NODE_ENV?h(!1,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',this.getName()||"ReactCompositeComponent",a):h(!1);return m({},e,r)}return e},_processProps:function(e){if("production"!==o.env.NODE_ENV){var t=this._currentElement.type;t.propTypes&&this._checkPropTypes(t.propTypes,e,d.prop)}return e},_checkPropTypes:function(e,t,r){var a=this.getName();for(var s in e)if(e.hasOwnProperty(s)){var l;try{"function"!=typeof e[s]?"production"!==o.env.NODE_ENV?h(!1,"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",a||"React class",u[r],s):h(!1):void 0,l=e[s](t,s,a,r)}catch(i){l=i}if(l instanceof Error){var c=n(this);r===d.prop?"production"!==o.env.NODE_ENV?_(!1,"Failed Composite propType: %s%s",l.message,c):void 0:"production"!==o.env.NODE_ENV?_(!1,"Failed Context Types: %s%s",l.message,c):void 0}}},receiveComponent:function(e,t,o){var n=this._currentElement,r=this._context;this._pendingElement=null,this.updateComponent(t,n,e,r,o)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&p.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},updateComponent:function(e,t,n,r,a){var s,l=this._instance,i=this._context===a?l.context:this._processContext(a);t===n?s=n.props:(s=this._processProps(n.props),l.componentWillReceiveProps&&l.componentWillReceiveProps(s,i));var c=this._processPendingState(s,i),d=this._pendingForceUpdate||!l.shouldComponentUpdate||l.shouldComponentUpdate(s,c,i);"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?_("undefined"!=typeof d,"%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",this.getName()||"ReactCompositeComponent"):void 0),d?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,s,c,i,e,a)):(this._currentElement=n,this._context=a,l.props=s,l.state=c,l.context=i)},_processPendingState:function(e,t){var o=this._instance,n=this._pendingStateQueue,r=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!n)return o.state;if(r&&1===n.length)return n[0];for(var a=m({},r?n[0]:o.state),s=r?1:0;s<n.length;s++){var l=n[s];m(a,"function"==typeof l?l.call(o,a,e,t):l)}return a},_performComponentUpdate:function(e,t,o,n,r,a){var s,l,i,c=this._instance,d=Boolean(c.componentDidUpdate);d&&(s=c.props,l=c.state,i=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,o,n),this._currentElement=e,this._context=a,c.props=t,c.state=o,c.context=n,this._updateRenderedComponent(r,a),d&&r.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,s,l,i),c)},_updateRenderedComponent:function(e,t){var o=this._renderedComponent,n=o._currentElement,r=this._renderValidatedComponent();if(v(n,r))p.receiveComponent(o,r,e,this._processChildContext(t));else{var a=this._rootNodeID,s=o._rootNodeID;p.unmountComponent(o),this._renderedComponent=this._instantiateReactComponent(r);var l=p.mountComponent(this._renderedComponent,a,e,this._processChildContext(t));this._replaceNodeWithMarkupByID(s,l)}},_replaceNodeWithMarkupByID:function(e,t){a.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return"production"!==o.env.NODE_ENV&&"undefined"==typeof t&&e.render._isMockFunction&&(t=null),t},_renderValidatedComponent:function(){var e;s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{s.current=null}return null===e||e===!1||l.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?h(!1,"%s.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.",this.getName()||"ReactCompositeComponent"):h(!1),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n?"production"!==o.env.NODE_ENV?h(!1,"Stateless function components cannot have refs."):h(!1):void 0;var r=t.getPublicInstance();if("production"!==o.env.NODE_ENV){var a=t&&t.getName?t.getName():"a component";"production"!==o.env.NODE_ENV?_(null!=r,'Stateless function components cannot be given refs (See ref "%s" in %s created by %s). Attempts to access this ref will fail.',e,a,this.getName()):void 0}var s=n.refs===f?n.refs={}:n.refs;s[e]=r},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return e instanceof r?null:e},_instantiateReactComponent:null};c.measureMethods(N,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var y={Mixin:N};t.exports=y}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentEnvironment.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocations.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdateQueue.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/shouldUpdateReactComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js":[function(e,t,o){"use strict";var n={current:null};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOM.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactCurrentOwner"),r=e("./ReactDOMTextComponent"),a=e("./ReactDefaultInjection"),s=e("./ReactInstanceHandles"),l=e("./ReactMount"),i=e("./ReactPerf"),c=e("./ReactReconciler"),d=e("./ReactUpdates"),u=e("./ReactVersion"),p=e("./findDOMNode"),b=e("./renderSubtreeIntoContainer"),m=e("fbjs/lib/warning");a.inject();var f=i.measure("React","render",l.render),h={findDOMNode:p,render:f,unmountComponentAtNode:l.unmountComponentAtNode,version:u,unstable_batchedUpdates:d.batchedUpdates,unstable_renderSubtreeIntoContainer:b};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:n,InstanceHandles:s,Mount:l,Reconciler:c,TextComponent:r}),"production"!==o.env.NODE_ENV){var v=e("fbjs/lib/ExecutionEnvironment");if(v.canUseDOM&&window.top===window.self){"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&(navigator.userAgent.indexOf("Chrome")>-1&&-1===navigator.userAgent.indexOf("Edge")||navigator.userAgent.indexOf("Firefox")>-1)&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");var _=document.documentMode&&document.documentMode<8;"production"!==o.env.NODE_ENV?m(!_,'Internet Explorer is running in compatibility mode; please add the following tag to your HTML to prevent this from happening: <meta http-equiv="X-UA-Compatible" content="IE=edge" />'):void 0;for(var g=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze],N=0;N<g.length;N++)if(!g[N]){console.error("One or more ES5 shim/shams expected by React are not available: https://fb.me/react-warning-polyfills");break}}}t.exports=h}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOMTextComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDefaultInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultInjection.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js","./ReactVersion":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactVersion.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/findDOMNode.js","./renderSubtreeIntoContainer":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/renderSubtreeIntoContainer.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMButton.js":[function(e,t,o){"use strict";var n={onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0},r={getNativeProps:function(e,t,o){if(!t.disabled)return t;var r={};for(var a in t)t.hasOwnProperty(a)&&!n[a]&&(r[a]=t[a]);return r}};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){if(e){var t=e._currentElement._owner||null;if(t){var o=t.getName();if(o)return" This DOM node was rendered by `"+o+"`."}}return""}function r(){if("production"!==o.env.NODE_ENV){var e=this._reactInternalComponent;"production"!==o.env.NODE_ENV?G(!1,"ReactDOMComponent: Do not access .getDOMNode() of a DOM node; instead, use the node directly.%s",n(e)):void 0}return this}function a(){var e=this._reactInternalComponent;return"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?G(!1,"ReactDOMComponent: Do not access .isMounted() of a DOM node.%s",n(e)):void 0),!!e}function s(){if("production"!==o.env.NODE_ENV){var e=this._reactInternalComponent;"production"!==o.env.NODE_ENV?G(!1,"ReactDOMComponent: Do not access .setState(), .replaceState(), or .forceUpdate() of a DOM node. This is a no-op.%s",n(e)):void 0}}function l(e,t){var r=this._reactInternalComponent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?G(!1,"ReactDOMComponent: Do not access .setProps() of a DOM node. Instead, call ReactDOM.render again at the top level.%s",n(r)):void 0),r&&(V.enqueueSetPropsInternal(r,e),t&&V.enqueueCallbackInternal(r,t))}function i(e,t){var r=this._reactInternalComponent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?G(!1,"ReactDOMComponent: Do not access .replaceProps() of a DOM node. Instead, call ReactDOM.render again at the top level.%s",n(r)):void 0),r&&(V.enqueueReplacePropsInternal(r,e),t&&V.enqueueCallbackInternal(r,t))}function c(e){if("object"==typeof e){if(Array.isArray(e))return"["+e.map(c).join(", ")+"]";var t=[];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=/^[a-z$_][\w$_]*$/i.test(o)?o:JSON.stringify(o);t.push(n+": "+c(e[o]))}return"{"+t.join(", ")+"}"}return"string"==typeof e?JSON.stringify(e):"function"==typeof e?"[function object]":String(e)}function d(e,t,n){if(null!=e&&null!=t&&!z(e,t)){var r,a=n._tag,s=n._currentElement._owner;s&&(r=s.getName());var l=r+"|"+a;ne.hasOwnProperty(l)||(ne[l]=!0,"production"!==o.env.NODE_ENV?G(!1,"`%s` was passed a style object that has previously been mutated. Mutating `style` is deprecated. Consider cloning it beforehand. Check the `render` %s. Previous style: %s. Mutated style: %s.",a,s?"of `"+r+"`":"using <"+a+">",c(e),c(t)):void 0)}}function u(e,t){t&&("production"!==o.env.NODE_ENV&&le[e._tag]&&("production"!==o.env.NODE_ENV?G(null==t.children&&null==t.dangerouslySetInnerHTML,"%s is a void element tag and must not have `children` or use `props.dangerouslySetInnerHTML`.%s",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""):void 0),null!=t.dangerouslySetInnerHTML&&(null!=t.children?"production"!==o.env.NODE_ENV?B(!1,"Can only set one of `children` or `props.dangerouslySetInnerHTML`."):B(!1):void 0,"object"==typeof t.dangerouslySetInnerHTML&&te in t.dangerouslySetInnerHTML?void 0:"production"!==o.env.NODE_ENV?B(!1,"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information."):B(!1)),"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?G(null==t.innerHTML,"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."):void 0,"production"!==o.env.NODE_ENV?G(!t.contentEditable||null==t.children,"A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."):void 0), null!=t.style&&"object"!=typeof t.style?"production"!==o.env.NODE_ENV?B(!1,"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.%s",n(e)):B(!1):void 0)}function p(e,t,n,r){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?G("onScroll"!==t||H("scroll",!0),"This browser doesn't support the `onScroll` event"):void 0);var a=I.findReactContainerForID(e);if(a){var s=a.nodeType===oe?a.ownerDocument:a;$(t,s)}r.getReactMountReady().enqueue(b,{id:e,registrationName:t,listener:n})}function b(){var e=this;D.putListener(e.id,e.registrationName,e.listener)}function m(){var e=this;e._rootNodeID?void 0:"production"!==o.env.NODE_ENV?B(!1,"Must be mounted to trap events"):B(!1);var t=I.getNode(e._rootNodeID);switch(t?void 0:"production"!==o.env.NODE_ENV?B(!1,"trapBubbledEvent(...): Requires node to be rendered."):B(!1),e._tag){case"iframe":e._wrapperState.listeners=[D.trapBubbledEvent(O.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in re)re.hasOwnProperty(n)&&e._wrapperState.listeners.push(D.trapBubbledEvent(O.topLevelTypes[n],re[n],t));break;case"img":e._wrapperState.listeners=[D.trapBubbledEvent(O.topLevelTypes.topError,"error",t),D.trapBubbledEvent(O.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[D.trapBubbledEvent(O.topLevelTypes.topReset,"reset",t),D.trapBubbledEvent(O.topLevelTypes.topSubmit,"submit",t)]}}function f(){P.mountReadyWrapper(this)}function h(){S.postUpdateWrapper(this)}function v(e){de.call(ce,e)||(ie.test(e)?void 0:"production"!==o.env.NODE_ENV?B(!1,"Invalid tag: %s",e):B(!1),ce[e]=!0)}function _(e,t){e=A({},e);var o=e[Y.ancestorInfoContextKey];return e[Y.ancestorInfoContextKey]=Y.updatedAncestorInfo(o,t._tag,t),e}function g(e,t){return e.indexOf("-")>=0||null!=t.is}function N(e){v(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null,"production"!==o.env.NODE_ENV&&(this._unprocessedContextDev=null,this._processedContextDev=null)}var y,E=e("./AutoFocusUtils"),j=e("./CSSPropertyOperations"),C=e("./DOMProperty"),R=e("./DOMPropertyOperations"),O=e("./EventConstants"),D=e("./ReactBrowserEventEmitter"),U=e("./ReactComponentBrowserEnvironment"),w=e("./ReactDOMButton"),P=e("./ReactDOMInput"),M=e("./ReactDOMOption"),S=e("./ReactDOMSelect"),T=e("./ReactDOMTextarea"),I=e("./ReactMount"),x=e("./ReactMultiChild"),k=e("./ReactPerf"),V=e("./ReactUpdateQueue"),A=e("./Object.assign"),L=e("./canDefineProperty"),F=e("./escapeTextContentForBrowser"),B=e("fbjs/lib/invariant"),H=e("./isEventSupported"),W=e("fbjs/lib/keyOf"),q=e("./setInnerHTML"),K=e("./setTextContent"),z=e("fbjs/lib/shallowEqual"),Y=e("./validateDOMNesting"),G=e("fbjs/lib/warning"),Q=D.deleteListener,$=D.listenTo,X=D.registrationNameModules,Z={string:!0,number:!0},J=W({children:null}),ee=W({style:null}),te=W({__html:null}),oe=1;"production"!==o.env.NODE_ENV&&(y={props:{enumerable:!1,get:function(){var e=this._reactInternalComponent;return"production"!==o.env.NODE_ENV?G(!1,"ReactDOMComponent: Do not access .props of a DOM node; instead, recreate the props as `render` did originally or read the DOM properties/attributes directly from this node (e.g., this.refs.box.className).%s",n(e)):void 0,e._currentElement.props}}});var ne={},re={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},ae={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},se={listing:!0,pre:!0,textarea:!0},le=A({menuitem:!0},ae),ie=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ce={},de={}.hasOwnProperty;N.displayName="ReactDOMComponent",N.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(m,this);break;case"button":r=w.getNativeProps(this,r,n);break;case"input":P.mountWrapper(this,r,n),r=P.getNativeProps(this,r,n);break;case"option":M.mountWrapper(this,r,n),r=M.getNativeProps(this,r,n);break;case"select":S.mountWrapper(this,r,n),r=S.getNativeProps(this,r,n),n=S.processChildContext(this,r,n);break;case"textarea":T.mountWrapper(this,r,n),r=T.getNativeProps(this,r,n)}u(this,r),"production"!==o.env.NODE_ENV&&n[Y.ancestorInfoContextKey]&&Y(this._tag,this,n[Y.ancestorInfoContextKey]),"production"!==o.env.NODE_ENV&&(this._unprocessedContextDev=n,this._processedContextDev=_(n,this),n=this._processedContextDev);var a;if(t.useCreateElement){var s=n[I.ownerDocumentContextKey],l=s.createElement(this._currentElement.type);R.setAttributeForID(l,this._rootNodeID),I.getID(l),this._updateDOMProperties({},r,t,l),this._createInitialChildren(t,r,n,l),a=l}else{var i=this._createOpenTagMarkupAndPutListeners(t,r),c=this._createContentMarkup(t,r,n);a=!c&&ae[this._tag]?i+"/>":i+">"+c+"</"+this._currentElement.type+">"}switch(this._tag){case"input":t.getReactMountReady().enqueue(f,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(E.focusDOMComponent,this)}return a},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if(null!=a)if(X.hasOwnProperty(r))a&&p(this._rootNodeID,r,a,e);else{r===ee&&(a&&("production"!==o.env.NODE_ENV&&(this._previousStyle=a),a=this._previousStyleCopy=A({},t.style)),a=j.createMarkupForStyles(a));var s=null;null!=this._tag&&g(this._tag,t)?r!==J&&(s=R.createMarkupForCustomAttribute(r,a)):s=R.createMarkupForProperty(r,a),s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n;var l=R.createMarkupForID(this._rootNodeID);return n+" "+l},_createContentMarkup:function(e,t,o){var n="",r=t.dangerouslySetInnerHTML;if(null!=r)null!=r.__html&&(n=r.__html);else{var a=Z[typeof t.children]?t.children:null,s=null!=a?null:t.children;if(null!=a)n=F(a);else if(null!=s){var l=this.mountChildren(s,e,o);n=l.join("")}}return se[this._tag]&&"\n"===n.charAt(0)?"\n"+n:n},_createInitialChildren:function(e,t,o,n){var r=t.dangerouslySetInnerHTML;if(null!=r)null!=r.__html&&q(n,r.__html);else{var a=Z[typeof t.children]?t.children:null,s=null!=a?null:t.children;if(null!=a)K(n,a);else if(null!=s)for(var l=this.mountChildren(s,e,o),i=0;i<l.length;i++)n.appendChild(l[i])}},receiveComponent:function(e,t,o){var n=this._currentElement;this._currentElement=e,this.updateComponent(t,n,e,o)},updateComponent:function(e,t,n,r){var a=t.props,s=this._currentElement.props;switch(this._tag){case"button":a=w.getNativeProps(this,a),s=w.getNativeProps(this,s);break;case"input":P.updateWrapper(this),a=P.getNativeProps(this,a),s=P.getNativeProps(this,s);break;case"option":a=M.getNativeProps(this,a),s=M.getNativeProps(this,s);break;case"select":a=S.getNativeProps(this,a),s=S.getNativeProps(this,s);break;case"textarea":T.updateWrapper(this),a=T.getNativeProps(this,a),s=T.getNativeProps(this,s)}"production"!==o.env.NODE_ENV&&(this._unprocessedContextDev!==r&&(this._unprocessedContextDev=r,this._processedContextDev=_(r,this)),r=this._processedContextDev),u(this,s),this._updateDOMProperties(a,s,e,null),this._updateDOMChildren(a,s,e,r),!L&&this._nodeWithLegacyProperties&&(this._nodeWithLegacyProperties.props=s),"select"===this._tag&&e.getReactMountReady().enqueue(h,this)},_updateDOMProperties:function(e,t,n,r){var a,s,l;for(a in e)if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a))if(a===ee){var i=this._previousStyleCopy;for(s in i)i.hasOwnProperty(s)&&(l=l||{},l[s]="");this._previousStyleCopy=null}else X.hasOwnProperty(a)?e[a]&&Q(this._rootNodeID,a):(C.properties[a]||C.isCustomAttribute(a))&&(r||(r=I.getNode(this._rootNodeID)),R.deleteValueForProperty(r,a));for(a in t){var c=t[a],u=a===ee?this._previousStyleCopy:e[a];if(t.hasOwnProperty(a)&&c!==u)if(a===ee)if(c?("production"!==o.env.NODE_ENV&&(d(this._previousStyleCopy,this._previousStyle,this),this._previousStyle=c),c=this._previousStyleCopy=A({},c)):this._previousStyleCopy=null,u){for(s in u)!u.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(l=l||{},l[s]="");for(s in c)c.hasOwnProperty(s)&&u[s]!==c[s]&&(l=l||{},l[s]=c[s])}else l=c;else X.hasOwnProperty(a)?c?p(this._rootNodeID,a,c,n):u&&Q(this._rootNodeID,a):g(this._tag,t)?(r||(r=I.getNode(this._rootNodeID)),a===J&&(c=null),R.setValueForAttribute(r,a,c)):(C.properties[a]||C.isCustomAttribute(a))&&(r||(r=I.getNode(this._rootNodeID)),null!=c?R.setValueForProperty(r,a,c):R.deleteValueForProperty(r,a))}l&&(r||(r=I.getNode(this._rootNodeID)),j.setValueForStyles(r,l))},_updateDOMChildren:function(e,t,o,n){var r=Z[typeof e.children]?e.children:null,a=Z[typeof t.children]?t.children:null,s=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,l=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,i=null!=r?null:e.children,c=null!=a?null:t.children,d=null!=r||null!=s,u=null!=a||null!=l;null!=i&&null==c?this.updateChildren(null,o,n):d&&!u&&this.updateTextContent(""),null!=a?r!==a&&this.updateTextContent(""+a):null!=l?s!==l&&this.updateMarkup(""+l):null!=c&&this.updateChildren(c,o,n)},unmountComponent:function(){switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":var e=this._wrapperState.listeners;if(e)for(var t=0;t<e.length;t++)e[t].remove();break;case"input":P.unmountWrapper(this);break;case"html":case"head":case"body":"production"!==o.env.NODE_ENV?B(!1,"<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this._tag):B(!1)}if(this.unmountChildren(),D.deleteAllListeners(this._rootNodeID),U.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._wrapperState=null,this._nodeWithLegacyProperties){var n=this._nodeWithLegacyProperties;n._reactInternalComponent=null,this._nodeWithLegacyProperties=null}},getPublicInstance:function(){if(!this._nodeWithLegacyProperties){var e=I.getNode(this._rootNodeID);e._reactInternalComponent=this,e.getDOMNode=r,e.isMounted=a,e.setState=s,e.replaceState=s,e.forceUpdate=s,e.setProps=l,e.replaceProps=i,"production"!==o.env.NODE_ENV&&L?Object.defineProperties(e,y):e.props=this._currentElement.props,this._nodeWithLegacyProperties=e}return this._nodeWithLegacyProperties}},k.measureMethods(N,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),A(N.prototype,N.Mixin,x.Mixin),t.exports=N}).call(this,e("_process"))},{"./AutoFocusUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/AutoFocusUtils.js","./CSSPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CSSPropertyOperations.js","./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMPropertyOperations.js","./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMButton":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMButton.js","./ReactDOMInput":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMInput.js","./ReactDOMOption":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMOption.js","./ReactDOMSelect":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMSelect.js","./ReactDOMTextarea":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMTextarea.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdateQueue.js","./canDefineProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/canDefineProperty.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/escapeTextContentForBrowser.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isEventSupported.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setInnerHTML.js","./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setTextContent.js","./validateDOMNesting":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/validateDOMNesting.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js","fbjs/lib/shallowEqual":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/shallowEqual.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMFactories.js":[function(e,t,o){(function(o){"use strict";function n(e){return"production"!==o.env.NODE_ENV?a.createFactory(e):r.createFactory(e)}var r=e("./ReactElement"),a=e("./ReactElementValidator"),s=e("fbjs/lib/mapObject"),l=s({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},n);t.exports=l}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElementValidator.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/mapObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/mapObject.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMFeatureFlags.js":[function(e,t,o){"use strict";var n={useCreateElement:!1};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMIDOperations.js":[function(e,t,o){(function(o){"use strict";var n=e("./DOMChildrenOperations"),r=e("./DOMPropertyOperations"),a=e("./ReactMount"),s=e("./ReactPerf"),l=e("fbjs/lib/invariant"),i={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c={updatePropertyByID:function(e,t,n){var s=a.getNode(e);i.hasOwnProperty(t)?"production"!==o.env.NODE_ENV?l(!1,"updatePropertyByID(...): %s",i[t]):l(!1):void 0,null!=n?r.setValueForProperty(s,t,n):r.deleteValueForProperty(s,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var o=a.getNode(e);n.dangerouslyReplaceNodeWithMarkup(o,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var o=0;o<e.length;o++)e[o].parentNode=a.getNode(e[o].parentID);n.processUpdates(e,t)}};s.measureMethods(c,"ReactDOMIDOperations",{dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),t.exports=c}).call(this,e("_process"))},{"./DOMChildrenOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMPropertyOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMInput.js":[function(e,t,o){(function(o){"use strict";function n(){this._rootNodeID&&p.updateWrapper(this)}function r(e){var t=this._currentElement.props,r=s.executeOnChange(t,e);i.asap(n,this);var a=t.name;if("radio"===t.type&&null!=a){for(var c=l.getNode(this._rootNodeID),p=c;p.parentNode;)p=p.parentNode;for(var b=p.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),m=0;m<b.length;m++){var f=b[m];if(f!==c&&f.form===c.form){var h=l.getID(f);h?void 0:"production"!==o.env.NODE_ENV?d(!1,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."):d(!1);var v=u[h];v?void 0:"production"!==o.env.NODE_ENV?d(!1,"ReactDOMInput: Unknown radio button ID %s.",h):d(!1),i.asap(n,v)}}}return r}var a=e("./ReactDOMIDOperations"),s=e("./LinkedValueUtils"),l=e("./ReactMount"),i=e("./ReactUpdates"),c=e("./Object.assign"),d=e("fbjs/lib/invariant"),u={},p={getNativeProps:function(e,t,o){var n=s.getValue(t),r=s.getChecked(t),a=c({},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange});return a},mountWrapper:function(e,t){"production"!==o.env.NODE_ENV&&s.checkPropTypes("input",t,e._currentElement._owner);var n=t.defaultValue;e._wrapperState={initialChecked:t.defaultChecked||!1,initialValue:null!=n?n:null,onChange:r.bind(e)}},mountReadyWrapper:function(e){u[e._rootNodeID]=e},unmountWrapper:function(e){delete u[e._rootNodeID]},updateWrapper:function(e){var t=e._currentElement.props,o=t.checked;null!=o&&a.updatePropertyByID(e._rootNodeID,"checked",o||!1);var n=s.getValue(t);null!=n&&a.updatePropertyByID(e._rootNodeID,"value",""+n)}};t.exports=p}).call(this,e("_process"))},{"./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMOption.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactChildren"),r=e("./ReactDOMSelect"),a=e("./Object.assign"),s=e("fbjs/lib/warning"),l=r.valueContextKey,i={mountWrapper:function(e,t,n){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?s(null==t.selected,"Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."):void 0);var r=n[l],a=null;if(null!=r)if(a=!1,Array.isArray(r)){for(var i=0;i<r.length;i++)if(""+r[i]==""+t.value){a=!0;break}}else a=""+r==""+t.value;e._wrapperState={selected:a}},getNativeProps:function(e,t,r){var l=a({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(l.selected=e._wrapperState.selected);var i="";return n.forEach(t.children,function(e){null!=e&&("string"==typeof e||"number"==typeof e?i+=e:"production"!==o.env.NODE_ENV?s(!1,"Only strings and numbers are supported as <option> children."):void 0)}),l.children=i,l}};t.exports=i}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactChildren.js","./ReactDOMSelect":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMSelect.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMSelect.js":[function(e,t,o){(function(o){"use strict";function n(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=i.getValue(e);null!=t&&s(this,e,t)}}function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function a(e,t){var n=e._currentElement._owner;i.checkPropTypes("select",t,n);for(var a=0;a<m.length;a++){var s=m[a];null!=t[s]&&(t.multiple?"production"!==o.env.NODE_ENV?p(Array.isArray(t[s]),"The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",s,r(n)):void 0:"production"!==o.env.NODE_ENV?p(!Array.isArray(t[s]),"The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",s,r(n)):void 0)}}function s(e,t,o){var n,r,a=c.getNode(e._rootNodeID).options;if(t){for(n={},r=0;r<o.length;r++)n[""+o[r]]=!0;for(r=0;r<a.length;r++){var s=n.hasOwnProperty(a[r].value);a[r].selected!==s&&(a[r].selected=s)}}else{for(n=""+o,r=0;r<a.length;r++)if(a[r].value===n)return void(a[r].selected=!0);a.length&&(a[0].selected=!0)}}function l(e){var t=this._currentElement.props,o=i.executeOnChange(t,e);return this._wrapperState.pendingUpdate=!0,d.asap(n,this),o}var i=e("./LinkedValueUtils"),c=e("./ReactMount"),d=e("./ReactUpdates"),u=e("./Object.assign"),p=e("fbjs/lib/warning"),b="__ReactDOMSelect_value$"+Math.random().toString(36).slice(2),m=["value","defaultValue"],f={valueContextKey:b,getNativeProps:function(e,t,o){return u({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){"production"!==o.env.NODE_ENV&&a(e,t);var n=i.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,onChange:l.bind(e),wasMultiple:Boolean(t.multiple)}},processChildContext:function(e,t,o){var n=u({},o);return n[b]=e._wrapperState.initialValue,n},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var o=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var n=i.getValue(t);null!=n?(e._wrapperState.pendingUpdate=!1,s(e,Boolean(t.multiple),n)):o!==Boolean(t.multiple)&&(null!=t.defaultValue?s(e,Boolean(t.multiple),t.defaultValue):s(e,Boolean(t.multiple),t.multiple?[]:""))}};t.exports=f}).call(this,e("_process"))},{"./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMSelection.js":[function(e,t,o){"use strict";function n(e,t,o,n){return e===o&&t===n}function r(e){var t=document.selection,o=t.createRange(),n=o.text.length,r=o.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",o);var a=r.text.length,s=a+n;return{start:a,end:s}}function a(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var o=t.anchorNode,r=t.anchorOffset,a=t.focusNode,s=t.focusOffset,l=t.getRangeAt(0);try{l.startContainer.nodeType,l.endContainer.nodeType}catch(i){return null}var c=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),d=c?0:l.toString().length,u=l.cloneRange();u.selectNodeContents(e),u.setEnd(l.startContainer,l.startOffset);var p=n(u.startContainer,u.startOffset,u.endContainer,u.endOffset),b=p?0:u.toString().length,m=b+d,f=document.createRange();f.setStart(o,r),f.setEnd(a,s);var h=f.collapsed;return{start:h?m:b,end:h?b:m}}function s(e,t){var o,n,r=document.selection.createRange().duplicate();"undefined"==typeof t.end?(o=t.start,n=o):t.start>t.end?(o=t.end,n=t.start):(o=t.start,n=t.end),r.moveToElementText(e),r.moveStart("character",o),r.setEndPoint("EndToStart",r),r.moveEnd("character",n-o),r.select()}function l(e,t){if(window.getSelection){var o=window.getSelection(),n=e[d()].length,r=Math.min(t.start,n),a="undefined"==typeof t.end?r:Math.min(t.end,n);if(!o.extend&&r>a){var s=a;a=r,r=s}var l=c(e,r),i=c(e,a);if(l&&i){var u=document.createRange();u.setStart(l.node,l.offset),o.removeAllRanges(),r>a?(o.addRange(u),o.extend(i.node,i.offset)):(u.setEnd(i.node,i.offset),o.addRange(u))}}}var i=e("fbjs/lib/ExecutionEnvironment"),c=e("./getNodeForCharacterOffset"),d=e("./getTextContentAccessor"),u=i.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:u?r:a,setOffsets:u?s:l};t.exports=p},{"./getNodeForCharacterOffset":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getNodeForCharacterOffset.js","./getTextContentAccessor":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getTextContentAccessor.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMServer.js":[function(e,t,o){"use strict";var n=e("./ReactDefaultInjection"),r=e("./ReactServerRendering"),a=e("./ReactVersion");n.inject();var s={renderToString:r.renderToString,renderToStaticMarkup:r.renderToStaticMarkup,version:a};t.exports=s},{"./ReactDefaultInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultInjection.js","./ReactServerRendering":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerRendering.js","./ReactVersion":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactVersion.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMTextComponent.js":[function(e,t,o){(function(o){"use strict";var n=e("./DOMChildrenOperations"),r=e("./DOMPropertyOperations"),a=e("./ReactComponentBrowserEnvironment"),s=e("./ReactMount"),l=e("./Object.assign"),i=e("./escapeTextContentForBrowser"),c=e("./setTextContent"),d=e("./validateDOMNesting"),u=function(e){};l(u.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){if("production"!==o.env.NODE_ENV&&n[d.ancestorInfoContextKey]&&d("span",null,n[d.ancestorInfoContextKey]),this._rootNodeID=e,t.useCreateElement){var a=n[s.ownerDocumentContextKey],l=a.createElement("span");return r.setAttributeForID(l,e),s.getID(l),c(l,this._stringText),l}var u=i(this._stringText);return t.renderToStaticMarkup?u:"<span "+r.createMarkupForID(e)+">"+u+"</span>"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var o=""+e;if(o!==this._stringText){this._stringText=o;var r=s.getNode(this._rootNodeID);n.updateTextContent(r,o)}}},unmountComponent:function(){a.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=u}).call(this,e("_process"))},{"./DOMChildrenOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/escapeTextContentForBrowser.js", "./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setTextContent.js","./validateDOMNesting":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/validateDOMNesting.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMTextarea.js":[function(e,t,o){(function(o){"use strict";function n(){this._rootNodeID&&u.updateWrapper(this)}function r(e){var t=this._currentElement.props,o=a.executeOnChange(t,e);return l.asap(n,this),o}var a=e("./LinkedValueUtils"),s=e("./ReactDOMIDOperations"),l=e("./ReactUpdates"),i=e("./Object.assign"),c=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),u={getNativeProps:function(e,t,n){null!=t.dangerouslySetInnerHTML?"production"!==o.env.NODE_ENV?c(!1,"`dangerouslySetInnerHTML` does not make sense on <textarea>."):c(!1):void 0;var r=i({},t,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,t){"production"!==o.env.NODE_ENV&&a.checkPropTypes("textarea",t,e._currentElement._owner);var n=t.defaultValue,s=t.children;null!=s&&("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?d(!1,"Use the `defaultValue` or `value` props instead of setting children on <textarea>."):void 0),null!=n?"production"!==o.env.NODE_ENV?c(!1,"If you supply `defaultValue` on a <textarea>, do not pass children."):c(!1):void 0,Array.isArray(s)&&(s.length<=1?void 0:"production"!==o.env.NODE_ENV?c(!1,"<textarea> can only have at most one child."):c(!1),s=s[0]),n=""+s),null==n&&(n="");var l=a.getValue(t);e._wrapperState={initialValue:""+(null!=l?l:n),onChange:r.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,o=a.getValue(t);null!=o&&s.updatePropertyByID(e._rootNodeID,"value",""+o)}};t.exports=u}).call(this,e("_process"))},{"./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMIDOperations.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultBatchingStrategy.js":[function(e,t,o){"use strict";function n(){this.reinitializeTransaction()}var r=e("./ReactUpdates"),a=e("./Transaction"),s=e("./Object.assign"),l=e("fbjs/lib/emptyFunction"),i={initialize:l,close:function(){p.isBatchingUpdates=!1}},c={initialize:l,close:r.flushBatchedUpdates.bind(r)},d=[c,i];s(n.prototype,a.Mixin,{getTransactionWrappers:function(){return d}});var u=new n,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,o,n,r,a){var s=p.isBatchingUpdates;p.isBatchingUpdates=!0,s?e(t,o,n,r,a):u.perform(e,null,t,o,n,r,a)}};t.exports=p},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Transaction.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultInjection.js":[function(e,t,o){(function(o){"use strict";function n(){if(!R&&(R=!0,v.EventEmitter.injectReactEventListener(h),v.EventPluginHub.injectEventPluginOrder(l),v.EventPluginHub.injectInstanceHandle(_),v.EventPluginHub.injectMount(g),v.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:j,EnterLeaveEventPlugin:i,ChangeEventPlugin:a,SelectEventPlugin:y,BeforeInputEventPlugin:r}),v.NativeComponent.injectGenericComponentClass(m),v.NativeComponent.injectTextComponentClass(f),v.Class.injectMixin(u),v.DOMProperty.injectDOMPropertyConfig(d),v.DOMProperty.injectDOMPropertyConfig(C),v.EmptyComponent.injectEmptyComponent("noscript"),v.Updates.injectReconcileTransaction(N),v.Updates.injectBatchingStrategy(b),v.RootIndex.injectCreateReactRootIndex(c.canUseDOM?s.createReactRootIndex:E.createReactRootIndex),v.Component.injectEnvironment(p),"production"!==o.env.NODE_ENV)){var t=c.canUseDOM&&window.location.href||"";if(/[?&]react_perf\b/.test(t)){var n=e("./ReactDefaultPerf");n.start()}}}var r=e("./BeforeInputEventPlugin"),a=e("./ChangeEventPlugin"),s=e("./ClientReactRootIndex"),l=e("./DefaultEventPluginOrder"),i=e("./EnterLeaveEventPlugin"),c=e("fbjs/lib/ExecutionEnvironment"),d=e("./HTMLDOMPropertyConfig"),u=e("./ReactBrowserComponentMixin"),p=e("./ReactComponentBrowserEnvironment"),b=e("./ReactDefaultBatchingStrategy"),m=e("./ReactDOMComponent"),f=e("./ReactDOMTextComponent"),h=e("./ReactEventListener"),v=e("./ReactInjection"),_=e("./ReactInstanceHandles"),g=e("./ReactMount"),N=e("./ReactReconcileTransaction"),y=e("./SelectEventPlugin"),E=e("./ServerReactRootIndex"),j=e("./SimpleEventPlugin"),C=e("./SVGDOMPropertyConfig"),R=!1;t.exports={inject:n}}).call(this,e("_process"))},{"./BeforeInputEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/BeforeInputEventPlugin.js","./ChangeEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ChangeEventPlugin.js","./ClientReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ClientReactRootIndex.js","./DefaultEventPluginOrder":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DefaultEventPluginOrder.js","./EnterLeaveEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EnterLeaveEventPlugin.js","./HTMLDOMPropertyConfig":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/HTMLDOMPropertyConfig.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMComponent.js","./ReactDOMTextComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDefaultBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactDefaultPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultPerf.js","./ReactEventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEventListener.js","./ReactInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInjection.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactReconcileTransaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconcileTransaction.js","./SVGDOMPropertyConfig":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SVGDOMPropertyConfig.js","./SelectEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SelectEventPlugin.js","./ServerReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ServerReactRootIndex.js","./SimpleEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SimpleEventPlugin.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultPerf.js":[function(e,t,o){"use strict";function n(e){return Math.floor(100*e)/100}function r(e,t,o){e[t]=(e[t]||0)+o}var a=e("./DOMProperty"),s=e("./ReactDefaultPerfAnalysis"),l=e("./ReactMount"),i=e("./ReactPerf"),c=e("fbjs/lib/performanceNow"),d={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){d._injected||i.injection.injectMeasure(d.measure),d._allMeasurements.length=0,i.enableMeasure=!0},stop:function(){i.enableMeasure=!1},getLastMeasurements:function(){return d._allMeasurements},printExclusive:function(e){e=e||d._allMeasurements;var t=s.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":n(e.inclusive),"Exclusive mount time (ms)":n(e.exclusive),"Exclusive render time (ms)":n(e.render),"Mount time per instance (ms)":n(e.exclusive/e.count),"Render time per instance (ms)":n(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||d._allMeasurements;var t=s.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":n(e.time),Instances:e.count}})),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},getMeasurementsSummaryMap:function(e){var t=s.getInclusiveSummary(e,!0);return t.map(function(e){return{"Owner > component":e.componentName,"Wasted time (ms)":e.time,Instances:e.count}})},printWasted:function(e){e=e||d._allMeasurements,console.table(d.getMeasurementsSummaryMap(e)),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||d._allMeasurements;var t=s.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[a.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,o,n){var r=d._allMeasurements[d._allMeasurements.length-1].writes;r[e]=r[e]||[],r[e].push({type:t,time:o,args:n})},measure:function(e,t,o){return function(){for(var n=arguments.length,a=Array(n),s=0;n>s;s++)a[s]=arguments[s];var i,u,p;if("_renderNewRootComponent"===t||"flushBatchedUpdates"===t)return d._allMeasurements.push({exclusive:{},inclusive:{},render:{},counts:{},writes:{},displayNames:{},totalTime:0,created:{}}),p=c(),u=o.apply(this,a),d._allMeasurements[d._allMeasurements.length-1].totalTime=c()-p,u;if("_mountImageIntoNode"===t||"ReactBrowserEventEmitter"===e||"ReactDOMIDOperations"===e||"CSSPropertyOperations"===e||"DOMChildrenOperations"===e||"DOMPropertyOperations"===e){if(p=c(),u=o.apply(this,a),i=c()-p,"_mountImageIntoNode"===t){var b=l.getID(a[1]);d._recordWrite(b,t,i,a[0])}else if("dangerouslyProcessChildrenUpdates"===t)a[0].forEach(function(e){var t={};null!==e.fromIndex&&(t.fromIndex=e.fromIndex),null!==e.toIndex&&(t.toIndex=e.toIndex),null!==e.textContent&&(t.textContent=e.textContent),null!==e.markupIndex&&(t.markup=a[1][e.markupIndex]),d._recordWrite(e.parentID,e.type,i,t)});else{var m=a[0];"object"==typeof m&&(m=l.getID(a[0])),d._recordWrite(m,t,i,Array.prototype.slice.call(a,1))}return u}if("ReactCompositeComponent"!==e||"mountComponent"!==t&&"updateComponent"!==t&&"_renderValidatedComponent"!==t)return o.apply(this,a);if(this._currentElement.type===l.TopLevelWrapper)return o.apply(this,a);var f="mountComponent"===t?a[0]:this._rootNodeID,h="_renderValidatedComponent"===t,v="mountComponent"===t,_=d._mountStack,g=d._allMeasurements[d._allMeasurements.length-1];if(h?r(g.counts,f,1):v&&(g.created[f]=!0,_.push(0)),p=c(),u=o.apply(this,a),i=c()-p,h)r(g.render,f,i);else if(v){var N=_.pop();_[_.length-1]+=i,r(g.exclusive,f,i-N),r(g.inclusive,f,i)}else r(g.inclusive,f,i);return g.displayNames[f]={current:this.getName(),owner:this._currentElement._owner?this._currentElement._owner.getName():"<root>"},u}}};t.exports=d},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js","./ReactDefaultPerfAnalysis":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultPerfAnalysis.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","fbjs/lib/performanceNow":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/performanceNow.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultPerfAnalysis.js":[function(e,t,o){"use strict";function n(e){for(var t=0,o=0;o<e.length;o++){var n=e[o];t+=n.totalTime}return t}function r(e){var t=[];return e.forEach(function(e){Object.keys(e.writes).forEach(function(o){e.writes[o].forEach(function(e){t.push({id:o,type:d[e.type]||e.type,args:e.args})})})}),t}function a(e){for(var t,o={},n=0;n<e.length;n++){var r=e[n],a=i({},r.exclusive,r.inclusive);for(var s in a)t=r.displayNames[s].current,o[t]=o[t]||{componentName:t,inclusive:0,exclusive:0,render:0,count:0},r.render[s]&&(o[t].render+=r.render[s]),r.exclusive[s]&&(o[t].exclusive+=r.exclusive[s]),r.inclusive[s]&&(o[t].inclusive+=r.inclusive[s]),r.counts[s]&&(o[t].count+=r.counts[s])}var l=[];for(t in o)o[t].exclusive>=c&&l.push(o[t]);return l.sort(function(e,t){return t.exclusive-e.exclusive}),l}function s(e,t){for(var o,n={},r=0;r<e.length;r++){var a,s=e[r],d=i({},s.exclusive,s.inclusive);t&&(a=l(s));for(var u in d)if(!t||a[u]){var p=s.displayNames[u];o=p.owner+" > "+p.current,n[o]=n[o]||{componentName:o,time:0,count:0},s.inclusive[u]&&(n[o].time+=s.inclusive[u]),s.counts[u]&&(n[o].count+=s.counts[u])}}var b=[];for(o in n)n[o].time>=c&&b.push(n[o]);return b.sort(function(e,t){return t.time-e.time}),b}function l(e){var t={},o=Object.keys(e.writes),n=i({},e.exclusive,e.inclusive);for(var r in n){for(var a=!1,s=0;s<o.length;s++)if(0===o[s].indexOf(r)){a=!0;break}e.created[r]&&(a=!0),!a&&e.counts[r]>0&&(t[r]=!0)}return t}var i=e("./Object.assign"),c=1.2,d={_mountImageIntoNode:"set innerHTML",INSERT_MARKUP:"set innerHTML",MOVE_EXISTING:"move",REMOVE_NODE:"remove",SET_MARKUP:"set innerHTML",TEXT_CONTENT:"set textContent",setValueForProperty:"update attribute",setValueForAttribute:"update attribute",deleteValueForProperty:"remove attribute",dangerouslyReplaceNodeWithMarkupByID:"replace"},u={getExclusiveSummary:a,getInclusiveSummary:s,getDOMSummary:r,getTotalTime:n};t.exports=u},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactCurrentOwner"),r=e("./Object.assign"),a=e("./canDefineProperty"),s="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,l={key:!0,ref:!0,__self:!0,__source:!0},i=function(e,t,n,r,l,i,c){var d={$$typeof:s,type:e,key:t,ref:n,props:c,_owner:i};return"production"!==o.env.NODE_ENV&&(d._store={},a?(Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(d,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(d,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l})):(d._store.validated=!1,d._self=r,d._source=l),Object.freeze(d.props),Object.freeze(d)),d};i.createElement=function(e,t,o){var r,a={},s=null,c=null,d=null,u=null;if(null!=t){c=void 0===t.ref?null:t.ref,s=void 0===t.key?null:""+t.key,d=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source;for(r in t)t.hasOwnProperty(r)&&!l.hasOwnProperty(r)&&(a[r]=t[r])}var p=arguments.length-2;if(1===p)a.children=o;else if(p>1){for(var b=Array(p),m=0;p>m;m++)b[m]=arguments[m+2];a.children=b}if(e&&e.defaultProps){var f=e.defaultProps;for(r in f)"undefined"==typeof a[r]&&(a[r]=f[r])}return i(e,s,c,d,u,n.current,a)},i.createFactory=function(e){var t=i.createElement.bind(null,e);return t.type=e,t},i.cloneAndReplaceKey=function(e,t){var o=i(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return o},i.cloneAndReplaceProps=function(e,t){var n=i(e.type,e.key,e.ref,e._self,e._source,e._owner,t);return"production"!==o.env.NODE_ENV&&(n._store.validated=e._store.validated),n},i.cloneElement=function(e,t,o){var a,s=r({},e.props),c=e.key,d=e.ref,u=e._self,p=e._source,b=e._owner;if(null!=t){void 0!==t.ref&&(d=t.ref,b=n.current),void 0!==t.key&&(c=""+t.key);for(a in t)t.hasOwnProperty(a)&&!l.hasOwnProperty(a)&&(s[a]=t[a])}var m=arguments.length-2;if(1===m)s.children=o;else if(m>1){for(var f=Array(m),h=0;m>h;h++)f[h]=arguments[h+2];s.children=f}return i(e.type,c,d,u,p,b,s)},i.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===s},t.exports=i}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./canDefineProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/canDefineProperty.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElementValidator.js":[function(e,t,o){(function(o){"use strict";function n(){if(p.current){var e=p.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function r(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=a("uniqueKey",e,t);null!==n&&("production"!==o.env.NODE_ENV?h(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s%s',n.parentOrOwner||"",n.childOwner||"",n.url||""):void 0)}}function a(e,t,o){var r=n();if(!r){var a="string"==typeof o?o:o.displayName||o.name;a&&(r=" Check the top-level render call using <"+a+">.")}var s=v[e]||(v[e]={});if(s[r])return null;s[r]=!0;var l={parentOrOwner:r,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==p.current&&(l.childOwner=" It was passed a child from "+t._owner.getName()+"."),l}function s(e,t){if("object"==typeof e)if(Array.isArray(e))for(var o=0;o<e.length;o++){var n=e[o];c.isValidElement(n)&&r(n,t)}else if(c.isValidElement(e))e._store&&(e._store.validated=!0);else if(e){var a=m(e);if(a&&a!==e.entries)for(var s,l=a.call(e);!(s=l.next()).done;)c.isValidElement(s.value)&&r(s.value,t)}}function l(e,t,r,a){for(var s in t)if(t.hasOwnProperty(s)){var l;try{"function"!=typeof t[s]?"production"!==o.env.NODE_ENV?f(!1,"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e||"React class",u[a],s):f(!1):void 0,l=t[s](r,s,e,a)}catch(i){l=i}if("production"!==o.env.NODE_ENV?h(!l||l instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",e||"React class",u[a],s,typeof l):void 0,l instanceof Error&&!(l.message in _)){_[l.message]=!0;var c=n();"production"!==o.env.NODE_ENV?h(!1,"Failed propType: %s%s",l.message,c):void 0}}}function i(e){var t=e.type;if("function"==typeof t){var n=t.displayName||t.name;t.propTypes&&l(n,t.propTypes,e.props,d.prop),"function"==typeof t.getDefaultProps&&("production"!==o.env.NODE_ENV?h(t.getDefaultProps.isReactClassApproved,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."):void 0)}}var c=e("./ReactElement"),d=e("./ReactPropTypeLocations"),u=e("./ReactPropTypeLocationNames"),p=e("./ReactCurrentOwner"),b=e("./canDefineProperty"),m=e("./getIteratorFn"),f=e("fbjs/lib/invariant"),h=e("fbjs/lib/warning"),v={},_={},g={createElement:function(e,t,r){var a="string"==typeof e||"function"==typeof e;"production"!==o.env.NODE_ENV?h(a,"React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).%s",n()):void 0;var l=c.createElement.apply(this,arguments);if(null==l)return l;if(a)for(var d=2;d<arguments.length;d++)s(arguments[d],e);return i(l),l},createFactory:function(e){var t=g.createElement.bind(null,e);return t.type=e,"production"!==o.env.NODE_ENV&&b&&Object.defineProperty(t,"type",{enumerable:!1,get:function(){return"production"!==o.env.NODE_ENV?h(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."):void 0,Object.defineProperty(this,"type",{value:e}),e}}),t},cloneElement:function(e,t,o){for(var n=c.cloneElement.apply(this,arguments),r=2;r<arguments.length;r++)s(arguments[r],n.type);return i(n),n}};t.exports=g}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocations.js","./canDefineProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/canDefineProperty.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getIteratorFn.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponent.js":[function(e,t,o){"use strict";var n,r=e("./ReactElement"),a=e("./ReactEmptyComponentRegistry"),s=e("./ReactReconciler"),l=e("./Object.assign"),i={injectEmptyComponent:function(e){n=r.createElement(e)}},c=function(e){this._currentElement=null,this._rootNodeID=null,this._renderedComponent=e(n)};l(c.prototype,{construct:function(e){},mountComponent:function(e,t,o){return a.registerNullComponentID(e),this._rootNodeID=e,s.mountComponent(this._renderedComponent,e,t,o)},receiveComponent:function(){},unmountComponent:function(e,t,o){s.unmountComponent(this._renderedComponent),a.deregisterNullComponentID(this._rootNodeID),this._rootNodeID=null,this._renderedComponent=null}}),c.injection=i,t.exports=c},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactEmptyComponentRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponentRegistry.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponentRegistry.js":[function(e,t,o){"use strict";function n(e){return!!s[e]}function r(e){s[e]=!0}function a(e){delete s[e]}var s={},l={isNullComponentID:n,registerNullComponentID:r,deregisterNullComponentID:a};t.exports=l},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactErrorUtils.js":[function(e,t,o){(function(e){"use strict";function o(e,t,o,r){try{return t(o,r)}catch(a){return void(null===n&&(n=a))}}var n=null,r={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(n){var e=n;throw n=null,e}}};if("production"!==e.env.NODE_ENV&&"undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"undefined"!=typeof document&&"function"==typeof document.createEvent){var a=document.createElement("react");r.invokeGuardedCallback=function(e,t,o,n){var r=t.bind(null,o,n),s="react-"+e;a.addEventListener(s,r,!1);var l=document.createEvent("Event");l.initEvent(s,!1,!1),a.dispatchEvent(l),a.removeEventListener(s,r,!1)}}t.exports=r}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEventEmitterMixin.js":[function(e,t,o){"use strict";function n(e){r.enqueueEvents(e),r.processEventQueue(!1)}var r=e("./EventPluginHub"),a={handleTopLevel:function(e,t,o,a,s){var l=r.extractEvents(e,t,o,a,s);n(l)}};t.exports=a},{"./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginHub.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEventListener.js":[function(e,t,o){"use strict";function n(e){var t=p.getID(e),o=u.getReactRootIDFromNodeID(t),n=p.findReactContainerForID(o),r=p.getFirstReactDOM(n);return r}function r(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function a(e){s(e)}function s(e){for(var t=p.getFirstReactDOM(f(e.nativeEvent))||window,o=t;o;)e.ancestors.push(o),o=n(o);for(var r=0;r<e.ancestors.length;r++){t=e.ancestors[r];var a=p.getID(t)||"";v._handleTopLevel(e.topLevelType,t,a,e.nativeEvent,f(e.nativeEvent))}}function l(e){var t=h(window);e(t)}var i=e("fbjs/lib/EventListener"),c=e("fbjs/lib/ExecutionEnvironment"),d=e("./PooledClass"),u=e("./ReactInstanceHandles"),p=e("./ReactMount"),b=e("./ReactUpdates"),m=e("./Object.assign"),f=e("./getEventTarget"),h=e("fbjs/lib/getUnboundedScrollPosition");m(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),d.addPoolingTo(r,d.twoArgumentPooler);var v={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:c.canUseDOM?window:null,setHandleTopLevel:function(e){v._handleTopLevel=e},setEnabled:function(e){v._enabled=!!e},isEnabled:function(){return v._enabled},trapBubbledEvent:function(e,t,o){var n=o;return n?i.listen(n,t,v.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,o){var n=o;return n?i.capture(n,t,v.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=l.bind(null,e);i.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(v._enabled){var o=r.getPooled(e,t);try{b.batchedUpdates(a,o)}finally{r.release(o)}}}};t.exports=v},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventTarget.js","fbjs/lib/EventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/EventListener.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/getUnboundedScrollPosition":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getUnboundedScrollPosition.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInjection.js":[function(e,t,o){"use strict";var n=e("./DOMProperty"),r=e("./EventPluginHub"),a=e("./ReactComponentEnvironment"),s=e("./ReactClass"),l=e("./ReactEmptyComponent"),i=e("./ReactBrowserEventEmitter"),c=e("./ReactNativeComponent"),d=e("./ReactPerf"),u=e("./ReactRootIndex"),p=e("./ReactUpdates"),b={Component:a.injection,Class:s.injection,DOMProperty:n.injection,EmptyComponent:l.injection,EventPluginHub:r.injection,EventEmitter:i.injection,NativeComponent:c.injection,Perf:d.injection,RootIndex:u.injection,Updates:p.injection};t.exports=b},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPluginHub.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactClass.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentEnvironment.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRootIndex.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInputSelection.js":[function(e,t,o){"use strict";function n(e){return a(document.documentElement,e)}var r=e("./ReactDOMSelection"),a=e("fbjs/lib/containsNode"),s=e("fbjs/lib/focusNode"),l=e("fbjs/lib/getActiveElement"),i={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=l();return{focusedElem:e,selectionRange:i.hasSelectionCapabilities(e)?i.getSelection(e):null}},restoreSelection:function(e){var t=l(),o=e.focusedElem,r=e.selectionRange;t!==o&&n(o)&&(i.hasSelectionCapabilities(o)&&i.setSelection(o,r),s(o))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var o=document.selection.createRange();o.parentElement()===e&&(t={start:-o.moveStart("character",-e.value.length), end:-o.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var o=t.start,n=t.end;if("undefined"==typeof n&&(n=o),"selectionStart"in e)e.selectionStart=o,e.selectionEnd=Math.min(n,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",o),a.moveEnd("character",n-o),a.select()}else r.setOffsets(e,t)}};t.exports=i},{"./ReactDOMSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMSelection.js","fbjs/lib/containsNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/containsNode.js","fbjs/lib/focusNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/focusNode.js","fbjs/lib/getActiveElement":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getActiveElement.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js":[function(e,t,o){(function(o){"use strict";function n(e){return b+e.toString(36)}function r(e,t){return e.charAt(t)===b||t===e.length}function a(e){return""===e||e.charAt(0)===b&&e.charAt(e.length-1)!==b}function s(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function l(e){return e?e.substr(0,e.lastIndexOf(b)):""}function i(e,t){if(a(e)&&a(t)?void 0:"production"!==o.env.NODE_ENV?p(!1,"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,t):p(!1),s(e,t)?void 0:"production"!==o.env.NODE_ENV?p(!1,"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,t):p(!1),e===t)return e;var n,l=e.length+m;for(n=l;n<t.length&&!r(t,n);n++);return t.substr(0,n)}function c(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var s=0,l=0;n>=l;l++)if(r(e,l)&&r(t,l))s=l;else if(e.charAt(l)!==t.charAt(l))break;var i=e.substr(0,s);return a(i)?void 0:"production"!==o.env.NODE_ENV?p(!1,"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,t,i):p(!1),i}function d(e,t,n,r,a,c){e=e||"",t=t||"",e===t?"production"!==o.env.NODE_ENV?p(!1,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e):p(!1):void 0;var d=s(t,e);d||s(e,t)?void 0:"production"!==o.env.NODE_ENV?p(!1,"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,t):p(!1);for(var u=0,b=d?l:i,m=e;;m=b(m,t)){var h;if(a&&m===e||c&&m===t||(h=n(m,d,r)),h===!1||m===t)break;u++<f?void 0:"production"!==o.env.NODE_ENV?p(!1,"traverseParentPath(%s, %s, ...): Detected an infinite loop while traversing the React DOM ID tree. This may be due to malformed IDs: %s",e,t,m):p(!1)}}var u=e("./ReactRootIndex"),p=e("fbjs/lib/invariant"),b=".",m=b.length,f=1e4,h={createReactRootID:function(){return n(u.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===b&&e.length>1){var t=e.indexOf(b,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,o,n,r){var a=c(e,t);a!==e&&d(e,a,o,n,!1,!0),a!==t&&d(a,t,o,r,!0,!1)},traverseTwoPhase:function(e,t,o){e&&(d("",e,t,o,!0,!1),d(e,"",t,o,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,o){e&&(d("",e,t,o,!0,!0),d(e,"",t,o,!0,!0))},traverseAncestors:function(e,t,o){d("",e,t,o,!0,!1)},getFirstCommonAncestorID:c,_getNextDescendantID:i,isAncestorIDOf:s,SEPARATOR:b};t.exports=h}).call(this,e("_process"))},{"./ReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRootIndex.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js":[function(e,t,o){"use strict";var n={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactIsomorphic.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactChildren"),r=e("./ReactComponent"),a=e("./ReactClass"),s=e("./ReactDOMFactories"),l=e("./ReactElement"),i=e("./ReactElementValidator"),c=e("./ReactPropTypes"),d=e("./ReactVersion"),u=e("./Object.assign"),p=e("./onlyChild"),b=l.createElement,m=l.createFactory,f=l.cloneElement;"production"!==o.env.NODE_ENV&&(b=i.createElement,m=i.createFactory,f=i.cloneElement);var h={Children:{map:n.map,forEach:n.forEach,count:n.count,toArray:n.toArray,only:p},Component:r,createElement:b,cloneElement:f,isValidElement:l.isValidElement,PropTypes:c,createClass:a.createClass,createFactory:m,createMixin:function(e){return e},DOM:s,version:d,__spread:u};t.exports=h}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactChildren.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactClass.js","./ReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponent.js","./ReactDOMFactories":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMFactories.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElementValidator.js","./ReactPropTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypes.js","./ReactVersion":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactVersion.js","./onlyChild":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/onlyChild.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMarkupChecksum.js":[function(e,t,o){"use strict";var n=e("./adler32"),r=/\/?>/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(r," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var o=t.getAttribute(a.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var r=n(e);return r===o}};t.exports=a},{"./adler32":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/adler32.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js":[function(e,t,o){(function(o){"use strict";function n(e,t){for(var o=Math.min(e.length,t.length),n=0;o>n;n++)if(e.charAt(n)!==t.charAt(n))return n;return e.length===t.length?-1:o}function r(e){return e?e.nodeType===K?e.documentElement:e.firstChild:null}function a(e){var t=r(e);return t&&ee.getID(t)}function s(e){var t=l(e);if(t)if(W.hasOwnProperty(t)){var n=W[t];n!==e&&(u(n,t)?"production"!==o.env.NODE_ENV?V(!1,"ReactMount: Two valid but unequal nodes with the same `%s`: %s",H,t):V(!1):void 0,W[t]=e)}else W[t]=e;return t}function l(e){return e&&e.getAttribute&&e.getAttribute(H)||""}function i(e,t){var o=l(e);o!==t&&delete W[o],e.setAttribute(H,t),W[t]=e}function c(e){return W.hasOwnProperty(e)&&u(W[e],e)||(W[e]=ee.findReactNodeByID(e)),W[e]}function d(e){var t=D.get(e)._rootNodeID;return R.isNullComponentID(t)?null:(W.hasOwnProperty(t)&&u(W[t],t)||(W[t]=ee.findReactNodeByID(t)),W[t])}function u(e,t){if(e){l(e)!==t?"production"!==o.env.NODE_ENV?V(!1,"ReactMount: Unexpected modification of `%s`",H):V(!1):void 0;var n=ee.findReactContainerForID(t);if(n&&x(n,e))return!0}return!1}function p(e){delete W[e]}function b(e){var t=W[e];return t&&u(t,e)?void(Z=t):!1}function m(e){Z=null,O.traverseAncestors(e,b);var t=Z;return Z=null,t}function f(e,t,n,r,a,s){if(j.useCreateElement&&(s=T({},s),n.nodeType===K?s[Y]=n:s[Y]=n.ownerDocument),"production"!==o.env.NODE_ENV){s===I&&(s={});var l=n.nodeName.toLowerCase();s[F.ancestorInfoContextKey]=F.updatedAncestorInfo(null,l,null)}var i=P.mountComponent(e,t,r,s);e._renderedComponent._topLevelWrapper=e,ee._mountImageIntoNode(i,n,a,r)}function h(e,t,o,n,r){var a=S.ReactReconcileTransaction.getPooled(n);a.perform(f,null,e,t,o,a,n,r),S.ReactReconcileTransaction.release(a)}function v(e,t){for(P.unmountComponent(e),t.nodeType===K&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function _(e){var t=a(e);return t?t!==O.getReactRootIDFromNodeID(t):!1}function g(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=l(e);if(t){var o,n=O.getReactRootIDFromNodeID(t),r=e;do if(o=l(r),r=r.parentNode,null==r)return null;while(o!==n);if(r===Q[n])return e}}return null}var N=e("./DOMProperty"),y=e("./ReactBrowserEventEmitter"),E=e("./ReactCurrentOwner"),j=e("./ReactDOMFeatureFlags"),C=e("./ReactElement"),R=e("./ReactEmptyComponentRegistry"),O=e("./ReactInstanceHandles"),D=e("./ReactInstanceMap"),U=e("./ReactMarkupChecksum"),w=e("./ReactPerf"),P=e("./ReactReconciler"),M=e("./ReactUpdateQueue"),S=e("./ReactUpdates"),T=e("./Object.assign"),I=e("fbjs/lib/emptyObject"),x=e("fbjs/lib/containsNode"),k=e("./instantiateReactComponent"),V=e("fbjs/lib/invariant"),A=e("./setInnerHTML"),L=e("./shouldUpdateReactComponent"),F=e("./validateDOMNesting"),B=e("fbjs/lib/warning"),H=N.ID_ATTRIBUTE_NAME,W={},q=1,K=9,z=11,Y="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),G={},Q={};if("production"!==o.env.NODE_ENV)var $={};var X=[],Z=null,J=function(){};J.prototype.isReactComponent={},"production"!==o.env.NODE_ENV&&(J.displayName="TopLevelWrapper"),J.prototype.render=function(){return this.props};var ee={TopLevelWrapper:J,_instancesByReactRootID:G,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,s){return ee.scrollMonitor(n,function(){M.enqueueElementInternal(e,t),s&&M.enqueueCallbackInternal(e,s)}),"production"!==o.env.NODE_ENV&&($[a(n)]=r(n)),e},_registerComponent:function(e,t){!t||t.nodeType!==q&&t.nodeType!==K&&t.nodeType!==z?"production"!==o.env.NODE_ENV?V(!1,"_registerComponent(...): Target container is not a DOM element."):V(!1):void 0,y.ensureScrollValueMonitoring();var n=ee.registerContainer(t);return G[n]=e,n},_renderNewRootComponent:function(e,t,n,a){"production"!==o.env.NODE_ENV?B(null==E.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",E.current&&E.current.getName()||"ReactCompositeComponent"):void 0;var s=k(e,null),l=ee._registerComponent(s,t);return S.batchedUpdates(h,s,l,t,n,a),"production"!==o.env.NODE_ENV&&($[l]=r(t)),s},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?"production"!==o.env.NODE_ENV?V(!1,"parentComponent must be a valid React Component"):V(!1):void 0,ee._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,s){C.isValidElement(t)?void 0:"production"!==o.env.NODE_ENV?V(!1,"ReactDOM.render(): Invalid component element.%s","string"==typeof t?" Instead of passing an element string, make sure to instantiate it by passing it to React.createElement.":"function"==typeof t?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":""):V(!1),"production"!==o.env.NODE_ENV?B(!n||!n.tagName||"BODY"!==n.tagName.toUpperCase(),"render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app."):void 0;var i=new C(J,null,null,null,null,null,t),c=G[a(n)];if(c){var d=c._currentElement,u=d.props;if(L(u,t)){var p=c._renderedComponent.getPublicInstance(),b=s&&function(){s.call(p)};return ee._updateRootComponent(c,i,n,b),p}ee.unmountComponentAtNode(n)}var m=r(n),f=m&&!!l(m),h=_(n);if("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(!h,"render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."):void 0,!f||m.nextSibling))for(var v=m;v;){if(l(v)){"production"!==o.env.NODE_ENV?B(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):void 0;break}v=v.nextSibling}var g=f&&!c&&!h,N=ee._renderNewRootComponent(i,n,g,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):I)._renderedComponent.getPublicInstance();return s&&s.call(N),N},render:function(e,t,o){return ee._renderSubtreeIntoContainer(null,e,t,o)},registerContainer:function(e){var t=a(e);return t&&(t=O.getReactRootIDFromNodeID(t)),t||(t=O.createReactRootID()),Q[t]=e,t},unmountComponentAtNode:function(e){"production"!==o.env.NODE_ENV?B(null==E.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",E.current&&E.current.getName()||"ReactCompositeComponent"):void 0,!e||e.nodeType!==q&&e.nodeType!==K&&e.nodeType!==z?"production"!==o.env.NODE_ENV?V(!1,"unmountComponentAtNode(...): Target container is not a DOM element."):V(!1):void 0;var t=a(e),n=G[t];if(!n){var r=_(e),s=l(e),i=s&&s===O.getReactRootIDFromNodeID(s);return"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(!r,"unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",i?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."):void 0),!1}return S.batchedUpdates(v,n,e),delete G[t],delete Q[t],"production"!==o.env.NODE_ENV&&delete $[t],!0},findReactContainerForID:function(e){var t=O.getReactRootIDFromNodeID(e),n=Q[t];if("production"!==o.env.NODE_ENV){var r=$[t];if(r&&r.parentNode!==n){"production"!==o.env.NODE_ENV?B(l(r)===t,"ReactMount: Root element ID differed from reactRootID."):void 0;var a=n.firstChild;a&&t===l(a)?$[t]=a:"production"!==o.env.NODE_ENV?B(!1,"ReactMount: Root element has been removed from its original container. New container: %s",r.parentNode):void 0}}return n},findReactNodeByID:function(e){var t=ee.findReactContainerForID(e);return ee.findComponentRoot(t,e)},getFirstReactDOM:function(e){return g(e)},findComponentRoot:function(e,t){var n=X,r=0,a=m(t)||e;for("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(null!=a,"React can't find the root component node for data-reactid value `%s`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.",t):void 0),n[0]=a.firstChild,n.length=1;r<n.length;){for(var s,l=n[r++];l;){var i=ee.getID(l);i?t===i?s=l:O.isAncestorIDOf(i,t)&&(n.length=r=0,n.push(l.firstChild)):n.push(l.firstChild),l=l.nextSibling}if(s)return n.length=0,s}n.length=0,"production"!==o.env.NODE_ENV?V(!1,"findComponentRoot(..., %s): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",t,ee.getID(e)):V(!1)},_mountImageIntoNode:function(e,t,a,s){if(!t||t.nodeType!==q&&t.nodeType!==K&&t.nodeType!==z?"production"!==o.env.NODE_ENV?V(!1,"mountComponentIntoNode(...): Target container is not valid."):V(!1):void 0,a){var l=r(t);if(U.canReuseMarkup(e,l))return;var i=l.getAttribute(U.CHECKSUM_ATTR_NAME);l.removeAttribute(U.CHECKSUM_ATTR_NAME);var c=l.outerHTML;l.setAttribute(U.CHECKSUM_ATTR_NAME,i);var d=e;if("production"!==o.env.NODE_ENV){var u;t.nodeType===q?(u=document.createElement("div"),u.innerHTML=e,d=u.innerHTML):(u=document.createElement("iframe"),document.body.appendChild(u),u.contentDocument.write(e),d=u.contentDocument.documentElement.outerHTML,document.body.removeChild(u))}var p=n(d,c),b=" (client) "+d.substring(p-20,p+20)+"\n (server) "+c.substring(p-20,p+20);t.nodeType===K?"production"!==o.env.NODE_ENV?V(!1,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",b):V(!1):void 0,"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",b):void 0)}if(t.nodeType===K?"production"!==o.env.NODE_ENV?V(!1,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering."):V(!1):void 0,s.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else A(t,e)},ownerDocumentContextKey:Y,getReactRootID:a,getID:s,setID:i,getNode:c,getNodeFromInstance:d,isValid:u,purgeID:p};w.measureMethods(ee,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),t.exports=ee}).call(this,e("_process"))},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOMFeatureFlags":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMFeatureFlags.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactEmptyComponentRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponentRegistry.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js","./ReactMarkupChecksum":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMarkupChecksum.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdateQueue.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/instantiateReactComponent.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setInnerHTML.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/shouldUpdateReactComponent.js","./validateDOMNesting":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/validateDOMNesting.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/containsNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/containsNode.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMultiChild.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){v.push({parentID:e,parentNode:null,type:u.INSERT_MARKUP,markupIndex:_.push(t)-1,content:null,fromIndex:null,toIndex:o})}function r(e,t,o){v.push({parentID:e,parentNode:null,type:u.MOVE_EXISTING,markupIndex:null,content:null,fromIndex:t,toIndex:o})}function a(e,t){v.push({parentID:e,parentNode:null,type:u.REMOVE_NODE,markupIndex:null,content:null,fromIndex:t,toIndex:null})}function s(e,t){v.push({parentID:e,parentNode:null,type:u.SET_MARKUP,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function l(e,t){v.push({parentID:e,parentNode:null,type:u.TEXT_CONTENT,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function i(){v.length&&(d.processChildrenUpdates(v,_),c())}function c(){v.length=0,_.length=0}var d=e("./ReactComponentEnvironment"),u=e("./ReactMultiChildUpdateTypes"),p=e("./ReactCurrentOwner"),b=e("./ReactReconciler"),m=e("./ReactChildReconciler"),f=e("./flattenChildren"),h=0,v=[],_=[],g={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){if("production"!==o.env.NODE_ENV&&this._currentElement)try{return p.current=this._currentElement._owner,m.instantiateChildren(e,t,n)}finally{p.current=null}return m.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r){var a;if("production"!==o.env.NODE_ENV&&this._currentElement){try{p.current=this._currentElement._owner,a=f(t)}finally{p.current=null}return m.updateChildren(e,a,n,r)}return a=f(t),m.updateChildren(e,a,n,r)},mountChildren:function(e,t,o){var n=this._reconcilerInstantiateChildren(e,t,o);this._renderedChildren=n;var r=[],a=0;for(var s in n)if(n.hasOwnProperty(s)){var l=n[s],i=this._rootNodeID+s,c=b.mountComponent(l,i,t,o);l._mountIndex=a++,r.push(c)}return r},updateTextContent:function(e){h++;var t=!0;try{var o=this._renderedChildren;m.unmountChildren(o);for(var n in o)o.hasOwnProperty(n)&&this._unmountChild(o[n]);this.setTextContent(e),t=!1}finally{h--,h||(t?c():i())}},updateMarkup:function(e){h++;var t=!0;try{var o=this._renderedChildren;m.unmountChildren(o);for(var n in o)o.hasOwnProperty(n)&&this._unmountChildByName(o[n],n);this.setMarkup(e),t=!1}finally{h--,h||(t?c():i())}},updateChildren:function(e,t,o){h++;var n=!0;try{this._updateChildren(e,t,o),n=!1}finally{h--,h||(n?c():i())}},_updateChildren:function(e,t,o){var n=this._renderedChildren,r=this._reconcilerUpdateChildren(n,e,t,o);if(this._renderedChildren=r,r||n){var a,s=0,l=0;for(a in r)if(r.hasOwnProperty(a)){var i=n&&n[a],c=r[a];i===c?(this.moveChild(i,l,s),s=Math.max(i._mountIndex,s),i._mountIndex=l):(i&&(s=Math.max(i._mountIndex,s),this._unmountChild(i)),this._mountChildByNameAtIndex(c,a,l,t,o)),l++}for(a in n)!n.hasOwnProperty(a)||r&&r.hasOwnProperty(a)||this._unmountChild(n[a])}},unmountChildren:function(){var e=this._renderedChildren;m.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,o){e._mountIndex<o&&r(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){n(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){a(this._rootNodeID,e._mountIndex)},setTextContent:function(e){l(this._rootNodeID,e)},setMarkup:function(e){s(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,o,n,r){var a=this._rootNodeID+t,s=b.mountComponent(e,a,n,r);e._mountIndex=o,this.createChild(e,s)},_unmountChild:function(e){this.removeChild(e),e._mountIndex=null}}};t.exports=g}).call(this,e("_process"))},{"./ReactChildReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactChildReconciler.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentEnvironment.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactMultiChildUpdateTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js","./flattenChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/flattenChildren.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMultiChildUpdateTypes.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/keyMirror"),r=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});t.exports=r},{"fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactNativeComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){if("function"==typeof e.type)return e.type;var t=e.type,o=u[t];return null==o&&(u[t]=o=c(t)),o}function r(e){return d?void 0:"production"!==o.env.NODE_ENV?i(!1,"There is no registered component for the tag %s",e.type):i(!1),new d(e.type,e.props)}function a(e){return new p(e)}function s(e){return e instanceof p}var l=e("./Object.assign"),i=e("fbjs/lib/invariant"),c=null,d=null,u={},p=null,b={injectGenericComponentClass:function(e){d=e},injectTextComponentClass:function(e){p=e},injectComponentClasses:function(e){l(u,e)}},m={getComponentClassForElement:n,createInternalComponent:r,createInstanceForText:a,isTextComponent:s,injection:b};t.exports=m}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactNoopUpdateQueue.js":[function(e,t,o){(function(o){"use strict";function n(e,t){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?r(!1,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op. Please check the code for the %s component.",t,t,e.constructor&&e.constructor.displayName||""):void 0)}var r=e("fbjs/lib/warning"),a={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){n(e,"forceUpdate")},enqueueReplaceState:function(e,t){n(e,"replaceState")},enqueueSetState:function(e,t){n(e,"setState")},enqueueSetProps:function(e,t){n(e,"setProps")},enqueueReplaceProps:function(e,t){n(e,"replaceProps")}};t.exports=a}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactOwner.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,a){r.isValidOwner(a)?void 0:"production"!==o.env.NODE_ENV?n(!1,"addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."):n(!1),a.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,a){r.isValidOwner(a)?void 0:"production"!==o.env.NODE_ENV?n(!1,"removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."):n(!1),a.getPublicInstance().refs[t]===e.getPublicInstance()&&a.detachRef(t)}};t.exports=r}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js":[function(e,t,o){(function(e){"use strict";function o(e,t,o){return o}var n={enableMeasure:!1,storedMeasure:o,measureMethods:function(t,o,r){if("production"!==e.env.NODE_ENV)for(var a in r)r.hasOwnProperty(a)&&(t[a]=n.measure(o,r[a],t[a]))},measure:function(t,o,r){if("production"!==e.env.NODE_ENV){var a=null,s=function(){return n.enableMeasure?(a||(a=n.storedMeasure(t,o,r)),a.apply(this,arguments)):r.apply(this,arguments)};return s.displayName=t+"_"+o,s}return r},injection:{injectMeasure:function(e){n.storedMeasure=e}}};t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocationNames.js":[function(e,t,o){(function(e){"use strict";var o={};"production"!==e.env.NODE_ENV&&(o={prop:"prop",context:"context",childContext:"child context"}),t.exports=o}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocations.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/keyMirror"),r=n({prop:null,context:null,childContext:null});t.exports=r},{"fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypes.js":[function(e,t,o){"use strict";function n(e){function t(t,o,n,r,a,s){ if(r=r||E,s=s||n,null==o[n]){var l=g[a];return t?new Error("Required "+l+" `"+s+"` was not specified in "+("`"+r+"`.")):null}return e(o,n,r,a,s)}var o=t.bind(null,!1);return o.isRequired=t.bind(null,!0),o}function r(e){function t(t,o,n,r,a){var s=t[o],l=f(s);if(l!==e){var i=g[r],c=h(s);return new Error("Invalid "+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+n+"`, expected ")+("`"+e+"`."))}return null}return n(t)}function a(){return n(N.thatReturns(null))}function s(e){function t(t,o,n,r,a){var s=t[o];if(!Array.isArray(s)){var l=g[r],i=f(s);return new Error("Invalid "+l+" `"+a+"` of type "+("`"+i+"` supplied to `"+n+"`, expected an array."))}for(var c=0;c<s.length;c++){var d=e(s,c,n,r,a+"["+c+"]");if(d instanceof Error)return d}return null}return n(t)}function l(){function e(e,t,o,n,r){if(!_.isValidElement(e[t])){var a=g[n];return new Error("Invalid "+a+" `"+r+"` supplied to "+("`"+o+"`, expected a single ReactElement."))}return null}return n(e)}function i(e){function t(t,o,n,r,a){if(!(t[o]instanceof e)){var s=g[r],l=e.name||E,i=v(t[o]);return new Error("Invalid "+s+" `"+a+"` of type "+("`"+i+"` supplied to `"+n+"`, expected ")+("instance of `"+l+"`."))}return null}return n(t)}function c(e){function t(t,o,n,r,a){for(var s=t[o],l=0;l<e.length;l++)if(s===e[l])return null;var i=g[r],c=JSON.stringify(e);return new Error("Invalid "+i+" `"+a+"` of value `"+s+"` "+("supplied to `"+n+"`, expected one of "+c+"."))}return n(Array.isArray(e)?t:function(){return new Error("Invalid argument supplied to oneOf, expected an instance of array.")})}function d(e){function t(t,o,n,r,a){var s=t[o],l=f(s);if("object"!==l){var i=g[r];return new Error("Invalid "+i+" `"+a+"` of type "+("`"+l+"` supplied to `"+n+"`, expected an object."))}for(var c in s)if(s.hasOwnProperty(c)){var d=e(s,c,n,r,a+"."+c);if(d instanceof Error)return d}return null}return n(t)}function u(e){function t(t,o,n,r,a){for(var s=0;s<e.length;s++){var l=e[s];if(null==l(t,o,n,r,a))return null}var i=g[r];return new Error("Invalid "+i+" `"+a+"` supplied to "+("`"+n+"`."))}return n(Array.isArray(e)?t:function(){return new Error("Invalid argument supplied to oneOfType, expected an instance of array.")})}function p(){function e(e,t,o,n,r){if(!m(e[t])){var a=g[n];return new Error("Invalid "+a+" `"+r+"` supplied to "+("`"+o+"`, expected a ReactNode."))}return null}return n(e)}function b(e){function t(t,o,n,r,a){var s=t[o],l=f(s);if("object"!==l){var i=g[r];return new Error("Invalid "+i+" `"+a+"` of type `"+l+"` "+("supplied to `"+n+"`, expected `object`."))}for(var c in e){var d=e[c];if(d){var u=d(s,c,n,r,a+"."+c);if(u)return u}}return null}return n(t)}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||_.isValidElement(e))return!0;var t=y(e);if(!t)return!1;var o,n=t.call(e);if(t!==e.entries){for(;!(o=n.next()).done;)if(!m(o.value))return!1}else for(;!(o=n.next()).done;){var r=o.value;if(r&&!m(r[1]))return!1}return!0;default:return!1}}function f(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function h(e){var t=f(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function v(e){return e.constructor&&e.constructor.name?e.constructor.name:"<<anonymous>>"}var _=e("./ReactElement"),g=e("./ReactPropTypeLocationNames"),N=e("fbjs/lib/emptyFunction"),y=e("./getIteratorFn"),E="<<anonymous>>",j={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:a(),arrayOf:s,element:l(),instanceOf:i,node:p(),objectOf:d,oneOf:c,oneOfType:u,shape:b};t.exports=j},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocationNames.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getIteratorFn.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconcileTransaction.js":[function(e,t,o){"use strict";function n(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=r.getPooled(null),this.useCreateElement=!e&&l.useCreateElement}var r=e("./CallbackQueue"),a=e("./PooledClass"),s=e("./ReactBrowserEventEmitter"),l=e("./ReactDOMFeatureFlags"),i=e("./ReactInputSelection"),c=e("./Transaction"),d=e("./Object.assign"),u={initialize:i.getSelectionInformation,close:i.restoreSelection},p={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},b={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},m=[u,p,b],f={getTransactionWrappers:function(){return m},getReactMountReady:function(){return this.reactMountReady},destructor:function(){r.release(this.reactMountReady),this.reactMountReady=null}};d(n.prototype,c.Mixin,f),a.addPoolingTo(n),t.exports=n},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactDOMFeatureFlags":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMFeatureFlags.js","./ReactInputSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInputSelection.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Transaction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js":[function(e,t,o){"use strict";function n(){r.attachRefs(this,this._currentElement)}var r=e("./ReactRef"),a={mountComponent:function(e,t,o,r){var a=e.mountComponent(t,o,r);return e._currentElement&&null!=e._currentElement.ref&&o.getReactMountReady().enqueue(n,e),a},unmountComponent:function(e){r.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,o,a){var s=e._currentElement;if(t!==s||a!==e._context){var l=r.shouldUpdateRefs(s,t);l&&r.detachRefs(e,s),e.receiveComponent(t,o,a),l&&e._currentElement&&null!=e._currentElement.ref&&o.getReactMountReady().enqueue(n,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};t.exports=a},{"./ReactRef":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRef.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRef.js":[function(e,t,o){"use strict";function n(e,t,o){"function"==typeof e?e(t.getPublicInstance()):a.addComponentAsRefTo(t,e,o)}function r(e,t,o){"function"==typeof e?e(null):a.removeComponentAsRefFrom(t,e,o)}var a=e("./ReactOwner"),s={};s.attachRefs=function(e,t){if(null!==t&&t!==!1){var o=t.ref;null!=o&&n(o,e,t._owner)}},s.shouldUpdateRefs=function(e,t){var o=null===e||e===!1,n=null===t||t===!1;return o||n||t._owner!==e._owner||t.ref!==e.ref},s.detachRefs=function(e,t){if(null!==t&&t!==!1){var o=t.ref;null!=o&&r(o,e,t._owner)}},t.exports=s},{"./ReactOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactOwner.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRootIndex.js":[function(e,t,o){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerBatchingStrategy.js":[function(e,t,o){"use strict";var n={isBatchingUpdates:!1,batchedUpdates:function(e){}};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerRendering.js":[function(e,t,o){(function(o){"use strict";function n(e){s.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?m(!1,"renderToString(): You must pass a valid ReactElement."):m(!1);var t;try{u.injection.injectBatchingStrategy(c);var n=l.createReactRootID();return t=d.getPooled(!1),t.perform(function(){var o=b(e,null),r=o.mountComponent(n,t,p);return i.addChecksumToMarkup(r)},null)}finally{d.release(t),u.injection.injectBatchingStrategy(a)}}function r(e){s.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?m(!1,"renderToStaticMarkup(): You must pass a valid ReactElement."):m(!1);var t;try{u.injection.injectBatchingStrategy(c);var n=l.createReactRootID();return t=d.getPooled(!0),t.perform(function(){var o=b(e,null);return o.mountComponent(n,t,p)},null)}finally{d.release(t),u.injection.injectBatchingStrategy(a)}}var a=e("./ReactDefaultBatchingStrategy"),s=e("./ReactElement"),l=e("./ReactInstanceHandles"),i=e("./ReactMarkupChecksum"),c=e("./ReactServerBatchingStrategy"),d=e("./ReactServerRenderingTransaction"),u=e("./ReactUpdates"),p=e("fbjs/lib/emptyObject"),b=e("./instantiateReactComponent"),m=e("fbjs/lib/invariant");t.exports={renderToString:n,renderToStaticMarkup:r}}).call(this,e("_process"))},{"./ReactDefaultBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js","./ReactMarkupChecksum":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMarkupChecksum.js","./ReactServerBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerBatchingStrategy.js","./ReactServerRenderingTransaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerRenderingTransaction.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/instantiateReactComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerRenderingTransaction.js":[function(e,t,o){"use strict";function n(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=a.getPooled(null),this.useCreateElement=!1}var r=e("./PooledClass"),a=e("./CallbackQueue"),s=e("./Transaction"),l=e("./Object.assign"),i=e("fbjs/lib/emptyFunction"),c={initialize:function(){this.reactMountReady.reset()},close:i},d=[c],u={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},destructor:function(){a.release(this.reactMountReady),this.reactMountReady=null}};l(n.prototype,s.Mixin,u),r.addPoolingTo(n),t.exports=n},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Transaction.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactTransitionEvents.js":[function(e,t,o){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete l.animationend.animation,"TransitionEvent"in window||delete l.transitionend.transition;for(var o in l){var n=l[o];for(var r in n)if(r in t){i.push(n[r]);break}}}function r(e,t,o){e.addEventListener(t,o,!1)}function a(e,t,o){e.removeEventListener(t,o,!1)}var s=e("fbjs/lib/ExecutionEnvironment"),l={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},i=[];s.canUseDOM&&n();var c={addEndEventListener:function(e,t){return 0===i.length?void window.setTimeout(t,0):void i.forEach(function(o){r(e,o,t)})},removeEndEventListener:function(e,t){0!==i.length&&i.forEach(function(o){a(e,o,t)})}};t.exports=c},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdateQueue.js":[function(e,t,o){(function(o){"use strict";function n(e){i.enqueueUpdate(e)}function r(e,t){var n=l.get(e);return n?("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?u(null==a.current,"%s(...): Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.",t):void 0),n):("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?u(!t,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op. Please check the code for the %s component.",t,t,e.constructor.displayName):void 0),null)}var a=e("./ReactCurrentOwner"),s=e("./ReactElement"),l=e("./ReactInstanceMap"),i=e("./ReactUpdates"),c=e("./Object.assign"),d=e("fbjs/lib/invariant"),u=e("fbjs/lib/warning"),p={isMounted:function(e){if("production"!==o.env.NODE_ENV){var t=a.current;null!==t&&("production"!==o.env.NODE_ENV?u(t._warnedAboutRefsInRender,"%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):void 0,t._warnedAboutRefsInRender=!0)}var n=l.get(e);return n?!!n._renderedComponent:!1},enqueueCallback:function(e,t){"function"!=typeof t?"production"!==o.env.NODE_ENV?d(!1,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):d(!1):void 0;var a=r(e);return a?(a._pendingCallbacks?a._pendingCallbacks.push(t):a._pendingCallbacks=[t],void n(a)):null},enqueueCallbackInternal:function(e,t){"function"!=typeof t?"production"!==o.env.NODE_ENV?d(!1,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):d(!1):void 0,e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],n(e)},enqueueForceUpdate:function(e){var t=r(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,n(t))},enqueueReplaceState:function(e,t){var o=r(e,"replaceState");o&&(o._pendingStateQueue=[t],o._pendingReplaceState=!0,n(o))},enqueueSetState:function(e,t){var o=r(e,"setState");if(o){var a=o._pendingStateQueue||(o._pendingStateQueue=[]);a.push(t),n(o)}},enqueueSetProps:function(e,t){var o=r(e,"setProps");o&&p.enqueueSetPropsInternal(o,t)},enqueueSetPropsInternal:function(e,t){var r=e._topLevelWrapper;r?void 0:"production"!==o.env.NODE_ENV?d(!1,"setProps(...): You called `setProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):d(!1);var a=r._pendingElement||r._currentElement,l=a.props,i=c({},l.props,t);r._pendingElement=s.cloneAndReplaceProps(a,s.cloneAndReplaceProps(l,i)),n(r)},enqueueReplaceProps:function(e,t){var o=r(e,"replaceProps");o&&p.enqueueReplacePropsInternal(o,t)},enqueueReplacePropsInternal:function(e,t){var r=e._topLevelWrapper;r?void 0:"production"!==o.env.NODE_ENV?d(!1,"replaceProps(...): You called `replaceProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):d(!1);var a=r._pendingElement||r._currentElement,l=a.props;r._pendingElement=s.cloneAndReplaceProps(a,s.cloneAndReplaceProps(l,t)),n(r)},enqueueElementInternal:function(e,t){e._pendingElement=t,n(e)}};t.exports=p}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactUpdates.js":[function(e,t,o){(function(o){"use strict";function n(){O.ReactReconcileTransaction&&N?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must inject a reconcile transaction class and batching strategy"):h(!1)}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=d.getPooled(),this.reconcileTransaction=O.ReactReconcileTransaction.getPooled(!1)}function a(e,t,o,r,a,s){n(),N.batchedUpdates(e,t,o,r,a,s)}function s(e,t){return e._mountOrder-t._mountOrder}function l(e){var t=e.dirtyComponentsLength;t!==v.length?"production"!==o.env.NODE_ENV?h(!1,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",t,v.length):h(!1):void 0,v.sort(s);for(var n=0;t>n;n++){var r=v[n],a=r._pendingCallbacks;if(r._pendingCallbacks=null,b.performUpdateIfNecessary(r,e.reconcileTransaction),a)for(var l=0;l<a.length;l++)e.callbackQueue.enqueue(a[l],r.getPublicInstance())}}function i(e){return n(),N.isBatchingUpdates?void v.push(e):void N.batchedUpdates(i,e)}function c(e,t){N.isBatchingUpdates?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."):h(!1),_.enqueue(e,t),g=!0}var d=e("./CallbackQueue"),u=e("./PooledClass"),p=e("./ReactPerf"),b=e("./ReactReconciler"),m=e("./Transaction"),f=e("./Object.assign"),h=e("fbjs/lib/invariant"),v=[],_=d.getPooled(),g=!1,N=null,y={initialize:function(){this.dirtyComponentsLength=v.length},close:function(){this.dirtyComponentsLength!==v.length?(v.splice(0,this.dirtyComponentsLength),C()):v.length=0}},E={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},j=[y,E];f(r.prototype,m.Mixin,{getTransactionWrappers:function(){return j},destructor:function(){this.dirtyComponentsLength=null,d.release(this.callbackQueue),this.callbackQueue=null,O.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,o){return m.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,o)}}),u.addPoolingTo(r);var C=function(){for(;v.length||g;){if(v.length){var e=r.getPooled();e.perform(l,null,e),r.release(e)}if(g){g=!1;var t=_;_=d.getPooled(),t.notifyAll(),d.release(t)}}};C=p.measure("ReactUpdates","flushBatchedUpdates",C);var R={injectReconcileTransaction:function(e){e?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide a reconcile transaction class"):h(!1),O.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide a batching strategy"):h(!1),"function"!=typeof e.batchedUpdates?"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide a batchedUpdates() function"):h(!1):void 0,"boolean"!=typeof e.isBatchingUpdates?"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide an isBatchingUpdates boolean attribute"):h(!1):void 0,N=e}},O={ReactReconcileTransaction:null,batchedUpdates:a,enqueueUpdate:i,flushBatchedUpdates:C,injection:R,asap:c};t.exports=O}).call(this,e("_process"))},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Transaction.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactVersion.js":[function(e,t,o){"use strict";t.exports="0.14.2"},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SVGDOMPropertyConfig.js":[function(e,t,o){"use strict";var n=e("./DOMProperty"),r=n.injection.MUST_USE_ATTRIBUTE,a={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},s={Properties:{clipPath:r,cx:r,cy:r,d:r,dx:r,dy:r,fill:r,fillOpacity:r,fontFamily:r,fontSize:r,fx:r,fy:r,gradientTransform:r,gradientUnits:r,markerEnd:r,markerMid:r,markerStart:r,offset:r,opacity:r,patternContentUnits:r,patternUnits:r,points:r,preserveAspectRatio:r,r:r,rx:r,ry:r,spreadMethod:r,stopColor:r,stopOpacity:r,stroke:r,strokeDasharray:r,strokeLinecap:r,strokeOpacity:r,strokeWidth:r,textAnchor:r,transform:r,version:r,viewBox:r,x1:r,x2:r,x:r,xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:r,xmlLang:r,xmlSpace:r,y1:r,y2:r,y:r},DOMAttributeNamespaces:{xlinkActuate:a.xlink,xlinkArcrole:a.xlink,xlinkHref:a.xlink,xlinkRole:a.xlink,xlinkShow:a.xlink,xlinkTitle:a.xlink,xlinkType:a.xlink,xmlBase:a.xml,xmlLang:a.xml,xmlSpace:a.xml},DOMAttributeNames:{clipPath:"clip-path",fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space"}};t.exports=s},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DOMProperty.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SelectEventPlugin.js":[function(e,t,o){"use strict";function n(e){if("selectionStart"in e&&i.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var o=document.selection.createRange();return{parentElement:o.parentElement(),text:o.text,top:o.boundingTop,left:o.boundingLeft}}}function r(e,t){if(N||null==v||v!==d())return null;var o=n(v);if(!g||!b(g,o)){g=o;var r=c.getPooled(h.select,_,e,t);return r.type="select",r.target=v,s.accumulateTwoPhaseDispatches(r),r}return null}var a=e("./EventConstants"),s=e("./EventPropagators"),l=e("fbjs/lib/ExecutionEnvironment"),i=e("./ReactInputSelection"),c=e("./SyntheticEvent"),d=e("fbjs/lib/getActiveElement"),u=e("./isTextInputElement"),p=e("fbjs/lib/keyOf"),b=e("fbjs/lib/shallowEqual"),m=a.topLevelTypes,f=l.canUseDOM&&"documentMode"in document&&document.documentMode<=11,h={select:{phasedRegistrationNames:{bubbled:p({onSelect:null}),captured:p({onSelectCapture:null})},dependencies:[m.topBlur,m.topContextMenu,m.topFocus,m.topKeyDown,m.topMouseDown,m.topMouseUp,m.topSelectionChange]}},v=null,_=null,g=null,N=!1,y=!1,E=p({onSelect:null}),j={eventTypes:h,extractEvents:function(e,t,o,n,a){if(!y)return null;switch(e){case m.topFocus:(u(t)||"true"===t.contentEditable)&&(v=t,_=o,g=null);break;case m.topBlur:v=null,_=null,g=null;break;case m.topMouseDown:N=!0;break;case m.topContextMenu:case m.topMouseUp:return N=!1,r(n,a);case m.topSelectionChange:if(f)break;case m.topKeyDown:case m.topKeyUp:return r(n,a)}return null},didPutListener:function(e,t,o){t===E&&(y=!0)}};t.exports=j},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPropagators.js","./ReactInputSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInputSelection.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js","./isTextInputElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isTextInputElement.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/getActiveElement":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getActiveElement.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js","fbjs/lib/shallowEqual":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/shallowEqual.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ServerReactRootIndex.js":[function(e,t,o){"use strict";var n=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*n)}};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SimpleEventPlugin.js":[function(e,t,o){(function(o){"use strict";var n=e("./EventConstants"),r=e("fbjs/lib/EventListener"),a=e("./EventPropagators"),s=e("./ReactMount"),l=e("./SyntheticClipboardEvent"),i=e("./SyntheticEvent"),c=e("./SyntheticFocusEvent"),d=e("./SyntheticKeyboardEvent"),u=e("./SyntheticMouseEvent"),p=e("./SyntheticDragEvent"),b=e("./SyntheticTouchEvent"),m=e("./SyntheticUIEvent"),f=e("./SyntheticWheelEvent"),h=e("fbjs/lib/emptyFunction"),v=e("./getEventCharCode"),_=e("fbjs/lib/invariant"),g=e("fbjs/lib/keyOf"),N=n.topLevelTypes,y={abort:{phasedRegistrationNames:{bubbled:g({onAbort:!0}),captured:g({onAbortCapture:!0})}},blur:{phasedRegistrationNames:{bubbled:g({onBlur:!0}),captured:g({onBlurCapture:!0})}},canPlay:{phasedRegistrationNames:{bubbled:g({onCanPlay:!0}),captured:g({onCanPlayCapture:!0})}},canPlayThrough:{phasedRegistrationNames:{bubbled:g({onCanPlayThrough:!0}),captured:g({onCanPlayThroughCapture:!0})}},click:{phasedRegistrationNames:{bubbled:g({onClick:!0}),captured:g({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:g({onContextMenu:!0}),captured:g({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:g({onCopy:!0}),captured:g({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:g({onCut:!0}),captured:g({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:g({onDoubleClick:!0}),captured:g({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:g({onDrag:!0}),captured:g({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:g({onDragEnd:!0}),captured:g({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:g({onDragEnter:!0}),captured:g({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:g({onDragExit:!0}),captured:g({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:g({onDragLeave:!0}),captured:g({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:g({onDragOver:!0}),captured:g({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:g({onDragStart:!0}),captured:g({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:g({onDrop:!0}),captured:g({onDropCapture:!0})}},durationChange:{phasedRegistrationNames:{bubbled:g({onDurationChange:!0}),captured:g({onDurationChangeCapture:!0})}},emptied:{phasedRegistrationNames:{bubbled:g({onEmptied:!0}),captured:g({onEmptiedCapture:!0})}},encrypted:{phasedRegistrationNames:{bubbled:g({onEncrypted:!0}),captured:g({onEncryptedCapture:!0})}},ended:{phasedRegistrationNames:{bubbled:g({onEnded:!0}),captured:g({onEndedCapture:!0})}},error:{phasedRegistrationNames:{bubbled:g({onError:!0}),captured:g({onErrorCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:g({onFocus:!0}),captured:g({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:g({onInput:!0}),captured:g({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:g({onKeyDown:!0}),captured:g({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:g({onKeyPress:!0}),captured:g({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:g({onKeyUp:!0}),captured:g({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:g({onLoad:!0}),captured:g({onLoadCapture:!0})}},loadedData:{phasedRegistrationNames:{bubbled:g({onLoadedData:!0}),captured:g({onLoadedDataCapture:!0})}},loadedMetadata:{phasedRegistrationNames:{bubbled:g({onLoadedMetadata:!0}),captured:g({onLoadedMetadataCapture:!0})}},loadStart:{phasedRegistrationNames:{bubbled:g({onLoadStart:!0}),captured:g({onLoadStartCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:g({onMouseDown:!0}),captured:g({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:g({onMouseMove:!0}),captured:g({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{ bubbled:g({onMouseOut:!0}),captured:g({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:g({onMouseOver:!0}),captured:g({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:g({onMouseUp:!0}),captured:g({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:g({onPaste:!0}),captured:g({onPasteCapture:!0})}},pause:{phasedRegistrationNames:{bubbled:g({onPause:!0}),captured:g({onPauseCapture:!0})}},play:{phasedRegistrationNames:{bubbled:g({onPlay:!0}),captured:g({onPlayCapture:!0})}},playing:{phasedRegistrationNames:{bubbled:g({onPlaying:!0}),captured:g({onPlayingCapture:!0})}},progress:{phasedRegistrationNames:{bubbled:g({onProgress:!0}),captured:g({onProgressCapture:!0})}},rateChange:{phasedRegistrationNames:{bubbled:g({onRateChange:!0}),captured:g({onRateChangeCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:g({onReset:!0}),captured:g({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:g({onScroll:!0}),captured:g({onScrollCapture:!0})}},seeked:{phasedRegistrationNames:{bubbled:g({onSeeked:!0}),captured:g({onSeekedCapture:!0})}},seeking:{phasedRegistrationNames:{bubbled:g({onSeeking:!0}),captured:g({onSeekingCapture:!0})}},stalled:{phasedRegistrationNames:{bubbled:g({onStalled:!0}),captured:g({onStalledCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:g({onSubmit:!0}),captured:g({onSubmitCapture:!0})}},suspend:{phasedRegistrationNames:{bubbled:g({onSuspend:!0}),captured:g({onSuspendCapture:!0})}},timeUpdate:{phasedRegistrationNames:{bubbled:g({onTimeUpdate:!0}),captured:g({onTimeUpdateCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:g({onTouchCancel:!0}),captured:g({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:g({onTouchEnd:!0}),captured:g({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:g({onTouchMove:!0}),captured:g({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:g({onTouchStart:!0}),captured:g({onTouchStartCapture:!0})}},volumeChange:{phasedRegistrationNames:{bubbled:g({onVolumeChange:!0}),captured:g({onVolumeChangeCapture:!0})}},waiting:{phasedRegistrationNames:{bubbled:g({onWaiting:!0}),captured:g({onWaitingCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:g({onWheel:!0}),captured:g({onWheelCapture:!0})}}},E={topAbort:y.abort,topBlur:y.blur,topCanPlay:y.canPlay,topCanPlayThrough:y.canPlayThrough,topClick:y.click,topContextMenu:y.contextMenu,topCopy:y.copy,topCut:y.cut,topDoubleClick:y.doubleClick,topDrag:y.drag,topDragEnd:y.dragEnd,topDragEnter:y.dragEnter,topDragExit:y.dragExit,topDragLeave:y.dragLeave,topDragOver:y.dragOver,topDragStart:y.dragStart,topDrop:y.drop,topDurationChange:y.durationChange,topEmptied:y.emptied,topEncrypted:y.encrypted,topEnded:y.ended,topError:y.error,topFocus:y.focus,topInput:y.input,topKeyDown:y.keyDown,topKeyPress:y.keyPress,topKeyUp:y.keyUp,topLoad:y.load,topLoadedData:y.loadedData,topLoadedMetadata:y.loadedMetadata,topLoadStart:y.loadStart,topMouseDown:y.mouseDown,topMouseMove:y.mouseMove,topMouseOut:y.mouseOut,topMouseOver:y.mouseOver,topMouseUp:y.mouseUp,topPaste:y.paste,topPause:y.pause,topPlay:y.play,topPlaying:y.playing,topProgress:y.progress,topRateChange:y.rateChange,topReset:y.reset,topScroll:y.scroll,topSeeked:y.seeked,topSeeking:y.seeking,topStalled:y.stalled,topSubmit:y.submit,topSuspend:y.suspend,topTimeUpdate:y.timeUpdate,topTouchCancel:y.touchCancel,topTouchEnd:y.touchEnd,topTouchMove:y.touchMove,topTouchStart:y.touchStart,topVolumeChange:y.volumeChange,topWaiting:y.waiting,topWheel:y.wheel};for(var j in E)E[j].dependencies=[j];var C=g({onClick:null}),R={},O={eventTypes:y,extractEvents:function(e,t,n,r,s){var h=E[e];if(!h)return null;var g;switch(e){case N.topAbort:case N.topCanPlay:case N.topCanPlayThrough:case N.topDurationChange:case N.topEmptied:case N.topEncrypted:case N.topEnded:case N.topError:case N.topInput:case N.topLoad:case N.topLoadedData:case N.topLoadedMetadata:case N.topLoadStart:case N.topPause:case N.topPlay:case N.topPlaying:case N.topProgress:case N.topRateChange:case N.topReset:case N.topSeeked:case N.topSeeking:case N.topStalled:case N.topSubmit:case N.topSuspend:case N.topTimeUpdate:case N.topVolumeChange:case N.topWaiting:g=i;break;case N.topKeyPress:if(0===v(r))return null;case N.topKeyDown:case N.topKeyUp:g=d;break;case N.topBlur:case N.topFocus:g=c;break;case N.topClick:if(2===r.button)return null;case N.topContextMenu:case N.topDoubleClick:case N.topMouseDown:case N.topMouseMove:case N.topMouseOut:case N.topMouseOver:case N.topMouseUp:g=u;break;case N.topDrag:case N.topDragEnd:case N.topDragEnter:case N.topDragExit:case N.topDragLeave:case N.topDragOver:case N.topDragStart:case N.topDrop:g=p;break;case N.topTouchCancel:case N.topTouchEnd:case N.topTouchMove:case N.topTouchStart:g=b;break;case N.topScroll:g=m;break;case N.topWheel:g=f;break;case N.topCopy:case N.topCut:case N.topPaste:g=l}g?void 0:"production"!==o.env.NODE_ENV?_(!1,"SimpleEventPlugin: Unhandled event type, `%s`.",e):_(!1);var y=g.getPooled(h,n,r,s);return a.accumulateTwoPhaseDispatches(y),y},didPutListener:function(e,t,o){if(t===C){var n=s.getNode(e);R[e]||(R[e]=r.listen(n,"click",h))}},willDeleteListener:function(e,t){t===C&&(R[e].remove(),delete R[e])}};t.exports=O}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventPropagators.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js","./SyntheticClipboardEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticClipboardEvent.js","./SyntheticDragEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticDragEvent.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js","./SyntheticFocusEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticFocusEvent.js","./SyntheticKeyboardEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticKeyboardEvent.js","./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticMouseEvent.js","./SyntheticTouchEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticTouchEvent.js","./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js","./SyntheticWheelEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticWheelEvent.js","./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventCharCode.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/EventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/EventListener.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticClipboardEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticEvent"),a={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};r.augmentClass(n,a),t.exports=n},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticCompositionEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticEvent"),a={data:null};r.augmentClass(n,a),t.exports=n},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticDragEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticMouseEvent"),a={dataTransfer:null};r.augmentClass(n,a),t.exports=n},{"./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=o,this.target=n,this.currentTarget=n;var r=this.constructor.Interface;for(var a in r)if(r.hasOwnProperty(a)){var l=r[a];l?this[a]=l(o):this[a]=o[a]}var i=null!=o.defaultPrevented?o.defaultPrevented:o.returnValue===!1;i?this.isDefaultPrevented=s.thatReturnsTrue:this.isDefaultPrevented=s.thatReturnsFalse,this.isPropagationStopped=s.thatReturnsFalse}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("fbjs/lib/emptyFunction"),l=e("fbjs/lib/warning"),i={type:null,currentTarget:s.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};a(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?l(e,"This synthetic event is reused for performance reasons. If you're seeing this, you're calling `preventDefault` on a released/nullified synthetic event. This is a no-op. See https://fb.me/react-event-pooling for more information."):void 0),e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=s.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?l(e,"This synthetic event is reused for performance reasons. If you're seeing this, you're calling `stopPropagation` on a released/nullified synthetic event. This is a no-op. See https://fb.me/react-event-pooling for more information."):void 0),e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=s.thatReturnsTrue)},persist:function(){this.isPersistent=s.thatReturnsTrue},isPersistent:s.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),n.Interface=i,n.augmentClass=function(e,t){var o=this,n=Object.create(o.prototype);a(n,e.prototype),e.prototype=n,e.prototype.constructor=e,e.Interface=a({},o.Interface,t),e.augmentClass=o.augmentClass,r.addPoolingTo(e,r.fourArgumentPooler)},r.addPoolingTo(n,r.fourArgumentPooler),t.exports=n}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/PooledClass.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticFocusEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticUIEvent"),a={relatedTarget:null};r.augmentClass(n,a),t.exports=n},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticInputEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticEvent"),a={data:null};r.augmentClass(n,a),t.exports=n},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticKeyboardEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticUIEvent"),a=e("./getEventCharCode"),s=e("./getEventKey"),l=e("./getEventModifierState"),i={key:s,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:l,charCode:function(e){return"keypress"===e.type?a(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?a(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};r.augmentClass(n,i),t.exports=n},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js","./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventCharCode.js","./getEventKey":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventKey.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticMouseEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticUIEvent"),a=e("./ViewportMetrics"),s=e("./getEventModifierState"),l={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:s,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+a.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+a.currentScrollTop}};r.augmentClass(n,l),t.exports=n},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js","./ViewportMetrics":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ViewportMetrics.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticTouchEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticUIEvent"),a=e("./getEventModifierState"),s={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:a};r.augmentClass(n,s),t.exports=n},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticEvent"),a=e("./getEventTarget"),s={view:function(e){if(e.view)return e.view;var t=a(e);if(null!=t&&t.window===t)return t;var o=t.ownerDocument;return o?o.defaultView||o.parentWindow:window},detail:function(e){return e.detail||0}};r.augmentClass(n,s),t.exports=n},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventTarget.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticWheelEvent.js":[function(e,t,o){"use strict";function n(e,t,o,n){r.call(this,e,t,o,n)}var r=e("./SyntheticMouseEvent"),a={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};r.augmentClass(n,a),t.exports=n},{"./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Transaction.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,r,a,s,l,i,c){this.isInTransaction()?"production"!==o.env.NODE_ENV?n(!1,"Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction."):n(!1):void 0;var d,u;try{this._isInTransaction=!0,d=!0,this.initializeAll(0),u=e.call(t,r,a,s,l,i,c),d=!1}finally{try{if(d)try{this.closeAll(0)}catch(p){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return u},initializeAll:function(e){for(var t=this.transactionWrappers,o=e;o<t.length;o++){var n=t[o];try{this.wrapperInitData[o]=a.OBSERVED_ERROR,this.wrapperInitData[o]=n.initialize?n.initialize.call(this):null}finally{if(this.wrapperInitData[o]===a.OBSERVED_ERROR)try{this.initializeAll(o+1)}catch(r){}}}},closeAll:function(e){this.isInTransaction()?void 0:"production"!==o.env.NODE_ENV?n(!1,"Transaction.closeAll(): Cannot close transaction when none are open."):n(!1);for(var t=this.transactionWrappers,r=e;r<t.length;r++){var s,l=t[r],i=this.wrapperInitData[r];try{s=!0,i!==a.OBSERVED_ERROR&&l.close&&l.close.call(this,i),s=!1}finally{if(s)try{this.closeAll(r+1)}catch(c){}}}this.wrapperInitData.length=0}},a={Mixin:r,OBSERVED_ERROR:{}};t.exports=a}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ViewportMetrics.js":[function(e,t,o){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/accumulateInto.js":[function(e,t,o){(function(o){"use strict";function n(e,t){if(null==t?"production"!==o.env.NODE_ENV?r(!1,"accumulateInto(...): Accumulated items must not be null or undefined."):r(!1):void 0,null==e)return t;var n=Array.isArray(e),a=Array.isArray(t);return n&&a?(e.push.apply(e,t),e):n?(e.push(t),e):a?[e].concat(t):[e,t]}var r=e("fbjs/lib/invariant");t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/adler32.js":[function(e,t,o){"use strict";function n(e){for(var t=1,o=0,n=0,a=e.length,s=-4&a;s>n;){for(;n<Math.min(n+4096,s);n+=4)o+=(t+=e.charCodeAt(n))+(t+=e.charCodeAt(n+1))+(t+=e.charCodeAt(n+2))+(t+=e.charCodeAt(n+3));t%=r,o%=r}for(;a>n;n++)o+=t+=e.charCodeAt(n);return t%=r,o%=r,t|o<<16}var r=65521;t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/canDefineProperty.js":[function(e,t,o){(function(e){"use strict";var o=!1;if("production"!==e.env.NODE_ENV)try{Object.defineProperty({},"x",{get:function(){}}),o=!0}catch(n){}t.exports=o}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/dangerousStyleValue.js":[function(e,t,o){"use strict";function n(e,t){var o=null==t||"boolean"==typeof t||""===t;if(o)return"";var n=isNaN(t);return n||0===t||a.hasOwnProperty(e)&&a[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var r=e("./CSSProperty"),a=r.isUnitlessNumber;t.exports=n},{"./CSSProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CSSProperty.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/deprecated.js":[function(e,t,o){(function(o){"use strict";function n(e,t,n,s,l){var i=!1;if("production"!==o.env.NODE_ENV){var c=function(){return"production"!==o.env.NODE_ENV?a(i,"React.%s is deprecated. Please use %s.%s from require('%s') instead.",e,t,e,n):void 0,i=!0,l.apply(s,arguments)};return r(c,l)}return l}var r=e("./Object.assign"),a=e("fbjs/lib/warning");t.exports=n}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/escapeTextContentForBrowser.js":[function(e,t,o){"use strict";function n(e){return a[e]}function r(e){return(""+e).replace(s,n)}var a={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},s=/[&><"']/g;t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/findDOMNode.js":[function(e,t,o){(function(o){"use strict";function n(e){if("production"!==o.env.NODE_ENV){var t=r.current;null!==t&&("production"!==o.env.NODE_ENV?i(t._warnedAboutRefsInRender,"%s is accessing getDOMNode or findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):void 0,t._warnedAboutRefsInRender=!0)}return null==e?null:1===e.nodeType?e:a.has(e)?s.getNodeFromInstance(e):(null!=e.render&&"function"==typeof e.render?"production"!==o.env.NODE_ENV?l(!1,"findDOMNode was called on an unmounted component."):l(!1):void 0,void("production"!==o.env.NODE_ENV?l(!1,"Element appears to be neither ReactComponent nor DOMNode (keys: %s)",Object.keys(e)):l(!1)))}var r=e("./ReactCurrentOwner"),a=e("./ReactInstanceMap"),s=e("./ReactMount"),l=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning");t.exports=n}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/flattenChildren.js":[function(e,t,o){(function(o){"use strict";function n(e,t,n){var r=e,a=void 0===r[n];"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?s(a,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",n):void 0),a&&null!=t&&(r[n]=t)}function r(e){if(null==e)return e;var t={};return a(e,n,t),t}var a=e("./traverseAllChildren"),s=e("fbjs/lib/warning");t.exports=r}).call(this,e("_process"))},{"./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/traverseAllChildren.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/forEachAccumulated.js":[function(e,t,o){"use strict";var n=function(e,t,o){Array.isArray(e)?e.forEach(t,o):e&&t.call(o,e)};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventCharCode.js":[function(e,t,o){"use strict";function n(e){var t,o=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===o&&(t=13)):t=o,t>=32||13===t?t:0}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventKey.js":[function(e,t,o){"use strict";function n(e){if(e.key){var t=a[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var o=r(e);return 13===o?"Enter":String.fromCharCode(o)}return"keydown"===e.type||"keyup"===e.type?s[e.keyCode]||"Unidentified":""}var r=e("./getEventCharCode"),a={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{"./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventCharCode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventModifierState.js":[function(e,t,o){"use strict";function n(e){var t=this,o=t.nativeEvent;if(o.getModifierState)return o.getModifierState(e);var n=a[e];return n?!!o[n]:!1}function r(e){return n}var a={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventTarget.js":[function(e,t,o){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getIteratorFn.js":[function(e,t,o){"use strict";function n(e){var t=e&&(r&&e[r]||e[a]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getNodeForCharacterOffset.js":[function(e,t,o){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function a(e,t){for(var o=n(e),a=0,s=0;o;){if(3===o.nodeType){if(s=a+o.textContent.length,t>=a&&s>=t)return{node:o,offset:t-a};a=s}o=n(r(o))}}t.exports=a},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getTextContentAccessor.js":[function(e,t,o){"use strict";function n(){return!a&&r.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var r=e("fbjs/lib/ExecutionEnvironment"),a=null;t.exports=n},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/instantiateReactComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e){var t;if(null===e||e===!1)t=new l(a);else if("object"==typeof e){var s=e;!s||"function"!=typeof s.type&&"string"!=typeof s.type?"production"!==o.env.NODE_ENV?d(!1,"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",null==s.type?s.type:typeof s.type,n(s._owner)):d(!1):void 0,t="string"==typeof s.type?i.createInternalComponent(s):r(s.type)?new s.type(s):new p}else"string"==typeof e||"number"==typeof e?t=i.createInstanceForText(e):"production"!==o.env.NODE_ENV?d(!1,"Encountered invalid React node of type %s",typeof e):d(!1);return"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?u("function"==typeof t.construct&&"function"==typeof t.mountComponent&&"function"==typeof t.receiveComponent&&"function"==typeof t.unmountComponent,"Only React Components can be mounted."):void 0),t.construct(e),t._mountIndex=0,t._mountImage=null,"production"!==o.env.NODE_ENV&&(t._isOwnerNecessary=!1,t._warnedAboutRefsInRender=!1),"production"!==o.env.NODE_ENV&&Object.preventExtensions&&Object.preventExtensions(t),t}var s=e("./ReactCompositeComponent"),l=e("./ReactEmptyComponent"),i=e("./ReactNativeComponent"),c=e("./Object.assign"),d=e("fbjs/lib/invariant"),u=e("fbjs/lib/warning"),p=function(){};c(p.prototype,s.Mixin,{_instantiateReactComponent:a}),t.exports=a}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js","./ReactCompositeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCompositeComponent.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactNativeComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isEventSupported.js":[function(e,t,o){"use strict";function n(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var r,a=e("fbjs/lib/ExecutionEnvironment");a.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js" }],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isTextInputElement.js":[function(e,t,o){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&r[e.type]||"textarea"===t)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/onlyChild.js":[function(e,t,o){(function(o){"use strict";function n(e){return r.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?a(!1,"onlyChild must be passed a children with exactly one child."):a(!1),e}var r=e("./ReactElement"),a=e("fbjs/lib/invariant");t.exports=n}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/quoteAttributeValueForBrowser.js":[function(e,t,o){"use strict";function n(e){return'"'+r(e)+'"'}var r=e("./escapeTextContentForBrowser");t.exports=n},{"./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/escapeTextContentForBrowser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/renderSubtreeIntoContainer.js":[function(e,t,o){"use strict";var n=e("./ReactMount");t.exports=n.renderSubtreeIntoContainer},{"./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMount.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setInnerHTML.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/ExecutionEnvironment"),r=/^[ \r\n\t\f]/,a=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,s=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(s=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),n.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(s=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&a.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var o=e.firstChild;1===o.data.length?e.removeChild(o):o.deleteData(0,1)}else e.innerHTML=t})}t.exports=s},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setTextContent.js":[function(e,t,o){"use strict";var n=e("fbjs/lib/ExecutionEnvironment"),r=e("./escapeTextContentForBrowser"),a=e("./setInnerHTML"),s=function(e,t){e.textContent=t};n.canUseDOM&&("textContent"in document.documentElement||(s=function(e,t){a(e,r(t))})),t.exports=s},{"./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/escapeTextContentForBrowser.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setInnerHTML.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/shouldUpdateReactComponent.js":[function(e,t,o){"use strict";function n(e,t){var o=null===e||e===!1,n=null===t||t===!1;if(o||n)return o===n;var r=typeof e,a=typeof t;return"string"===r||"number"===r?"string"===a||"number"===a:"object"===a&&e.type===t.type&&e.key===t.key}t.exports=n},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/traverseAllChildren.js":[function(e,t,o){(function(o){"use strict";function n(e){return v[e]}function r(e,t){return e&&null!=e.key?s(e.key):t.toString(36)}function a(e){return(""+e).replace(_,n)}function s(e){return"$"+a(e)}function l(e,t,n,a){var i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||d.isValidElement(e))return n(a,e,""===t?f+r(e,0):t),1;var u,v,_=0,N=""===t?f:t+h;if(Array.isArray(e))for(var y=0;y<e.length;y++)u=e[y],v=N+r(u,y),_+=l(u,v,n,a);else{var E=p(e);if(E){var j,C=E.call(e);if(E!==e.entries)for(var R=0;!(j=C.next()).done;)u=j.value,v=N+r(u,R++),_+=l(u,v,n,a);else for("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?m(g,"Using Maps as children is not yet fully supported. It is an experimental feature that might be removed. Convert it to a sequence / iterable of keyed ReactElements instead."):void 0,g=!0);!(j=C.next()).done;){var O=j.value;O&&(u=O[1],v=N+s(O[0])+h+r(u,0),_+=l(u,v,n,a))}}else if("object"===i){var D="";if("production"!==o.env.NODE_ENV&&(D=" If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons.",e._isReactElement&&(D=" It looks like you're using an element created by a different version of React. Make sure to use only one copy of React."),c.current)){var U=c.current.getName();U&&(D+=" Check the render method of `"+U+"`.")}var w=String(e);"production"!==o.env.NODE_ENV?b(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===w?"object with keys {"+Object.keys(e).join(", ")+"}":w,D):b(!1)}}return _}function i(e,t,o){return null==e?0:l(e,"",t,o)}var c=e("./ReactCurrentOwner"),d=e("./ReactElement"),u=e("./ReactInstanceHandles"),p=e("./getIteratorFn"),b=e("fbjs/lib/invariant"),m=e("fbjs/lib/warning"),f=u.SEPARATOR,h=":",v={"=":"=0",".":"=1",":":"=2"},_=/[=.:]/g,g=!1;t.exports=i}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceHandles.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getIteratorFn.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/update.js":[function(e,t,o){(function(o){"use strict";function n(e){return Array.isArray(e)?e.concat():e&&"object"==typeof e?s(new e.constructor,e):e}function r(e,t,n){Array.isArray(e)?void 0:"production"!==o.env.NODE_ENV?i(!1,"update(): expected target of %s to be an array; got %s.",n,e):i(!1);var r=t[n];Array.isArray(r)?void 0:"production"!==o.env.NODE_ENV?i(!1,"update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?",n,r):i(!1)}function a(e,t){if("object"!=typeof t?"production"!==o.env.NODE_ENV?i(!1,"update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?",h.join(", "),b):i(!1):void 0,c.call(t,b))return 1!==Object.keys(t).length?"production"!==o.env.NODE_ENV?i(!1,"Cannot have more than one key in an object with %s",b):i(!1):void 0,t[b];var l=n(e);if(c.call(t,m)){var _=t[m];_&&"object"==typeof _?void 0:"production"!==o.env.NODE_ENV?i(!1,"update(): %s expects a spec of type 'object'; got %s",m,_):i(!1),l&&"object"==typeof l?void 0:"production"!==o.env.NODE_ENV?i(!1,"update(): %s expects a target of type 'object'; got %s",m,l):i(!1),s(l,t[m])}c.call(t,d)&&(r(e,t,d),t[d].forEach(function(e){l.push(e)})),c.call(t,u)&&(r(e,t,u),t[u].forEach(function(e){l.unshift(e)})),c.call(t,p)&&(Array.isArray(e)?void 0:"production"!==o.env.NODE_ENV?i(!1,"Expected %s target to be an array; got %s",p,e):i(!1),Array.isArray(t[p])?void 0:"production"!==o.env.NODE_ENV?i(!1,"update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",p,t[p]):i(!1),t[p].forEach(function(e){Array.isArray(e)?void 0:"production"!==o.env.NODE_ENV?i(!1,"update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",p,t[p]):i(!1),l.splice.apply(l,e)})),c.call(t,f)&&("function"!=typeof t[f]?"production"!==o.env.NODE_ENV?i(!1,"update(): expected spec of %s to be a function; got %s.",f,t[f]):i(!1):void 0,l=t[f](l));for(var g in t)v.hasOwnProperty(g)&&v[g]||(l[g]=a(e[g],t[g]));return l}var s=e("./Object.assign"),l=e("fbjs/lib/keyOf"),i=e("fbjs/lib/invariant"),c={}.hasOwnProperty,d=l({$push:null}),u=l({$unshift:null}),p=l({$splice:null}),b=l({$set:null}),m=l({$merge:null}),f=l({$apply:null}),h=[d,u,p,b,m,f],v={};h.forEach(function(e){v[e]=!0}),t.exports=a}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/validateDOMNesting.js":[function(e,t,o){(function(o){"use strict";var n=e("./Object.assign"),r=e("fbjs/lib/emptyFunction"),a=e("fbjs/lib/warning"),s=r;if("production"!==o.env.NODE_ENV){var l=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],i=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],c=i.concat(["button"]),d=["dd","dt","li","option","optgroup","p","rp","rt"],u={parentTag:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null},p=function(e,t,o){var r=n({},e||u),a={tag:t,instance:o};return-1!==i.indexOf(t)&&(r.aTagInScope=null,r.buttonTagInScope=null,r.nobrTagInScope=null),-1!==c.indexOf(t)&&(r.pTagInButtonScope=null),-1!==l.indexOf(t)&&"address"!==t&&"div"!==t&&"p"!==t&&(r.listItemTagAutoclosing=null,r.dlItemTagAutoclosing=null),r.parentTag=a,"form"===t&&(r.formTag=a),"a"===t&&(r.aTagInScope=a),"button"===t&&(r.buttonTagInScope=a),"nobr"===t&&(r.nobrTagInScope=a),"p"===t&&(r.pTagInButtonScope=a),"li"===t&&(r.listItemTagAutoclosing=a),"dd"!==t&&"dt"!==t||(r.dlItemTagAutoclosing=a),r},b=function(e,t){switch(t){case"select":return"option"===e||"optgroup"===e||"#text"===e;case"optgroup":return"option"===e||"#text"===e;case"option":return"#text"===e;case"tr":return"th"===e||"td"===e||"style"===e||"script"===e||"template"===e;case"tbody":case"thead":case"tfoot":return"tr"===e||"style"===e||"script"===e||"template"===e;case"colgroup":return"col"===e||"template"===e;case"table":return"caption"===e||"colgroup"===e||"tbody"===e||"tfoot"===e||"thead"===e||"style"===e||"script"===e||"template"===e;case"head":return"base"===e||"basefont"===e||"bgsound"===e||"link"===e||"meta"===e||"title"===e||"noscript"===e||"noframes"===e||"style"===e||"script"===e||"template"===e;case"html":return"head"===e||"body"===e}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t;case"rp":case"rt":return-1===d.indexOf(t);case"caption":case"col":case"colgroup":case"frame":case"head":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return null==t}return!0},m=function(e,t){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t.pTagInButtonScope;case"form":return t.formTag||t.pTagInButtonScope;case"li":return t.listItemTagAutoclosing;case"dd":case"dt":return t.dlItemTagAutoclosing;case"button":return t.buttonTagInScope;case"a":return t.aTagInScope;case"nobr":return t.nobrTagInScope}return null},f=function(e){if(!e)return[];var t=[];do t.push(e);while(e=e._currentElement._owner);return t.reverse(),t},h={};s=function(e,t,n){n=n||u;var r=n.parentTag,s=r&&r.tag,l=b(e,s)?null:r,i=l?null:m(e,n),c=l||i;if(c){var d,p=c.tag,v=c.instance,_=t&&t._currentElement._owner,g=v&&v._currentElement._owner,N=f(_),y=f(g),E=Math.min(N.length,y.length),j=-1;for(d=0;E>d&&N[d]===y[d];d++)j=d;var C="(unknown)",R=N.slice(j+1).map(function(e){return e.getName()||C}),O=y.slice(j+1).map(function(e){return e.getName()||C}),D=[].concat(-1!==j?N[j].getName()||C:[],O,p,i?["..."]:[],R,e).join(" > "),U=!!l+"|"+e+"|"+p+"|"+D;if(h[U])return;if(h[U]=!0,l){var w="";"table"===p&&"tr"===e&&(w+=" Add a <tbody> to your code to match the DOM tree generated by the browser."),"production"!==o.env.NODE_ENV?a(!1,"validateDOMNesting(...): <%s> cannot appear as a child of <%s>. See %s.%s",e,p,D,w):void 0}else"production"!==o.env.NODE_ENV?a(!1,"validateDOMNesting(...): <%s> cannot appear as a descendant of <%s>. See %s.",e,p,D):void 0}},s.ancestorInfoContextKey="__validateDOMNesting_ancestorInfo$"+Math.random().toString(36).slice(2),s.updatedAncestorInfo=p,s.isTagValidInContext=function(e,t){t=t||u;var o=t.parentTag,n=o&&o.tag;return b(e,n)&&!m(e,t)}}t.exports=s}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/react.js":[function(e,t,o){"use strict";t.exports=e("./lib/React")},{"./lib/React":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/React.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusUtils.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/AutoFocusUtils.js"][0].apply(o,arguments)},{"./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js","fbjs/lib/focusNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/focusNode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/BeforeInputEventPlugin.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/BeforeInputEventPlugin.js"][0].apply(o,arguments)},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./FallbackCompositionState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/FallbackCompositionState.js","./SyntheticCompositionEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticCompositionEvent.js","./SyntheticInputEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticInputEvent.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSProperty.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/CSSProperty.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js":[function(e,t,o){(function(o){"use strict";var n=e("./CSSProperty"),r=e("fbjs/lib/ExecutionEnvironment"),a=e("./ReactPerf"),s=e("fbjs/lib/camelizeStyleName"),l=e("./dangerousStyleValue"),i=e("fbjs/lib/hyphenateStyleName"),c=e("fbjs/lib/memoizeStringOnly"),d=e("fbjs/lib/warning"),u=c(function(e){return i(e)}),p=!1,b="cssFloat";if(r.canUseDOM){var m=document.createElement("div").style;try{m.font=""}catch(f){p=!0}void 0===document.documentElement.style.cssFloat&&(b="styleFloat")}if("production"!==o.env.NODE_ENV)var h=/^(?:webkit|moz|o)[A-Z]/,v=/;\s*$/,_={},g={},N=function(e){_.hasOwnProperty(e)&&_[e]||(_[e]=!0,"production"!==o.env.NODE_ENV?d(!1,"Unsupported style property %s. Did you mean %s?",e,s(e)):void 0)},y=function(e){_.hasOwnProperty(e)&&_[e]||(_[e]=!0,"production"!==o.env.NODE_ENV?d(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):void 0)},E=function(e,t){g.hasOwnProperty(t)&&g[t]||(g[t]=!0,"production"!==o.env.NODE_ENV?d(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,t.replace(v,"")):void 0)},j=function(e,t){e.indexOf("-")>-1?N(e):h.test(e)?y(e):v.test(t)&&E(e,t)};var C={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"production"!==o.env.NODE_ENV&&j(n,r),null!=r&&(t+=u(n)+":",t+=l(n,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var a in t)if(t.hasOwnProperty(a)){"production"!==o.env.NODE_ENV&&j(a,t[a]);var s=l(a,t[a]);if("float"===a&&(a=b),s)r[a]=s;else{var i=p&&n.shorthandPropertyExpansions[a];if(i)for(var c in i)r[c]="";else r[a]=""}}}};a.measureMethods(C,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),t.exports=C}).call(this,e("_process"))},{"./CSSProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSProperty.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./dangerousStyleValue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/dangerousStyleValue.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/camelizeStyleName":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/camelizeStyleName.js","fbjs/lib/hyphenateStyleName":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/hyphenateStyleName.js","fbjs/lib/memoizeStringOnly":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/memoizeStringOnly.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js":[function(e,t,o){(function(o){"use strict";function n(){this._callbacks=null,this._contexts=null}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("fbjs/lib/invariant");a(n.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){e.length!==t.length?"production"!==o.env.NODE_ENV?s(!1,"Mismatched list of contexts in callback queue"):s(!1):void 0,this._callbacks=null,this._contexts=null;for(var n=0;n<e.length;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ChangeEventPlugin.js":[function(e,t,o){"use strict";function n(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function r(e){var t=j.getPooled(w.change,M,e,C(e));N.accumulateTwoPhaseDispatches(t),E.batchedUpdates(a,t)}function a(e){g.enqueueEvents(e),g.processEventQueue(!1)}function s(e,t){P=e,M=t,P.attachEvent("onchange",r)}function l(){P&&(P.detachEvent("onchange",r),P=null,M=null)}function i(e,t,o){return e===U.topChange?o:void 0}function c(e,t,o){e===U.topFocus?(l(),s(t,o)):e===U.topBlur&&l()}function d(e,t){P=e,M=t,S=e.value,T=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(P,"value",k),P.attachEvent("onpropertychange",p)}function u(){P&&(delete P.value,P.detachEvent("onpropertychange",p),P=null,M=null,S=null,T=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==S&&(S=t,r(e))}}function b(e,t,o){return e===U.topInput?o:void 0}function m(e,t,o){e===U.topFocus?(u(),d(t,o)):e===U.topBlur&&u()}function f(e,t,o){return e!==U.topSelectionChange&&e!==U.topKeyUp&&e!==U.topKeyDown||!P||P.value===S?void 0:(S=P.value,M)}function h(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,o){return e===U.topClick?o:void 0}var _=e("./EventConstants"),g=e("./EventPluginHub"),N=e("./EventPropagators"),y=e("fbjs/lib/ExecutionEnvironment"),E=e("./ReactUpdates"),j=e("./SyntheticEvent"),C=e("./getEventTarget"),R=e("./isEventSupported"),O=e("./isTextInputElement"),D=e("fbjs/lib/keyOf"),U=_.topLevelTypes,w={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})},dependencies:[U.topBlur,U.topChange,U.topClick,U.topFocus,U.topInput,U.topKeyDown,U.topKeyUp,U.topSelectionChange]}},P=null,M=null,S=null,T=null,I=!1;y.canUseDOM&&(I=R("change")&&(!("documentMode"in document)||document.documentMode>8));var x=!1;y.canUseDOM&&(x=R("input")&&(!("documentMode"in document)||document.documentMode>9));var k={get:function(){return T.get.call(this)},set:function(e){S=""+e,T.set.call(this,e)}},V={eventTypes:w,extractEvents:function(e,t,o,r,a){var s,l;if(n(t)?I?s=i:l=c:O(t)?x?s=b:(s=f,l=m):h(t)&&(s=v),s){var d=s(e,t,o);if(d){var u=j.getPooled(w.change,d,r,a);return u.type="change",N.accumulateTwoPhaseDispatches(u),u}}l&&l(e,t,o)}};t.exports=V},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ClientReactRootIndex.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ClientReactRootIndex.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){var n=o>=e.childNodes.length?null:e.childNodes.item(o);e.insertBefore(t,n)}var r=e("./Danger"),a=e("./ReactMultiChildUpdateTypes"),s=e("./ReactPerf"),l=e("./setInnerHTML"),i=e("./setTextContent"),c=e("fbjs/lib/invariant"),d={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,updateTextContent:i,processUpdates:function(e,t){for(var s,d=null,u=null,p=0;p<e.length;p++)if(s=e[p],s.type===a.MOVE_EXISTING||s.type===a.REMOVE_NODE){var b=s.fromIndex,m=s.parentNode.childNodes[b],f=s.parentID;m?void 0:"production"!==o.env.NODE_ENV?c(!1,"processUpdates(): Unable to find child %s of element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",b,f):c(!1),d=d||{},d[f]=d[f]||[],d[f][b]=m,u=u||[],u.push(m)}var h;if(h=t.length&&"string"==typeof t[0]?r.dangerouslyRenderMarkup(t):t,u)for(var v=0;v<u.length;v++)u[v].parentNode.removeChild(u[v]);for(var _=0;_<e.length;_++)switch(s=e[_],s.type){case a.INSERT_MARKUP:n(s.parentNode,h[s.markupIndex],s.toIndex);break;case a.MOVE_EXISTING:n(s.parentNode,d[s.parentID][s.fromIndex],s.toIndex);break;case a.SET_MARKUP:l(s.parentNode,s.content);break;case a.TEXT_CONTENT:i(s.parentNode,s.content);break;case a.REMOVE_NODE:}}};s.measureMethods(d,"DOMChildrenOperations",{updateTextContent:"updateTextContent"}),t.exports=d}).call(this,e("_process"))},{"./Danger":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js","./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setTextContent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js":[function(e,t,o){(function(o){"use strict";function n(e,t){return(e&t)===t}var r=e("fbjs/lib/invariant"),a={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=a,s=e.Properties||{},i=e.DOMAttributeNamespaces||{},c=e.DOMAttributeNames||{},d=e.DOMPropertyNames||{},u=e.DOMMutationMethods||{};e.isCustomAttribute&&l._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in s){l.properties.hasOwnProperty(p)?"production"!==o.env.NODE_ENV?r(!1,"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",p):r(!1):void 0;var b=p.toLowerCase(),m=s[p],f={attributeName:b,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseAttribute:n(m,t.MUST_USE_ATTRIBUTE),mustUseProperty:n(m,t.MUST_USE_PROPERTY),hasSideEffects:n(m,t.HAS_SIDE_EFFECTS),hasBooleanValue:n(m,t.HAS_BOOLEAN_VALUE),hasNumericValue:n(m,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:n(m,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:n(m,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(f.mustUseAttribute&&f.mustUseProperty?"production"!==o.env.NODE_ENV?r(!1,"DOMProperty: Cannot require using both attribute and property: %s",p):r(!1):void 0,!f.mustUseProperty&&f.hasSideEffects?"production"!==o.env.NODE_ENV?r(!1,"DOMProperty: Properties that have side effects must use property: %s",p):r(!1):void 0,f.hasBooleanValue+f.hasNumericValue+f.hasOverloadedBooleanValue<=1?void 0:"production"!==o.env.NODE_ENV?r(!1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",p):r(!1),"production"!==o.env.NODE_ENV&&(l.getPossibleStandardName[b]=p),c.hasOwnProperty(p)){var h=c[p];f.attributeName=h,"production"!==o.env.NODE_ENV&&(l.getPossibleStandardName[h]=p)}i.hasOwnProperty(p)&&(f.attributeNamespace=i[p]),d.hasOwnProperty(p)&&(f.propertyName=d[p]),u.hasOwnProperty(p)&&(f.mutationMethod=u[p]),l.properties[p]=f}}},s={},l={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:"production"!==o.env.NODE_ENV?{}:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<l._isCustomAttributeFunctions.length;t++){var o=l._isCustomAttributeFunctions[t];if(o(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var o,n=s[e];return n||(s[e]=n={}),t in n||(o=document.createElement(e),n[t]=o[t]),n[t]},injection:a};t.exports=l}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js":[function(e,t,o){(function(o){"use strict";function n(e){return u.hasOwnProperty(e)?!0:d.hasOwnProperty(e)?!1:c.test(e)?(u[e]=!0,!0):(d[e]=!0,"production"!==o.env.NODE_ENV?i(!1,"Invalid attribute name: `%s`",e):void 0,!1)}function r(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&1>t||e.hasOverloadedBooleanValue&&t===!1}var a=e("./DOMProperty"),s=e("./ReactPerf"),l=e("./quoteAttributeValueForBrowser"),i=e("fbjs/lib/warning"),c=/^[a-zA-Z_][\w\.\-]*$/,d={},u={};if("production"!==o.env.NODE_ENV)var p={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},b={},m=function(e){if(!(p.hasOwnProperty(e)&&p[e]||b.hasOwnProperty(e)&&b[e])){b[e]=!0;var t=e.toLowerCase(),n=a.isCustomAttribute(t)?t:a.getPossibleStandardName.hasOwnProperty(t)?a.getPossibleStandardName[t]:null;"production"!==o.env.NODE_ENV?i(null==n,"Unknown DOM property %s. Did you mean %s?",e,n):void 0}};var f={createMarkupForID:function(e){return a.ID_ATTRIBUTE_NAME+"="+l(e)},setAttributeForID:function(e,t){e.setAttribute(a.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=a.properties.hasOwnProperty(e)?a.properties[e]:null;if(n){if(r(n,t))return"";var s=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?s+'=""':s+"="+l(t)}return a.isCustomAttribute(e)?null==t?"":e+"="+l(t):("production"!==o.env.NODE_ENV&&m(e),null)},createMarkupForCustomAttribute:function(e,t){return n(e)&&null!=t?e+"="+l(t):""},setValueForProperty:function(e,t,n){var s=a.properties.hasOwnProperty(t)?a.properties[t]:null;if(s){var l=s.mutationMethod;if(l)l(e,n);else if(r(s,n))this.deleteValueForProperty(e,t);else if(s.mustUseAttribute){var i=s.attributeName,c=s.attributeNamespace; c?e.setAttributeNS(c,i,""+n):s.hasBooleanValue||s.hasOverloadedBooleanValue&&n===!0?e.setAttribute(i,""):e.setAttribute(i,""+n)}else{var d=s.propertyName;s.hasSideEffects&&""+e[d]==""+n||(e[d]=n)}}else a.isCustomAttribute(t)?f.setValueForAttribute(e,t,n):"production"!==o.env.NODE_ENV&&m(t)},setValueForAttribute:function(e,t,o){n(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){var n=a.properties.hasOwnProperty(t)?a.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var s=n.propertyName,l=a.getDefaultValueForProperty(e.nodeName,s);n.hasSideEffects&&""+e[s]===l||(e[s]=l)}}else a.isCustomAttribute(t)?e.removeAttribute(t):"production"!==o.env.NODE_ENV&&m(t)}};s.measureMethods(f,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),t.exports=f}).call(this,e("_process"))},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./quoteAttributeValueForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/quoteAttributeValueForBrowser.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Danger.js":[function(e,t,o){(function(o){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e("fbjs/lib/ExecutionEnvironment"),a=e("fbjs/lib/createNodesFromMarkup"),s=e("fbjs/lib/emptyFunction"),l=e("fbjs/lib/getMarkupWrap"),i=e("fbjs/lib/invariant"),c=/^(<[^ \/>]+)/,d="data-danger-index",u={dangerouslyRenderMarkup:function(e){r.canUseDOM?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString for server rendering."):i(!1);for(var t,u={},p=0;p<e.length;p++)e[p]?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyRenderMarkup(...): Missing markup."):i(!1),t=n(e[p]),t=l(t)?t:"*",u[t]=u[t]||[],u[t][p]=e[p];var b=[],m=0;for(t in u)if(u.hasOwnProperty(t)){var f,h=u[t];for(f in h)if(h.hasOwnProperty(f)){var v=h[f];h[f]=v.replace(c,"$1 "+d+'="'+f+'" ')}for(var _=a(h.join(""),s),g=0;g<_.length;++g){var N=_[g];N.hasAttribute&&N.hasAttribute(d)?(f=+N.getAttribute(d),N.removeAttribute(d),b.hasOwnProperty(f)?"production"!==o.env.NODE_ENV?i(!1,"Danger: Assigning to an already-occupied result index."):i(!1):void 0,b[f]=N,m+=1):"production"!==o.env.NODE_ENV&&console.error("Danger: Discarding unexpected node:",N)}}return m!==b.length?"production"!==o.env.NODE_ENV?i(!1,"Danger: Did not assign to every index of resultList."):i(!1):void 0,b.length!==e.length?"production"!==o.env.NODE_ENV?i(!1,"Danger: Expected markup to render %s nodes, but rendered %s.",e.length,b.length):i(!1):void 0,b},dangerouslyReplaceNodeWithMarkup:function(e,t){r.canUseDOM?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering."):i(!1),t?void 0:"production"!==o.env.NODE_ENV?i(!1,"dangerouslyReplaceNodeWithMarkup(...): Missing markup."):i(!1),"html"===e.tagName.toLowerCase()?"production"!==o.env.NODE_ENV?i(!1,"dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString()."):i(!1):void 0;var n;n="string"==typeof t?a(t,s)[0]:t,e.parentNode.replaceChild(n,e)}};t.exports=u}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/createNodesFromMarkup":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/createNodesFromMarkup.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/getMarkupWrap":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getMarkupWrap.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DefaultEventPluginOrder.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/DefaultEventPluginOrder.js"][0].apply(o,arguments)},{"fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EnterLeaveEventPlugin.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EnterLeaveEventPlugin.js"][0].apply(o,arguments)},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/EventConstants.js"][0].apply(o,arguments)},{"fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js":[function(e,t,o){(function(o){"use strict";function n(){var e=h&&h.traverseTwoPhase&&h.traverseEnterLeave;"production"!==o.env.NODE_ENV?d(e,"InstanceHandle not injected before use!"):void 0}var r=e("./EventPluginRegistry"),a=e("./EventPluginUtils"),s=e("./ReactErrorUtils"),l=e("./accumulateInto"),i=e("./forEachAccumulated"),c=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),u={},p=null,b=function(e,t){e&&(a.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},m=function(e){return b(e,!0)},f=function(e){return b(e,!1)},h=null,v={injection:{injectMount:a.injection.injectMount,injectInstanceHandle:function(e){h=e,"production"!==o.env.NODE_ENV&&n()},getInstanceHandle:function(){return"production"!==o.env.NODE_ENV&&n(),h},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){"function"!=typeof n?"production"!==o.env.NODE_ENV?c(!1,"Expected %s listener to be a function, instead got type %s",t,typeof n):c(!1):void 0;var a=u[t]||(u[t]={});a[e]=n;var s=r.registrationNameModules[t];s&&s.didPutListener&&s.didPutListener(e,t,n)},getListener:function(e,t){var o=u[t];return o&&o[e]},deleteListener:function(e,t){var o=r.registrationNameModules[t];o&&o.willDeleteListener&&o.willDeleteListener(e,t);var n=u[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in u)if(u[t][e]){var o=r.registrationNameModules[t];o&&o.willDeleteListener&&o.willDeleteListener(e,t),delete u[t][e]}},extractEvents:function(e,t,o,n,a){for(var s,i=r.plugins,c=0;c<i.length;c++){var d=i[c];if(d){var u=d.extractEvents(e,t,o,n,a);u&&(s=l(s,u))}}return s},enqueueEvents:function(e){e&&(p=l(p,e))},processEventQueue:function(e){var t=p;p=null,e?i(t,m):i(t,f),p?"production"!==o.env.NODE_ENV?c(!1,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):c(!1):void 0,s.rethrowCaughtError()},__purge:function(){u={}},__getListenerBank:function(){return u}};t.exports=v}).call(this,e("_process"))},{"./EventPluginRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js","./EventPluginUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./ReactErrorUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js":[function(e,t,o){(function(o){"use strict";function n(){if(l)for(var e in i){var t=i[e],n=l.indexOf(e);if(n>-1?void 0:"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):s(!1),!c.plugins[n]){t.extractEvents?void 0:"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):s(!1),c.plugins[n]=t;var a=t.eventTypes;for(var d in a)r(a[d],t,d)?void 0:"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",d,e):s(!1)}}}function r(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)?"production"!==o.env.NODE_ENV?s(!1,"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",n):s(!1):void 0,c.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var l in r)if(r.hasOwnProperty(l)){var i=r[l];a(i,t,n)}return!0}return e.registrationName?(a(e.registrationName,t,n),!0):!1}function a(e,t,n){c.registrationNameModules[e]?"production"!==o.env.NODE_ENV?s(!1,"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):s(!1):void 0,c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var s=e("fbjs/lib/invariant"),l=null,i={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){l?"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):s(!1):void 0,l=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];i.hasOwnProperty(r)&&i[r]===a||(i[r]?"production"!==o.env.NODE_ENV?s(!1,"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",r):s(!1):void 0,i[r]=a,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;for(var o in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(o)){var n=c.registrationNameModules[t.phasedRegistrationNames[o]];if(n)return n}return null},_resetEventPlugins:function(){l=null;for(var e in i)i.hasOwnProperty(e)&&delete i[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var o in t)t.hasOwnProperty(o)&&delete t[o];var n=c.registrationNameModules;for(var r in n)n.hasOwnProperty(r)&&delete n[r]}};t.exports=c}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js":[function(e,t,o){(function(o){"use strict";function n(e){return e===_.topMouseUp||e===_.topTouchEnd||e===_.topTouchCancel}function r(e){return e===_.topMouseMove||e===_.topTouchMove}function a(e){return e===_.topMouseDown||e===_.topTouchStart}function s(e,t,o,n){var r=e.type||"unknown-event";e.currentTarget=v.Mount.getNode(n),t?m.invokeGuardedCallbackWithCatch(r,o,e,n):m.invokeGuardedCallback(r,o,e,n),e.currentTarget=null}function l(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if("production"!==o.env.NODE_ENV&&p(e),Array.isArray(n))for(var a=0;a<n.length&&!e.isPropagationStopped();a++)s(e,t,n[a],r[a]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchIDs=null}function i(e){var t=e._dispatchListeners,n=e._dispatchIDs;if("production"!==o.env.NODE_ENV&&p(e),Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function c(e){var t=i(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function d(e){"production"!==o.env.NODE_ENV&&p(e);var t=e._dispatchListeners,n=e._dispatchIDs;Array.isArray(t)?"production"!==o.env.NODE_ENV?f(!1,"executeDirectDispatch(...): Invalid `event`."):f(!1):void 0;var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function u(e){return!!e._dispatchListeners}var p,b=e("./EventConstants"),m=e("./ReactErrorUtils"),f=e("fbjs/lib/invariant"),h=e("fbjs/lib/warning"),v={Mount:null,injectMount:function(e){v.Mount=e,"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?h(e&&e.getNode&&e.getID,"EventPluginUtils.injection.injectMount(...): Injected Mount module is missing getNode or getID."):void 0)}},_=b.topLevelTypes;"production"!==o.env.NODE_ENV&&(p=function(e){var t=e._dispatchListeners,n=e._dispatchIDs,r=Array.isArray(t),a=Array.isArray(n),s=a?n.length:n?1:0,l=r?t.length:t?1:0;"production"!==o.env.NODE_ENV?h(a===r&&s===l,"EventPluginUtils: Invalid `event`."):void 0});var g={isEndish:n,isMoveish:r,isStartish:a,executeDirectDispatch:d,executeDispatchesInOrder:l,executeDispatchesInOrderStopAtTrue:c,hasDispatches:u,getNode:function(e){return v.Mount.getNode(e)},getID:function(e){return v.Mount.getID(e)},injection:v};t.exports=g}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./ReactErrorUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){var n=t.dispatchConfig.phasedRegistrationNames[o];return g(e,n)}function r(e,t,r){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?f(e,"Dispatching id must not be null"):void 0);var a=t?_.bubbled:_.captured,s=n(e,r,a);s&&(r._dispatchListeners=h(r._dispatchListeners,s),r._dispatchIDs=h(r._dispatchIDs,e))}function a(e){e&&e.dispatchConfig.phasedRegistrationNames&&m.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,r,e)}function s(e){e&&e.dispatchConfig.phasedRegistrationNames&&m.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(e.dispatchMarker,r,e)}function l(e,t,o){if(o&&o.dispatchConfig.registrationName){var n=o.dispatchConfig.registrationName,r=g(e,n);r&&(o._dispatchListeners=h(o._dispatchListeners,r),o._dispatchIDs=h(o._dispatchIDs,e))}}function i(e){e&&e.dispatchConfig.registrationName&&l(e.dispatchMarker,null,e)}function c(e){v(e,a)}function d(e){v(e,s)}function u(e,t,o,n){m.injection.getInstanceHandle().traverseEnterLeave(o,n,l,e,t)}function p(e){v(e,i)}var b=e("./EventConstants"),m=e("./EventPluginHub"),f=e("fbjs/lib/warning"),h=e("./accumulateInto"),v=e("./forEachAccumulated"),_=b.PropagationPhases,g=m.getListener,N={accumulateTwoPhaseDispatches:c,accumulateTwoPhaseDispatchesSkipTarget:d,accumulateDirectDispatches:p,accumulateEnterLeaveDispatches:u};t.exports=N}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./accumulateInto":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/FallbackCompositionState.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/FallbackCompositionState.js"][0].apply(o,arguments)},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./getTextContentAccessor":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/HTMLDOMPropertyConfig.js":[function(e,t,o){"use strict";var n,r=e("./DOMProperty"),a=e("fbjs/lib/ExecutionEnvironment"),s=r.injection.MUST_USE_ATTRIBUTE,l=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,c=r.injection.HAS_SIDE_EFFECTS,d=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,p=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(a.canUseDOM){var b=document.implementation;n=b&&b.hasFeature&&b.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var m={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:s|i,allowTransparency:s,alt:null,async:i,autoComplete:null,autoPlay:i,capture:s|i,cellPadding:null,cellSpacing:null,charSet:s,challenge:s,checked:l|i,classID:s,className:n?s:l,cols:s|u,colSpan:null,content:null,contentEditable:null,contextMenu:s,controls:l|i,coords:null,crossOrigin:null,data:null,dateTime:s,defer:i,dir:null,disabled:s|i,download:p,draggable:null,encType:null,form:s,formAction:s,formEncType:s,formMethod:s,formNoValidate:i,formTarget:s,frameBorder:s,headers:null,height:s,hidden:s|i,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:l,inputMode:s,is:s,keyParams:s,keyType:s,label:null,lang:null,list:s,loop:l|i,low:null,manifest:s,marginHeight:null,marginWidth:null,max:null,maxLength:s,media:s,mediaGroup:null,method:null,min:null,minLength:s,multiple:l|i,muted:l|i,name:null,noValidate:i,open:i,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:l|i,rel:null,required:i,role:s,rows:s|u,rowSpan:null,sandbox:null,scope:null,scoped:i,scrolling:null,seamless:s|i,selected:l|i,shape:null,size:s|u,sizes:s,span:u,spellCheck:null,src:null,srcDoc:l,srcSet:s,start:d,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:l|c,width:s,wmode:s,wrap:null,about:s,datatype:s,inlist:s,prefix:s,property:s,resource:s,"typeof":s,vocab:s,autoCapitalize:null,autoCorrect:null,autoSave:null,itemProp:s,itemScope:s|i,itemType:s,itemID:s,itemRef:s,results:null,security:s,unselectable:s},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=m},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js":[function(e,t,o){(function(o){"use strict";function n(e){null!=e.checkedLink&&null!=e.valueLink?"production"!==o.env.NODE_ENV?c(!1,"Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don't want to use valueLink and vice versa."):c(!1):void 0}function r(e){n(e),null!=e.value||null!=e.onChange?"production"!==o.env.NODE_ENV?c(!1,"Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don't want to use valueLink."):c(!1):void 0}function a(e){n(e),null!=e.checked||null!=e.onChange?"production"!==o.env.NODE_ENV?c(!1,"Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don't want to use checkedLink"):c(!1):void 0}function s(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var l=e("./ReactPropTypes"),i=e("./ReactPropTypeLocations"),c=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),u={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},p={value:function(e,t,o){return!e[t]||u[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,o){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:l.func},b={},m={checkPropTypes:function(e,t,n){for(var r in p){if(p.hasOwnProperty(r))var a=p[r](t,r,e,i.prop);if(a instanceof Error&&!(a.message in b)){b[a.message]=!0;var l=s(n);"production"!==o.env.NODE_ENV?d(!1,"Failed form propType: %s%s",a.message,l):void 0}}},getValue:function(e){return e.valueLink?(r(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(a(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(r(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(a(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=m}).call(this,e("_process"))},{"./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./ReactPropTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/Object.assign.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r=function(e){var t=this;if(t.instancePool.length){var o=t.instancePool.pop();return t.call(o,e),o}return new t(e)},a=function(e,t){var o=this;if(o.instancePool.length){var n=o.instancePool.pop();return o.call(n,e,t),n}return new o(e,t)},s=function(e,t,o){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t,o),r}return new n(e,t,o)},l=function(e,t,o,n){var r=this;if(r.instancePool.length){var a=r.instancePool.pop();return r.call(a,e,t,o,n),a}return new r(e,t,o,n)},i=function(e,t,o,n,r){var a=this;if(a.instancePool.length){var s=a.instancePool.pop();return a.call(s,e,t,o,n,r),s}return new a(e,t,o,n,r)},c=function(e){var t=this;e instanceof t?void 0:"production"!==o.env.NODE_ENV?n(!1,"Trying to release an instance into a pool of a different type."):n(!1),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},d=10,u=r,p=function(e,t){var o=e;return o.instancePool=[],o.getPooled=t||u,o.poolSize||(o.poolSize=d),o.release=c,o},b={addPoolingTo:p,oneArgumentPooler:r,twoArgumentPooler:a,threeArgumentPooler:s,fourArgumentPooler:l,fiveArgumentPooler:i};t.exports=b}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/React.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/React.js"][0].apply(o,arguments)},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactDOM":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOM.js","./ReactDOMServer":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMServer.js","./ReactIsomorphic":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactIsomorphic.js","./deprecated":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/deprecated.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactInstanceMap"),r=e("./findDOMNode"),a=e("fbjs/lib/warning"),s="_getDOMNodeDidWarn",l={getDOMNode:function(){return"production"!==o.env.NODE_ENV?a(this.constructor[s],"%s.getDOMNode(...) is deprecated. Please use ReactDOM.findDOMNode(instance) instead.",n.get(this).getName()||this.tagName||"Unknown"):void 0,this.constructor[s]=!0,r(this)}};t.exports=l}).call(this,e("_process"))},{"./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactBrowserEventEmitter.js"][0].apply(o,arguments)},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./EventPluginRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactEventEmitterMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventEmitterMixin.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ViewportMetrics":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildReconciler.js":[function(e,t,o){(function(o){"use strict";function n(e,t,n){var r=void 0===e[n];"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?i(r,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",n):void 0),null!=t&&r&&(e[n]=a(t,null))}var r=e("./ReactReconciler"),a=e("./instantiateReactComponent"),s=e("./shouldUpdateReactComponent"),l=e("./traverseAllChildren"),i=e("fbjs/lib/warning"),c={instantiateChildren:function(e,t,o){if(null==e)return null;var r={};return l(e,n,r),r},updateChildren:function(e,t,o,n){if(!t&&!e)return null;var l;for(l in t)if(t.hasOwnProperty(l)){var i=e&&e[l],c=i&&i._currentElement,d=t[l];if(null!=i&&s(c,d))r.receiveComponent(i,d,o,n),t[l]=i;else{i&&r.unmountComponent(i,l);var u=a(d,null);t[l]=u}}for(l in e)!e.hasOwnProperty(l)||t&&t.hasOwnProperty(l)||r.unmountComponent(e[l]);return t},unmountChildren:function(e){for(var t in e)if(e.hasOwnProperty(t)){var o=e[t];r.unmountComponent(o)}}};t.exports=c}).call(this,e("_process"))},{"./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js","./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildren.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactChildren.js"][0].apply(o,arguments)},{"./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js":[function(e,t,o){(function(o){"use strict";function n(){D||(D=!0,"production"!==o.env.NODE_ENV?j(!1,"setProps(...) and replaceProps(...) are deprecated. Instead, call render again at the top level."):void 0)}function r(e,t,n){for(var r in t)t.hasOwnProperty(r)&&("production"!==o.env.NODE_ENV?j("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",h[n],r):void 0)}function a(e,t){var n=U.hasOwnProperty(t)?U[t]:null;P.hasOwnProperty(t)&&(n!==R.OVERRIDE_BASE?"production"!==o.env.NODE_ENV?N(!1,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t):N(!1):void 0),e.hasOwnProperty(t)&&(n!==R.DEFINE_MANY&&n!==R.DEFINE_MANY_MERGED?"production"!==o.env.NODE_ENV?N(!1,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t):N(!1):void 0)}function s(e,t){if(t){"function"==typeof t?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: You're attempting to use a component class as a mixin. Instead, just use a regular object."):N(!1):void 0,m.isValidElement(t)?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object."):N(!1):void 0; var n=e.prototype;t.hasOwnProperty(C)&&w.mixins(e,t.mixins);for(var r in t)if(t.hasOwnProperty(r)&&r!==C){var s=t[r];if(a(n,r),w.hasOwnProperty(r))w[r](e,s);else{var l=U.hasOwnProperty(r),i=n.hasOwnProperty(r),u="function"==typeof s,p=u&&!l&&!i&&t.autobind!==!1;if(p)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[r]=s,n[r]=s;else if(i){var b=U[r];!l||b!==R.DEFINE_MANY_MERGED&&b!==R.DEFINE_MANY?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,r):N(!1):void 0,b===R.DEFINE_MANY_MERGED?n[r]=c(n[r],s):b===R.DEFINE_MANY&&(n[r]=d(n[r],s))}else n[r]=s,"production"!==o.env.NODE_ENV&&"function"==typeof s&&t.displayName&&(n[r].displayName=t.displayName+"_"+r)}}}}function l(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var a=n in w;a?"production"!==o.env.NODE_ENV?N(!1,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n):N(!1):void 0;var s=n in e;s?"production"!==o.env.NODE_ENV?N(!1,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n):N(!1):void 0,e[n]=r}}}function i(e,t){e&&t&&"object"==typeof e&&"object"==typeof t?void 0:"production"!==o.env.NODE_ENV?N(!1,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."):N(!1);for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]?"production"!==o.env.NODE_ENV?N(!1,"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n):N(!1):void 0,e[n]=t[n]);return e}function c(e,t){return function(){var o=e.apply(this,arguments),n=t.apply(this,arguments);if(null==o)return n;if(null==n)return o;var r={};return i(r,o),i(r,n),r}}function d(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function u(e,t){var n=t.bind(e);if("production"!==o.env.NODE_ENV){n.__reactBoundContext=e,n.__reactBoundMethod=t,n.__reactBoundArguments=null;var r=e.constructor.displayName,a=n.bind;n.bind=function(s){for(var l=arguments.length,i=Array(l>1?l-1:0),c=1;l>c;c++)i[c-1]=arguments[c];if(s!==e&&null!==s)"production"!==o.env.NODE_ENV?j(!1,"bind(): React component methods may only be bound to the component instance. See %s",r):void 0;else if(!i.length)return"production"!==o.env.NODE_ENV?j(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",r):void 0,n;var d=a.apply(n,arguments);return d.__reactBoundContext=e,d.__reactBoundMethod=t,d.__reactBoundArguments=i,d}}return n}function p(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var o=e.__reactAutoBindMap[t];e[t]=u(e,o)}}var b=e("./ReactComponent"),m=e("./ReactElement"),f=e("./ReactPropTypeLocations"),h=e("./ReactPropTypeLocationNames"),v=e("./ReactNoopUpdateQueue"),_=e("./Object.assign"),g=e("fbjs/lib/emptyObject"),N=e("fbjs/lib/invariant"),y=e("fbjs/lib/keyMirror"),E=e("fbjs/lib/keyOf"),j=e("fbjs/lib/warning"),C=E({mixins:null}),R=y({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),O=[],D=!1,U={mixins:R.DEFINE_MANY,statics:R.DEFINE_MANY,propTypes:R.DEFINE_MANY,contextTypes:R.DEFINE_MANY,childContextTypes:R.DEFINE_MANY,getDefaultProps:R.DEFINE_MANY_MERGED,getInitialState:R.DEFINE_MANY_MERGED,getChildContext:R.DEFINE_MANY_MERGED,render:R.DEFINE_ONCE,componentWillMount:R.DEFINE_MANY,componentDidMount:R.DEFINE_MANY,componentWillReceiveProps:R.DEFINE_MANY,shouldComponentUpdate:R.DEFINE_ONCE,componentWillUpdate:R.DEFINE_MANY,componentDidUpdate:R.DEFINE_MANY,componentWillUnmount:R.DEFINE_MANY,updateComponent:R.OVERRIDE_BASE},w={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var o=0;o<t.length;o++)s(e,t[o])},childContextTypes:function(e,t){"production"!==o.env.NODE_ENV&&r(e,t,f.childContext),e.childContextTypes=_({},e.childContextTypes,t)},contextTypes:function(e,t){"production"!==o.env.NODE_ENV&&r(e,t,f.context),e.contextTypes=_({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=c(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){"production"!==o.env.NODE_ENV&&r(e,t,f.prop),e.propTypes=_({},e.propTypes,t)},statics:function(e,t){l(e,t)},autobind:function(){}},P={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e),t&&this.updater.enqueueCallback(this,t)},isMounted:function(){return this.updater.isMounted(this)},setProps:function(e,t){"production"!==o.env.NODE_ENV&&n(),this.updater.enqueueSetProps(this,e),t&&this.updater.enqueueCallback(this,t)},replaceProps:function(e,t){"production"!==o.env.NODE_ENV&&n(),this.updater.enqueueReplaceProps(this,e),t&&this.updater.enqueueCallback(this,t)}},M=function(){};_(M.prototype,b.prototype,P);var S={createClass:function(e){var t=function(e,n,r){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?j(this instanceof t,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"):void 0),this.__reactAutoBindMap&&p(this),this.props=e,this.context=n,this.refs=g,this.updater=r||v,this.state=null;var a=this.getInitialState?this.getInitialState():null;"production"!==o.env.NODE_ENV&&"undefined"==typeof a&&this.getInitialState._isMockFunction&&(a=null),"object"!=typeof a||Array.isArray(a)?"production"!==o.env.NODE_ENV?N(!1,"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"):N(!1):void 0,this.state=a};t.prototype=new M,t.prototype.constructor=t,O.forEach(s.bind(null,t)),s(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),"production"!==o.env.NODE_ENV&&(t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved={}),t.prototype.getInitialState&&(t.prototype.getInitialState.isReactClassApproved={})),t.prototype.render?void 0:"production"!==o.env.NODE_ENV?N(!1,"createClass(...): Class specification must implement a `render` method."):N(!1),"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?j(!t.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"):void 0,"production"!==o.env.NODE_ENV?j(!t.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component"):void 0);for(var n in U)t.prototype[n]||(t.prototype[n]=null);return t},injection:{injectMixin:function(e){O.push(e)}}};t.exports=S}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponent.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactNoopUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNoopUpdateQueue.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponent.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){this.props=e,this.context=t,this.refs=a,this.updater=o||r}var r=e("./ReactNoopUpdateQueue"),a=e("fbjs/lib/emptyObject"),s=e("fbjs/lib/invariant"),l=e("fbjs/lib/warning");if(n.prototype.isReactComponent={},n.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e?"production"!==o.env.NODE_ENV?s(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."):s(!1):void 0,"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?l(null!=e,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."):void 0),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t)},n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e)},"production"!==o.env.NODE_ENV){var i={getDOMNode:["getDOMNode","Use ReactDOM.findDOMNode(component) instead."],isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceProps:["replaceProps","Instead, call render again at the top level."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."],setProps:["setProps","Instead, call render again at the top level."]},c=function(e,t){try{Object.defineProperty(n.prototype,e,{get:function(){"production"!==o.env.NODE_ENV?l(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1]):void 0}})}catch(r){}};for(var d in i)i.hasOwnProperty(d)&&c(d,i[d])}t.exports=n}).call(this,e("_process"))},{"./ReactNoopUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNoopUpdateQueue.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactComponentBrowserEnvironment.js"][0].apply(o,arguments)},{"./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r=!1,a={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){r?"production"!==o.env.NODE_ENV?n(!1,"ReactCompositeComponent: injectEnvironment() can only be called once."):n(!1):void 0,a.unmountIDFromEnvironment=e.unmountIDFromEnvironment,a.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,a.processChildrenUpdates=e.processChildrenUpdates,r=!0}}};t.exports=a}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCompositeComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){var t=e._currentElement._owner||null;if(t){var o=t.getName();if(o)return" Check the render method of `"+o+"`."}return""}function r(e){}var a=e("./ReactComponentEnvironment"),s=e("./ReactCurrentOwner"),l=e("./ReactElement"),i=e("./ReactInstanceMap"),c=e("./ReactPerf"),d=e("./ReactPropTypeLocations"),u=e("./ReactPropTypeLocationNames"),p=e("./ReactReconciler"),b=e("./ReactUpdateQueue"),m=e("./Object.assign"),f=e("fbjs/lib/emptyObject"),h=e("fbjs/lib/invariant"),v=e("./shouldUpdateReactComponent"),_=e("fbjs/lib/warning");r.prototype.render=function(){var e=i.get(this)._currentElement.type;return e(this.props,this.context,this.updater)};var g=1,N={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=g++,this._rootNodeID=e;var a,c,d=this._processProps(this._currentElement.props),u=this._processContext(n),m=this._currentElement.type,v="prototype"in m;if(v)if("production"!==o.env.NODE_ENV){s.current=this;try{a=new m(d,u,b)}finally{s.current=null}}else a=new m(d,u,b);v&&null!==a&&a!==!1&&!l.isValidElement(a)||(c=a,a=new r(m)),"production"!==o.env.NODE_ENV&&(null==a.render?"production"!==o.env.NODE_ENV?_(!1,"%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`, returned null/false from a stateless component, or tried to render an element whose type is a function that isn't a React component.",m.displayName||m.name||"Component"):void 0:"production"!==o.env.NODE_ENV?_(m.prototype&&m.prototype.isReactComponent||!v||!(a instanceof m),"%s(...): React component classes must extend React.Component.",m.displayName||m.name||"Component"):void 0),a.props=d,a.context=u,a.refs=f,a.updater=b,this._instance=a,i.set(a,this),"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?_(!a.getInitialState||a.getInitialState.isReactClassApproved,"getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_(!a.getDefaultProps||a.getDefaultProps.isReactClassApproved,"getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_(!a.propTypes,"propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_(!a.contextTypes,"contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",this.getName()||"a component"):void 0,"production"!==o.env.NODE_ENV?_("function"!=typeof a.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",this.getName()||"A component"):void 0,"production"!==o.env.NODE_ENV?_("function"!=typeof a.componentDidUnmount,"%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",this.getName()||"A component"):void 0,"production"!==o.env.NODE_ENV?_("function"!=typeof a.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",this.getName()||"A component"):void 0);var N=a.state;void 0===N&&(a.state=N=null),"object"!=typeof N||Array.isArray(N)?"production"!==o.env.NODE_ENV?h(!1,"%s.state: must be set to an object or null",this.getName()||"ReactCompositeComponent"):h(!1):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,a.componentWillMount&&(a.componentWillMount(),this._pendingStateQueue&&(a.state=this._processPendingState(a.props,a.context))),void 0===c&&(c=this._renderValidatedComponent()),this._renderedComponent=this._instantiateReactComponent(c);var y=p.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return a.componentDidMount&&t.getReactMountReady().enqueue(a.componentDidMount,a),y},unmountComponent:function(){var e=this._instance;e.componentWillUnmount&&e.componentWillUnmount(),p.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._instance=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,this._topLevelWrapper=null,i.remove(e)},_maskContext:function(e){var t=null,o=this._currentElement.type,n=o.contextTypes;if(!n)return f;t={};for(var r in n)t[r]=e[r];return t},_processContext:function(e){var t=this._maskContext(e);if("production"!==o.env.NODE_ENV){var n=this._currentElement.type;n.contextTypes&&this._checkPropTypes(n.contextTypes,t,d.context)}return t},_processChildContext:function(e){var t=this._currentElement.type,n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"object"!=typeof t.childContextTypes?"production"!==o.env.NODE_ENV?h(!1,"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",this.getName()||"ReactCompositeComponent"):h(!1):void 0,"production"!==o.env.NODE_ENV&&this._checkPropTypes(t.childContextTypes,r,d.childContext);for(var a in r)a in t.childContextTypes?void 0:"production"!==o.env.NODE_ENV?h(!1,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',this.getName()||"ReactCompositeComponent",a):h(!1);return m({},e,r)}return e},_processProps:function(e){if("production"!==o.env.NODE_ENV){var t=this._currentElement.type;t.propTypes&&this._checkPropTypes(t.propTypes,e,d.prop)}return e},_checkPropTypes:function(e,t,r){var a=this.getName();for(var s in e)if(e.hasOwnProperty(s)){var l;try{"function"!=typeof e[s]?"production"!==o.env.NODE_ENV?h(!1,"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",a||"React class",u[r],s):h(!1):void 0,l=e[s](t,s,a,r)}catch(i){l=i}if(l instanceof Error){var c=n(this);r===d.prop?"production"!==o.env.NODE_ENV?_(!1,"Failed Composite propType: %s%s",l.message,c):void 0:"production"!==o.env.NODE_ENV?_(!1,"Failed Context Types: %s%s",l.message,c):void 0}}},receiveComponent:function(e,t,o){var n=this._currentElement,r=this._context;this._pendingElement=null,this.updateComponent(t,n,e,r,o)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&p.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},updateComponent:function(e,t,n,r,a){var s,l=this._instance,i=this._context===a?l.context:this._processContext(a);t===n?s=n.props:(s=this._processProps(n.props),l.componentWillReceiveProps&&l.componentWillReceiveProps(s,i));var c=this._processPendingState(s,i),d=this._pendingForceUpdate||!l.shouldComponentUpdate||l.shouldComponentUpdate(s,c,i);"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?_("undefined"!=typeof d,"%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",this.getName()||"ReactCompositeComponent"):void 0),d?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,s,c,i,e,a)):(this._currentElement=n,this._context=a,l.props=s,l.state=c,l.context=i)},_processPendingState:function(e,t){var o=this._instance,n=this._pendingStateQueue,r=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!n)return o.state;if(r&&1===n.length)return n[0];for(var a=m({},r?n[0]:o.state),s=r?1:0;s<n.length;s++){var l=n[s];m(a,"function"==typeof l?l.call(o,a,e,t):l)}return a},_performComponentUpdate:function(e,t,o,n,r,a){var s,l,i,c=this._instance,d=Boolean(c.componentDidUpdate);d&&(s=c.props,l=c.state,i=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,o,n),this._currentElement=e,this._context=a,c.props=t,c.state=o,c.context=n,this._updateRenderedComponent(r,a),d&&r.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,s,l,i),c)},_updateRenderedComponent:function(e,t){var o=this._renderedComponent,n=o._currentElement,r=this._renderValidatedComponent();if(v(n,r))p.receiveComponent(o,r,e,this._processChildContext(t));else{var a=this._rootNodeID,s=o._rootNodeID;p.unmountComponent(o),this._renderedComponent=this._instantiateReactComponent(r);var l=p.mountComponent(this._renderedComponent,a,e,this._processChildContext(t));this._replaceNodeWithMarkupByID(s,l)}},_replaceNodeWithMarkupByID:function(e,t){a.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return"production"!==o.env.NODE_ENV&&"undefined"==typeof t&&e.render._isMockFunction&&(t=null),t},_renderValidatedComponent:function(){var e;s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{s.current=null}return null===e||e===!1||l.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?h(!1,"%s.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.",this.getName()||"ReactCompositeComponent"):h(!1),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n?"production"!==o.env.NODE_ENV?h(!1,"Stateless function components cannot have refs."):h(!1):void 0;var r=t.getPublicInstance();if("production"!==o.env.NODE_ENV){var a=t&&t.getName?t.getName():"a component";"production"!==o.env.NODE_ENV?_(null!=r,'Stateless function components cannot be given refs (See ref "%s" in %s created by %s). Attempts to access this ref will fail.',e,a,this.getName()):void 0}var s=n.refs===f?n.refs={}:n.refs;s[e]=r},detachRef:function(e){var t=this.getPublicInstance().refs;delete t[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return e instanceof r?null:e},_instantiateReactComponent:null};c.measureMethods(N,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var y={Mixin:N};t.exports=y}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactCurrentOwner.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOM.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactCurrentOwner"),r=e("./ReactDOMTextComponent"),a=e("./ReactDefaultInjection"),s=e("./ReactInstanceHandles"),l=e("./ReactMount"),i=e("./ReactPerf"),c=e("./ReactReconciler"),d=e("./ReactUpdates"),u=e("./ReactVersion"),p=e("./findDOMNode"),b=e("./renderSubtreeIntoContainer"),m=e("fbjs/lib/warning");a.inject();var f=i.measure("React","render",l.render),h={findDOMNode:p,render:f,unmountComponentAtNode:l.unmountComponentAtNode,version:u,unstable_batchedUpdates:d.batchedUpdates,unstable_renderSubtreeIntoContainer:b};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:n,InstanceHandles:s,Mount:l,Reconciler:c,TextComponent:r}),"production"!==o.env.NODE_ENV){var v=e("fbjs/lib/ExecutionEnvironment");if(v.canUseDOM&&window.top===window.self){"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&(navigator.userAgent.indexOf("Chrome")>-1&&-1===navigator.userAgent.indexOf("Edge")||navigator.userAgent.indexOf("Firefox")>-1)&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");var _=document.documentMode&&document.documentMode<8;"production"!==o.env.NODE_ENV?m(!_,'Internet Explorer is running in compatibility mode; please add the following tag to your HTML to prevent this from happening: <meta http-equiv="X-UA-Compatible" content="IE=edge" />'):void 0;for(var g=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze],N=0;N<g.length;N++)if(!g[N]){console.error("One or more ES5 shim/shams expected by React are not available: https://fb.me/react-warning-polyfills");break}}}t.exports=h}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOMTextComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDefaultInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./ReactVersion":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactVersion.js","./findDOMNode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js","./renderSubtreeIntoContainer":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/renderSubtreeIntoContainer.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMButton.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMButton.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){if(e){var t=e._currentElement._owner||null;if(t){var o=t.getName();if(o)return" This DOM node was rendered by `"+o+"`."}}return""}function r(){if("production"!==o.env.NODE_ENV){var e=this._reactInternalComponent;"production"!==o.env.NODE_ENV?z(!1,"ReactDOMComponent: Do not access .getDOMNode() of a DOM node; instead, use the node directly.%s",n(e)):void 0}return this}function a(){var e=this._reactInternalComponent;return"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?z(!1,"ReactDOMComponent: Do not access .isMounted() of a DOM node.%s",n(e)):void 0),!!e}function s(){if("production"!==o.env.NODE_ENV){var e=this._reactInternalComponent;"production"!==o.env.NODE_ENV?z(!1,"ReactDOMComponent: Do not access .setState(), .replaceState(), or .forceUpdate() of a DOM node. This is a no-op.%s",n(e)):void 0}}function l(e,t){var r=this._reactInternalComponent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?z(!1,"ReactDOMComponent: Do not access .setProps() of a DOM node. Instead, call ReactDOM.render again at the top level.%s",n(r)):void 0),r&&(k.enqueueSetPropsInternal(r,e),t&&k.enqueueCallbackInternal(r,t))}function i(e,t){var r=this._reactInternalComponent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?z(!1,"ReactDOMComponent: Do not access .replaceProps() of a DOM node. Instead, call ReactDOM.render again at the top level.%s",n(r)):void 0),r&&(k.enqueueReplacePropsInternal(r,e),t&&k.enqueueCallbackInternal(r,t))}function c(e){if("object"==typeof e){if(Array.isArray(e))return"["+e.map(c).join(", ")+"]";var t=[];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=/^[a-z$_][\w$_]*$/i.test(o)?o:JSON.stringify(o);t.push(n+": "+c(e[o]))}return"{"+t.join(", ")+"}"}return"string"==typeof e?JSON.stringify(e):"function"==typeof e?"[function object]":String(e)}function d(e,t,n){if(null!=e&&null!=t&&!q(e,t)){var r,a=n._tag,s=n._currentElement._owner;s&&(r=s.getName());var l=r+"|"+a;oe.hasOwnProperty(l)||(oe[l]=!0,"production"!==o.env.NODE_ENV?z(!1,"`%s` was passed a style object that has previously been mutated. Mutating `style` is deprecated. Consider cloning it beforehand. Check the `render` %s. Previous style: %s. Mutated style: %s.",a,s?"of `"+r+"`":"using <"+a+">",c(e),c(t)):void 0)}}function u(e,t){t&&("production"!==o.env.NODE_ENV&&se[e._tag]&&("production"!==o.env.NODE_ENV?z(null==t.children&&null==t.dangerouslySetInnerHTML,"%s is a void element tag and must not have `children` or use `props.dangerouslySetInnerHTML`.%s",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""):void 0),null!=t.dangerouslySetInnerHTML&&(null!=t.children?"production"!==o.env.NODE_ENV?L(!1,"Can only set one of `children` or `props.dangerouslySetInnerHTML`."):L(!1):void 0,"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML?void 0:"production"!==o.env.NODE_ENV?L(!1,"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information."):L(!1)),"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?z(null==t.innerHTML,"Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."):void 0,"production"!==o.env.NODE_ENV?z(!t.contentEditable||null==t.children,"A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."):void 0),null!=t.style&&"object"!=typeof t.style?"production"!==o.env.NODE_ENV?L(!1,"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.%s",n(e)):L(!1):void 0); }function p(e,t,n,r){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?z("onScroll"!==t||F("scroll",!0),"This browser doesn't support the `onScroll` event"):void 0);var a=T.findReactContainerForID(e);if(a){var s=a.nodeType===Z?a.ownerDocument:a;G(t,s)}r.getReactMountReady().enqueue(b,{id:e,registrationName:t,listener:n})}function b(){var e=this;O.putListener(e.id,e.registrationName,e.listener)}function m(){var e=this;e._rootNodeID?void 0:"production"!==o.env.NODE_ENV?L(!1,"Must be mounted to trap events"):L(!1);var t=T.getNode(e._rootNodeID);switch(t?void 0:"production"!==o.env.NODE_ENV?L(!1,"trapBubbledEvent(...): Requires node to be rendered."):L(!1),e._tag){case"iframe":e._wrapperState.listeners=[O.trapBubbledEvent(R.topLevelTypes.topLoad,"load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in ne)ne.hasOwnProperty(n)&&e._wrapperState.listeners.push(O.trapBubbledEvent(R.topLevelTypes[n],ne[n],t));break;case"img":e._wrapperState.listeners=[O.trapBubbledEvent(R.topLevelTypes.topError,"error",t),O.trapBubbledEvent(R.topLevelTypes.topLoad,"load",t)];break;case"form":e._wrapperState.listeners=[O.trapBubbledEvent(R.topLevelTypes.topReset,"reset",t),O.trapBubbledEvent(R.topLevelTypes.topSubmit,"submit",t)]}}function f(){w.mountReadyWrapper(this)}function h(){M.postUpdateWrapper(this)}function v(e){ce.call(ie,e)||(le.test(e)?void 0:"production"!==o.env.NODE_ENV?L(!1,"Invalid tag: %s",e):L(!1),ie[e]=!0)}function _(e,t){e=V({},e);var o=e[K.ancestorInfoContextKey];return e[K.ancestorInfoContextKey]=K.updatedAncestorInfo(o,t._tag,t),e}function g(e,t){return e.indexOf("-")>=0||null!=t.is}function N(e){v(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null,"production"!==o.env.NODE_ENV&&(this._unprocessedContextDev=null,this._processedContextDev=null)}var y=e("./AutoFocusUtils"),E=e("./CSSPropertyOperations"),j=e("./DOMProperty"),C=e("./DOMPropertyOperations"),R=e("./EventConstants"),O=e("./ReactBrowserEventEmitter"),D=e("./ReactComponentBrowserEnvironment"),U=e("./ReactDOMButton"),w=e("./ReactDOMInput"),P=e("./ReactDOMOption"),M=e("./ReactDOMSelect"),S=e("./ReactDOMTextarea"),T=e("./ReactMount"),I=e("./ReactMultiChild"),x=e("./ReactPerf"),k=e("./ReactUpdateQueue"),V=e("./Object.assign"),A=e("./escapeTextContentForBrowser"),L=e("fbjs/lib/invariant"),F=e("./isEventSupported"),B=e("fbjs/lib/keyOf"),H=e("./setInnerHTML"),W=e("./setTextContent"),q=e("fbjs/lib/shallowEqual"),K=e("./validateDOMNesting"),z=e("fbjs/lib/warning"),Y=O.deleteListener,G=O.listenTo,Q=O.registrationNameModules,$={string:!0,number:!0},X=B({style:null}),Z=1,J=!1;try{Object.defineProperty({},"test",{get:function(){}}),J=!0}catch(ee){}var te;"production"!==o.env.NODE_ENV&&(te={props:{enumerable:!1,get:function(){var e=this._reactInternalComponent;return"production"!==o.env.NODE_ENV?z(!1,"ReactDOMComponent: Do not access .props of a DOM node; instead, recreate the props as `render` did originally or read the DOM properties/attributes directly from this node (e.g., this.refs.box.className).%s",n(e)):void 0,e._currentElement.props}}});var oe={},ne={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},re={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ae={listing:!0,pre:!0,textarea:!0},se=V({menuitem:!0},re),le=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ie={},ce={}.hasOwnProperty;N.displayName="ReactDOMComponent",N.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(m,this);break;case"button":r=U.getNativeProps(this,r,n);break;case"input":w.mountWrapper(this,r,n),r=w.getNativeProps(this,r,n);break;case"option":P.mountWrapper(this,r,n),r=P.getNativeProps(this,r,n);break;case"select":M.mountWrapper(this,r,n),r=M.getNativeProps(this,r,n),n=M.processChildContext(this,r,n);break;case"textarea":S.mountWrapper(this,r,n),r=S.getNativeProps(this,r,n)}u(this,r),"production"!==o.env.NODE_ENV&&n[K.ancestorInfoContextKey]&&K(this._tag,this,n[K.ancestorInfoContextKey]),"production"!==o.env.NODE_ENV&&(this._unprocessedContextDev=n,this._processedContextDev=_(n,this),n=this._processedContextDev);var a;if(t.useCreateElement){var s=n[T.ownerDocumentContextKey],l=s.createElement(this._currentElement.type);C.setAttributeForID(l,this._rootNodeID),T.getID(l),this._updateDOMProperties({},r,t,l),this._createInitialChildren(t,r,n,l),a=l}else{var i=this._createOpenTagMarkupAndPutListeners(t,r),c=this._createContentMarkup(t,r,n);a=!c&&re[this._tag]?i+"/>":i+">"+c+"</"+this._currentElement.type+">"}switch(this._tag){case"input":t.getReactMountReady().enqueue(f,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(y.focusDOMComponent,this)}return a},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if(null!=a)if(Q.hasOwnProperty(r))a&&p(this._rootNodeID,r,a,e);else{r===X&&(a&&("production"!==o.env.NODE_ENV&&(this._previousStyle=a),a=this._previousStyleCopy=V({},t.style)),a=E.createMarkupForStyles(a));var s=null;s=null!=this._tag&&g(this._tag,t)?C.createMarkupForCustomAttribute(r,a):C.createMarkupForProperty(r,a),s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n;var l=C.createMarkupForID(this._rootNodeID);return n+" "+l},_createContentMarkup:function(e,t,o){var n="",r=t.dangerouslySetInnerHTML;if(null!=r)null!=r.__html&&(n=r.__html);else{var a=$[typeof t.children]?t.children:null,s=null!=a?null:t.children;if(null!=a)n=A(a);else if(null!=s){var l=this.mountChildren(s,e,o);n=l.join("")}}return ae[this._tag]&&"\n"===n.charAt(0)?"\n"+n:n},_createInitialChildren:function(e,t,o,n){var r=t.dangerouslySetInnerHTML;if(null!=r)null!=r.__html&&H(n,r.__html);else{var a=$[typeof t.children]?t.children:null,s=null!=a?null:t.children;if(null!=a)W(n,a);else if(null!=s)for(var l=this.mountChildren(s,e,o),i=0;i<l.length;i++)n.appendChild(l[i])}},receiveComponent:function(e,t,o){var n=this._currentElement;this._currentElement=e,this.updateComponent(t,n,e,o)},updateComponent:function(e,t,n,r){var a=t.props,s=this._currentElement.props;switch(this._tag){case"button":a=U.getNativeProps(this,a),s=U.getNativeProps(this,s);break;case"input":w.updateWrapper(this),a=w.getNativeProps(this,a),s=w.getNativeProps(this,s);break;case"option":a=P.getNativeProps(this,a),s=P.getNativeProps(this,s);break;case"select":a=M.getNativeProps(this,a),s=M.getNativeProps(this,s);break;case"textarea":S.updateWrapper(this),a=S.getNativeProps(this,a),s=S.getNativeProps(this,s)}"production"!==o.env.NODE_ENV&&(this._unprocessedContextDev!==r&&(this._unprocessedContextDev=r,this._processedContextDev=_(r,this)),r=this._processedContextDev),u(this,s),this._updateDOMProperties(a,s,e,null),this._updateDOMChildren(a,s,e,r),!J&&this._nodeWithLegacyProperties&&(this._nodeWithLegacyProperties.props=s),"select"===this._tag&&e.getReactMountReady().enqueue(h,this)},_updateDOMProperties:function(e,t,n,r){var a,s,l;for(a in e)if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a))if(a===X){var i=this._previousStyleCopy;for(s in i)i.hasOwnProperty(s)&&(l=l||{},l[s]="");this._previousStyleCopy=null}else Q.hasOwnProperty(a)?e[a]&&Y(this._rootNodeID,a):(j.properties[a]||j.isCustomAttribute(a))&&(r||(r=T.getNode(this._rootNodeID)),C.deleteValueForProperty(r,a));for(a in t){var c=t[a],u=a===X?this._previousStyleCopy:e[a];if(t.hasOwnProperty(a)&&c!==u)if(a===X)if(c?("production"!==o.env.NODE_ENV&&(d(this._previousStyleCopy,this._previousStyle,this),this._previousStyle=c),c=this._previousStyleCopy=V({},c)):this._previousStyleCopy=null,u){for(s in u)!u.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(l=l||{},l[s]="");for(s in c)c.hasOwnProperty(s)&&u[s]!==c[s]&&(l=l||{},l[s]=c[s])}else l=c;else Q.hasOwnProperty(a)?c?p(this._rootNodeID,a,c,n):u&&Y(this._rootNodeID,a):g(this._tag,t)?(r||(r=T.getNode(this._rootNodeID)),C.setValueForAttribute(r,a,c)):(j.properties[a]||j.isCustomAttribute(a))&&(r||(r=T.getNode(this._rootNodeID)),null!=c?C.setValueForProperty(r,a,c):C.deleteValueForProperty(r,a))}l&&(r||(r=T.getNode(this._rootNodeID)),E.setValueForStyles(r,l))},_updateDOMChildren:function(e,t,o,n){var r=$[typeof e.children]?e.children:null,a=$[typeof t.children]?t.children:null,s=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,l=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,i=null!=r?null:e.children,c=null!=a?null:t.children,d=null!=r||null!=s,u=null!=a||null!=l;null!=i&&null==c?this.updateChildren(null,o,n):d&&!u&&this.updateTextContent(""),null!=a?r!==a&&this.updateTextContent(""+a):null!=l?s!==l&&this.updateMarkup(""+l):null!=c&&this.updateChildren(c,o,n)},unmountComponent:function(){switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":var e=this._wrapperState.listeners;if(e)for(var t=0;t<e.length;t++)e[t].remove();break;case"input":w.unmountWrapper(this);break;case"html":case"head":case"body":"production"!==o.env.NODE_ENV?L(!1,"<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this._tag):L(!1)}if(this.unmountChildren(),O.deleteAllListeners(this._rootNodeID),D.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._wrapperState=null,this._nodeWithLegacyProperties){var n=this._nodeWithLegacyProperties;n._reactInternalComponent=null,this._nodeWithLegacyProperties=null}},getPublicInstance:function(){if(!this._nodeWithLegacyProperties){var e=T.getNode(this._rootNodeID);e._reactInternalComponent=this,e.getDOMNode=r,e.isMounted=a,e.setState=s,e.replaceState=s,e.forceUpdate=s,e.setProps=l,e.replaceProps=i,"production"!==o.env.NODE_ENV&&J?Object.defineProperties(e,te):e.props=this._currentElement.props,this._nodeWithLegacyProperties=e}return this._nodeWithLegacyProperties}},x.measureMethods(N,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),V(N.prototype,N.Mixin,I.Mixin),t.exports=N}).call(this,e("_process"))},{"./AutoFocusUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/AutoFocusUtils.js","./CSSPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js","./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMButton":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMButton.js","./ReactDOMInput":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMInput.js","./ReactDOMOption":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMOption.js","./ReactDOMSelect":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js","./ReactDOMTextarea":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextarea.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./isEventSupported":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js","./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setTextContent.js","./validateDOMNesting":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/validateDOMNesting.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js","fbjs/lib/shallowEqual":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/shallowEqual.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMFactories.js":[function(e,t,o){(function(o){"use strict";function n(e){return"production"!==o.env.NODE_ENV?a.createFactory(e):r.createFactory(e)}var r=e("./ReactElement"),a=e("./ReactElementValidator"),s=e("fbjs/lib/mapObject"),l=s({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},n);t.exports=l}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/mapObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/mapObject.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMFeatureFlags.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMFeatureFlags.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js":[function(e,t,o){(function(o){"use strict";var n=e("./DOMChildrenOperations"),r=e("./DOMPropertyOperations"),a=e("./ReactMount"),s=e("./ReactPerf"),l=e("fbjs/lib/invariant"),i={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c={updatePropertyByID:function(e,t,n){var s=a.getNode(e);i.hasOwnProperty(t)?"production"!==o.env.NODE_ENV?l(!1,"updatePropertyByID(...): %s",i[t]):l(!1):void 0,null!=n?r.setValueForProperty(s,t,n):r.deleteValueForProperty(s,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var o=a.getNode(e);n.dangerouslyReplaceNodeWithMarkup(o,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var o=0;o<e.length;o++)e[o].parentNode=a.getNode(e[o].parentID);n.processUpdates(e,t)}};s.measureMethods(c,"ReactDOMIDOperations",{dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),t.exports=c}).call(this,e("_process"))},{"./DOMChildrenOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMInput.js":[function(e,t,o){(function(o){"use strict";function n(){this._rootNodeID&&p.updateWrapper(this)}function r(e){var t=this._currentElement.props,r=s.executeOnChange(t,e);i.asap(n,this);var a=t.name;if("radio"===t.type&&null!=a){for(var c=l.getNode(this._rootNodeID),p=c;p.parentNode;)p=p.parentNode;for(var b=p.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),m=0;m<b.length;m++){var f=b[m];if(f!==c&&f.form===c.form){var h=l.getID(f);h?void 0:"production"!==o.env.NODE_ENV?d(!1,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."):d(!1);var v=u[h];v?void 0:"production"!==o.env.NODE_ENV?d(!1,"ReactDOMInput: Unknown radio button ID %s.",h):d(!1),i.asap(n,v)}}}return r}var a=e("./ReactDOMIDOperations"),s=e("./LinkedValueUtils"),l=e("./ReactMount"),i=e("./ReactUpdates"),c=e("./Object.assign"),d=e("fbjs/lib/invariant"),u={},p={getNativeProps:function(e,t,o){var n=s.getValue(t),r=s.getChecked(t),a=c({},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange});return a},mountWrapper:function(e,t){"production"!==o.env.NODE_ENV&&s.checkPropTypes("input",t,e._currentElement._owner);var n=t.defaultValue;e._wrapperState={initialChecked:t.defaultChecked||!1,initialValue:null!=n?n:null,onChange:r.bind(e)}},mountReadyWrapper:function(e){u[e._rootNodeID]=e},unmountWrapper:function(e){delete u[e._rootNodeID]},updateWrapper:function(e){var t=e._currentElement.props,o=t.checked;null!=o&&a.updatePropertyByID(e._rootNodeID,"checked",o||!1);var n=s.getValue(t);null!=n&&a.updatePropertyByID(e._rootNodeID,"value",""+n)}};t.exports=p}).call(this,e("_process"))},{"./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMOption.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactChildren"),r=e("./ReactDOMSelect"),a=e("./Object.assign"),s=e("fbjs/lib/warning"),l=r.valueContextKey,i={mountWrapper:function(e,t,n){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?s(null==t.selected,"Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."):void 0);var r=n[l],a=null;if(null!=r)if(a=!1,Array.isArray(r)){for(var i=0;i<r.length;i++)if(""+r[i]==""+t.value){a=!0;break}}else a=""+r==""+t.value;e._wrapperState={selected:a}},getNativeProps:function(e,t,r){var l=a({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(l.selected=e._wrapperState.selected);var i="";return n.forEach(t.children,function(e){null!=e&&("string"==typeof e||"number"==typeof e?i+=e:"production"!==o.env.NODE_ENV?s(!1,"Only strings and numbers are supported as <option> children."):void 0)}),l.children=i,l}};t.exports=i}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildren.js","./ReactDOMSelect":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js":[function(e,t,o){(function(o){"use strict";function n(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=i.getValue(e);null!=t&&s(this,e,t)}}function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function a(e,t){var n=e._currentElement._owner;i.checkPropTypes("select",t,n);for(var a=0;a<m.length;a++){var s=m[a];null!=t[s]&&(t.multiple?"production"!==o.env.NODE_ENV?p(Array.isArray(t[s]),"The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",s,r(n)):void 0:"production"!==o.env.NODE_ENV?p(!Array.isArray(t[s]),"The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",s,r(n)):void 0)}}function s(e,t,o){var n,r,a=c.getNode(e._rootNodeID).options;if(t){for(n={},r=0;r<o.length;r++)n[""+o[r]]=!0;for(r=0;r<a.length;r++){var s=n.hasOwnProperty(a[r].value);a[r].selected!==s&&(a[r].selected=s)}}else{for(n=""+o,r=0;r<a.length;r++)if(a[r].value===n)return void(a[r].selected=!0);a.length&&(a[0].selected=!0)}}function l(e){var t=this._currentElement.props,o=i.executeOnChange(t,e);return this._wrapperState.pendingUpdate=!0,d.asap(n,this),o}var i=e("./LinkedValueUtils"),c=e("./ReactMount"),d=e("./ReactUpdates"),u=e("./Object.assign"),p=e("fbjs/lib/warning"),b="__ReactDOMSelect_value$"+Math.random().toString(36).slice(2),m=["value","defaultValue"],f={valueContextKey:b,getNativeProps:function(e,t,o){return u({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){"production"!==o.env.NODE_ENV&&a(e,t);var n=i.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,onChange:l.bind(e),wasMultiple:Boolean(t.multiple)}},processChildContext:function(e,t,o){var n=u({},o);return n[b]=e._wrapperState.initialValue,n},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var o=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var n=i.getValue(t);null!=n?(e._wrapperState.pendingUpdate=!1,s(e,Boolean(t.multiple),n)):o!==Boolean(t.multiple)&&(null!=t.defaultValue?s(e,Boolean(t.multiple),t.defaultValue):s(e,Boolean(t.multiple),t.multiple?[]:""))}};t.exports=f}).call(this,e("_process"))},{"./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelection.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMSelection.js"][0].apply(o,arguments)},{"./getNodeForCharacterOffset":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getNodeForCharacterOffset.js","./getTextContentAccessor":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMServer.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDOMServer.js"][0].apply(o,arguments)},{"./ReactDefaultInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js","./ReactServerRendering":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRendering.js","./ReactVersion":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactVersion.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js":[function(e,t,o){(function(o){"use strict";var n=e("./DOMChildrenOperations"),r=e("./DOMPropertyOperations"),a=e("./ReactComponentBrowserEnvironment"),s=e("./ReactMount"),l=e("./Object.assign"),i=e("./escapeTextContentForBrowser"),c=e("./setTextContent"),d=e("./validateDOMNesting"),u=function(e){};l(u.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t,n){if("production"!==o.env.NODE_ENV&&n[d.ancestorInfoContextKey]&&d("span",null,n[d.ancestorInfoContextKey]),this._rootNodeID=e,t.useCreateElement){var a=n[s.ownerDocumentContextKey],l=a.createElement("span");return r.setAttributeForID(l,e),s.getID(l),c(l,this._stringText),l}var u=i(this._stringText);return t.renderToStaticMarkup?u:"<span "+r.createMarkupForID(e)+">"+u+"</span>"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var o=""+e;if(o!==this._stringText){this._stringText=o;var r=s.getNode(this._rootNodeID);n.updateTextContent(r,o)}}},unmountComponent:function(){a.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=u}).call(this,e("_process"))},{"./DOMChildrenOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./setTextContent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setTextContent.js","./validateDOMNesting":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/validateDOMNesting.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextarea.js":[function(e,t,o){(function(o){"use strict";function n(){this._rootNodeID&&u.updateWrapper(this)}function r(e){var t=this._currentElement.props,o=a.executeOnChange(t,e);return l.asap(n,this),o}var a=e("./LinkedValueUtils"),s=e("./ReactDOMIDOperations"),l=e("./ReactUpdates"),i=e("./Object.assign"),c=e("fbjs/lib/invariant"),d=e("fbjs/lib/warning"),u={getNativeProps:function(e,t,n){null!=t.dangerouslySetInnerHTML?"production"!==o.env.NODE_ENV?c(!1,"`dangerouslySetInnerHTML` does not make sense on <textarea>."):c(!1):void 0;var r=i({},t,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,t){"production"!==o.env.NODE_ENV&&a.checkPropTypes("textarea",t,e._currentElement._owner);var n=t.defaultValue,s=t.children;null!=s&&("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?d(!1,"Use the `defaultValue` or `value` props instead of setting children on <textarea>."):void 0),null!=n?"production"!==o.env.NODE_ENV?c(!1,"If you supply `defaultValue` on a <textarea>, do not pass children."):c(!1):void 0,Array.isArray(s)&&(s.length<=1?void 0:"production"!==o.env.NODE_ENV?c(!1,"<textarea> can only have at most one child."):c(!1),s=s[0]),n=""+s),null==n&&(n="");var l=a.getValue(t);e._wrapperState={initialValue:""+(null!=l?l:n),onChange:r.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,o=a.getValue(t);null!=o&&s.updatePropertyByID(e._rootNodeID,"value",""+o)}};t.exports=u}).call(this,e("_process"))},{"./LinkedValueUtils":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactDOMIDOperations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultBatchingStrategy.js"][0].apply(o,arguments)},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js":[function(e,t,o){(function(o){"use strict";function n(){if(!R&&(R=!0,v.EventEmitter.injectReactEventListener(h), v.EventPluginHub.injectEventPluginOrder(l),v.EventPluginHub.injectInstanceHandle(_),v.EventPluginHub.injectMount(g),v.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:j,EnterLeaveEventPlugin:i,ChangeEventPlugin:a,SelectEventPlugin:y,BeforeInputEventPlugin:r}),v.NativeComponent.injectGenericComponentClass(m),v.NativeComponent.injectTextComponentClass(f),v.Class.injectMixin(u),v.DOMProperty.injectDOMPropertyConfig(d),v.DOMProperty.injectDOMPropertyConfig(C),v.EmptyComponent.injectEmptyComponent("noscript"),v.Updates.injectReconcileTransaction(N),v.Updates.injectBatchingStrategy(b),v.RootIndex.injectCreateReactRootIndex(c.canUseDOM?s.createReactRootIndex:E.createReactRootIndex),v.Component.injectEnvironment(p),"production"!==o.env.NODE_ENV)){var t=c.canUseDOM&&window.location.href||"";if(/[?&]react_perf\b/.test(t)){var n=e("./ReactDefaultPerf");n.start()}}}var r=e("./BeforeInputEventPlugin"),a=e("./ChangeEventPlugin"),s=e("./ClientReactRootIndex"),l=e("./DefaultEventPluginOrder"),i=e("./EnterLeaveEventPlugin"),c=e("fbjs/lib/ExecutionEnvironment"),d=e("./HTMLDOMPropertyConfig"),u=e("./ReactBrowserComponentMixin"),p=e("./ReactComponentBrowserEnvironment"),b=e("./ReactDefaultBatchingStrategy"),m=e("./ReactDOMComponent"),f=e("./ReactDOMTextComponent"),h=e("./ReactEventListener"),v=e("./ReactInjection"),_=e("./ReactInstanceHandles"),g=e("./ReactMount"),N=e("./ReactReconcileTransaction"),y=e("./SelectEventPlugin"),E=e("./ServerReactRootIndex"),j=e("./SimpleEventPlugin"),C=e("./SVGDOMPropertyConfig"),R=!1;t.exports={inject:n}}).call(this,e("_process"))},{"./BeforeInputEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/BeforeInputEventPlugin.js","./ChangeEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ChangeEventPlugin.js","./ClientReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ClientReactRootIndex.js","./DefaultEventPluginOrder":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DefaultEventPluginOrder.js","./EnterLeaveEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EnterLeaveEventPlugin.js","./HTMLDOMPropertyConfig":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/HTMLDOMPropertyConfig.js","./ReactBrowserComponentMixin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactComponentBrowserEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./ReactDOMTextComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDefaultBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactDefaultPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerf.js","./ReactEventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventListener.js","./ReactInjection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInjection.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactReconcileTransaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconcileTransaction.js","./SVGDOMPropertyConfig":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SVGDOMPropertyConfig.js","./SelectEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SelectEventPlugin.js","./ServerReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ServerReactRootIndex.js","./SimpleEventPlugin":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SimpleEventPlugin.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerf.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultPerf.js"][0].apply(o,arguments)},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ReactDefaultPerfAnalysis":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerfAnalysis.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","fbjs/lib/performanceNow":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/performanceNow.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerfAnalysis.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactDefaultPerfAnalysis.js"][0].apply(o,arguments)},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactCurrentOwner"),r=e("./Object.assign"),a="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,s={key:!0,ref:!0,__self:!0,__source:!0},l=!1;if("production"!==o.env.NODE_ENV)try{Object.defineProperty({},"x",{}),l=!0}catch(i){}var c=function(e,t,n,r,s,i,c){var d={$$typeof:a,type:e,key:t,ref:n,props:c,_owner:i};return"production"!==o.env.NODE_ENV&&(d._store={},l?(Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(d,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(d,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s})):(d._store.validated=!1,d._self=r,d._source=s),Object.freeze(d.props),Object.freeze(d)),d};c.createElement=function(e,t,o){var r,a={},l=null,i=null,d=null,u=null;if(null!=t){i=void 0===t.ref?null:t.ref,l=void 0===t.key?null:""+t.key,d=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source;for(r in t)t.hasOwnProperty(r)&&!s.hasOwnProperty(r)&&(a[r]=t[r])}var p=arguments.length-2;if(1===p)a.children=o;else if(p>1){for(var b=Array(p),m=0;p>m;m++)b[m]=arguments[m+2];a.children=b}if(e&&e.defaultProps){var f=e.defaultProps;for(r in f)"undefined"==typeof a[r]&&(a[r]=f[r])}return c(e,l,i,d,u,n.current,a)},c.createFactory=function(e){var t=c.createElement.bind(null,e);return t.type=e,t},c.cloneAndReplaceKey=function(e,t){var o=c(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return o},c.cloneAndReplaceProps=function(e,t){var n=c(e.type,e.key,e.ref,e._self,e._source,e._owner,t);return"production"!==o.env.NODE_ENV&&(n._store.validated=e._store.validated),n},c.cloneElement=function(e,t,o){var a,l=r({},e.props),i=e.key,d=e.ref,u=e._self,p=e._source,b=e._owner;if(null!=t){void 0!==t.ref&&(d=t.ref,b=n.current),void 0!==t.key&&(i=""+t.key);for(a in t)t.hasOwnProperty(a)&&!s.hasOwnProperty(a)&&(l[a]=t[a])}var m=arguments.length-2;if(1===m)l.children=o;else if(m>1){for(var f=Array(m),h=0;m>h;h++)f[h]=arguments[h+2];l.children=f}return c(e.type,i,d,u,p,b,l)},c.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.exports=c}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js":[function(e,t,o){(function(o){"use strict";function n(){if(p.current){var e=p.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function r(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=a("uniqueKey",e,t);null!==n&&("production"!==o.env.NODE_ENV?f(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s%s',n.parentOrOwner||"",n.childOwner||"",n.url||""):void 0)}}function a(e,t,o){var r=n();if(!r){var a="string"==typeof o?o:o.displayName||o.name;a&&(r=" Check the top-level render call using <"+a+">.")}var s=h[e]||(h[e]={});if(s[r])return null;s[r]=!0;var l={parentOrOwner:r,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==p.current&&(l.childOwner=" It was passed a child from "+t._owner.getName()+"."),l}function s(e,t){if("object"==typeof e)if(Array.isArray(e))for(var o=0;o<e.length;o++){var n=e[o];c.isValidElement(n)&&r(n,t)}else if(c.isValidElement(e))e._store&&(e._store.validated=!0);else if(e){var a=b(e);if(a&&a!==e.entries)for(var s,l=a.call(e);!(s=l.next()).done;)c.isValidElement(s.value)&&r(s.value,t)}}function l(e,t,r,a){for(var s in t)if(t.hasOwnProperty(s)){var l;try{"function"!=typeof t[s]?"production"!==o.env.NODE_ENV?m(!1,"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e||"React class",u[a],s):m(!1):void 0,l=t[s](r,s,e,a)}catch(i){l=i}if("production"!==o.env.NODE_ENV?f(!l||l instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",e||"React class",u[a],s,typeof l):void 0,l instanceof Error&&!(l.message in v)){v[l.message]=!0;var c=n();"production"!==o.env.NODE_ENV?f(!1,"Failed propType: %s%s",l.message,c):void 0}}}function i(e){var t=e.type;if("function"==typeof t){var n=t.displayName||t.name;t.propTypes&&l(n,t.propTypes,e.props,d.prop),"function"==typeof t.getDefaultProps&&("production"!==o.env.NODE_ENV?f(t.getDefaultProps.isReactClassApproved,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."):void 0)}}var c=e("./ReactElement"),d=e("./ReactPropTypeLocations"),u=e("./ReactPropTypeLocationNames"),p=e("./ReactCurrentOwner"),b=e("./getIteratorFn"),m=e("fbjs/lib/invariant"),f=e("fbjs/lib/warning"),h={},v={},_={createElement:function(e,t,r){var a="string"==typeof e||"function"==typeof e;"production"!==o.env.NODE_ENV?f(a,"React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).%s",n()):void 0;var l=c.createElement.apply(this,arguments);if(null==l)return l;if(a)for(var d=2;d<arguments.length;d++)s(arguments[d],e);return i(l),l},createFactory:function(e){var t=_.createElement.bind(null,e);if(t.type=e,"production"!==o.env.NODE_ENV)try{Object.defineProperty(t,"type",{enumerable:!1,get:function(){return"production"!==o.env.NODE_ENV?f(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."):void 0,Object.defineProperty(this,"type",{value:e}),e}})}catch(n){}return t},cloneElement:function(e,t,o){for(var n=c.cloneElement.apply(this,arguments),r=2;r<arguments.length;r++)s(arguments[r],n.type);return i(n),n}};t.exports=_}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponent.js"][0].apply(o,arguments)},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactEmptyComponentRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponentRegistry.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponentRegistry.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEmptyComponentRegistry.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js":[function(e,t,o){(function(e){"use strict";function o(e,t,o,r){try{return t(o,r)}catch(a){return void(null===n&&(n=a))}}var n=null,r={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(n){var e=n;throw n=null,e}}};if("production"!==e.env.NODE_ENV&&"undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"function"==typeof Event){var a=document.createElement("react");r.invokeGuardedCallback=function(e,t,o,n){var r=t.bind(null,o,n);a.addEventListener(e,r,!1),a.dispatchEvent(new Event(e)),a.removeEventListener(e,r,!1)}}t.exports=r}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventEmitterMixin.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEventEmitterMixin.js"][0].apply(o,arguments)},{"./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEventListener.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactEventListener.js"][0].apply(o,arguments)},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js","fbjs/lib/EventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/EventListener.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/getUnboundedScrollPosition":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getUnboundedScrollPosition.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInjection.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInjection.js"][0].apply(o,arguments)},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./EventPluginHub":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInputSelection.js"][0].apply(o,arguments)},{"./ReactDOMSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMSelection.js","fbjs/lib/containsNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/containsNode.js","fbjs/lib/focusNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/focusNode.js","fbjs/lib/getActiveElement":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getActiveElement.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js":[function(e,t,o){(function(o){"use strict";function n(e){return b+e.toString(36)}function r(e,t){return e.charAt(t)===b||t===e.length}function a(e){return""===e||e.charAt(0)===b&&e.charAt(e.length-1)!==b}function s(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function l(e){return e?e.substr(0,e.lastIndexOf(b)):""}function i(e,t){if(a(e)&&a(t)?void 0:"production"!==o.env.NODE_ENV?p(!1,"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,t):p(!1),s(e,t)?void 0:"production"!==o.env.NODE_ENV?p(!1,"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,t):p(!1),e===t)return e;var n,l=e.length+m;for(n=l;n<t.length&&!r(t,n);n++);return t.substr(0,n)}function c(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var s=0,l=0;n>=l;l++)if(r(e,l)&&r(t,l))s=l;else if(e.charAt(l)!==t.charAt(l))break;var i=e.substr(0,s);return a(i)?void 0:"production"!==o.env.NODE_ENV?p(!1,"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,t,i):p(!1),i}function d(e,t,n,r,a,c){e=e||"",t=t||"",e===t?"production"!==o.env.NODE_ENV?p(!1,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e):p(!1):void 0;var d=s(t,e);d||s(e,t)?void 0:"production"!==o.env.NODE_ENV?p(!1,"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,t):p(!1);for(var u=0,b=d?l:i,m=e;;m=b(m,t)){var h;if(a&&m===e||c&&m===t||(h=n(m,d,r)),h===!1||m===t)break;u++<f?void 0:"production"!==o.env.NODE_ENV?p(!1,"traverseParentPath(%s, %s, ...): Detected an infinite loop while traversing the React DOM ID tree. This may be due to malformed IDs: %s",e,t,m):p(!1)}}var u=e("./ReactRootIndex"),p=e("fbjs/lib/invariant"),b=".",m=b.length,f=1e4,h={createReactRootID:function(){return n(u.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===b&&e.length>1){var t=e.indexOf(b,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,o,n,r){var a=c(e,t);a!==e&&d(e,a,o,n,!1,!0),a!==t&&d(a,t,o,r,!0,!1)},traverseTwoPhase:function(e,t,o){e&&(d("",e,t,o,!0,!1),d(e,"",t,o,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,o){e&&(d("",e,t,o,!0,!0),d(e,"",t,o,!0,!0))},traverseAncestors:function(e,t,o){d("",e,t,o,!0,!1)},getFirstCommonAncestorID:c,_getNextDescendantID:i,isAncestorIDOf:s,SEPARATOR:b};t.exports=h}).call(this,e("_process"))},{"./ReactRootIndex":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactInstanceMap.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactIsomorphic.js":[function(e,t,o){(function(o){"use strict";var n=e("./ReactChildren"),r=e("./ReactComponent"),a=e("./ReactClass"),s=e("./ReactDOMFactories"),l=e("./ReactElement"),i=e("./ReactElementValidator"),c=e("./ReactPropTypes"),d=e("./ReactVersion"),u=e("./Object.assign"),p=e("./onlyChild"),b=l.createElement,m=l.createFactory,f=l.cloneElement;"production"!==o.env.NODE_ENV&&(b=i.createElement,m=i.createFactory,f=i.cloneElement);var h={Children:{map:n.map,forEach:n.forEach,count:n.count,toArray:n.toArray,only:p},Component:r,createElement:b,cloneElement:f,isValidElement:l.isValidElement,PropTypes:c,createClass:a.createClass,createFactory:m,createMixin:function(e){return e},DOM:s,version:d,__spread:u};t.exports=h}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildren.js","./ReactClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponent.js","./ReactDOMFactories":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMFactories.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactPropTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js","./ReactVersion":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactVersion.js","./onlyChild":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/onlyChild.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMarkupChecksum.js"][0].apply(o,arguments)},{"./adler32":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/adler32.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js":[function(e,t,o){(function(o){"use strict";function n(e,t){for(var o=Math.min(e.length,t.length),n=0;o>n;n++)if(e.charAt(n)!==t.charAt(n))return n;return e.length===t.length?-1:o}function r(e){return e?e.nodeType===K?e.documentElement:e.firstChild:null}function a(e){var t=r(e);return t&&ee.getID(t)}function s(e){var t=l(e);if(t)if(W.hasOwnProperty(t)){var n=W[t];n!==e&&(u(n,t)?"production"!==o.env.NODE_ENV?V(!1,"ReactMount: Two valid but unequal nodes with the same `%s`: %s",H,t):V(!1):void 0,W[t]=e)}else W[t]=e;return t}function l(e){return e&&e.getAttribute&&e.getAttribute(H)||""}function i(e,t){var o=l(e);o!==t&&delete W[o],e.setAttribute(H,t),W[t]=e}function c(e){return W.hasOwnProperty(e)&&u(W[e],e)||(W[e]=ee.findReactNodeByID(e)),W[e]}function d(e){var t=D.get(e)._rootNodeID;return R.isNullComponentID(t)?null:(W.hasOwnProperty(t)&&u(W[t],t)||(W[t]=ee.findReactNodeByID(t)),W[t])}function u(e,t){if(e){l(e)!==t?"production"!==o.env.NODE_ENV?V(!1,"ReactMount: Unexpected modification of `%s`",H):V(!1):void 0;var n=ee.findReactContainerForID(t);if(n&&x(n,e))return!0}return!1}function p(e){delete W[e]}function b(e){var t=W[e];return t&&u(t,e)?void(Z=t):!1}function m(e){Z=null,O.traverseAncestors(e,b);var t=Z;return Z=null,t}function f(e,t,n,r,a,s){if(j.useCreateElement&&(s=T({},s),n.nodeType===K?s[Y]=n:s[Y]=n.ownerDocument),"production"!==o.env.NODE_ENV){s===I&&(s={});var l=n.nodeName.toLowerCase();s[F.ancestorInfoContextKey]=F.updatedAncestorInfo(null,l,null)}var i=P.mountComponent(e,t,r,s);e._renderedComponent._topLevelWrapper=e,ee._mountImageIntoNode(i,n,a,r)}function h(e,t,o,n,r){var a=S.ReactReconcileTransaction.getPooled(n);a.perform(f,null,e,t,o,a,n,r),S.ReactReconcileTransaction.release(a)}function v(e,t){for(P.unmountComponent(e),t.nodeType===K&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function _(e){var t=a(e);return t?t!==O.getReactRootIDFromNodeID(t):!1}function g(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=l(e);if(t){var o,n=O.getReactRootIDFromNodeID(t),r=e;do if(o=l(r),r=r.parentNode,null==r)return null;while(o!==n);if(r===Q[n])return e}}return null}var N=e("./DOMProperty"),y=e("./ReactBrowserEventEmitter"),E=e("./ReactCurrentOwner"),j=e("./ReactDOMFeatureFlags"),C=e("./ReactElement"),R=e("./ReactEmptyComponentRegistry"),O=e("./ReactInstanceHandles"),D=e("./ReactInstanceMap"),U=e("./ReactMarkupChecksum"),w=e("./ReactPerf"),P=e("./ReactReconciler"),M=e("./ReactUpdateQueue"),S=e("./ReactUpdates"),T=e("./Object.assign"),I=e("fbjs/lib/emptyObject"),x=e("fbjs/lib/containsNode"),k=e("./instantiateReactComponent"),V=e("fbjs/lib/invariant"),A=e("./setInnerHTML"),L=e("./shouldUpdateReactComponent"),F=e("./validateDOMNesting"),B=e("fbjs/lib/warning"),H=N.ID_ATTRIBUTE_NAME,W={},q=1,K=9,z=11,Y="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),G={},Q={};if("production"!==o.env.NODE_ENV)var $={};var X=[],Z=null,J=function(){};J.prototype.isReactComponent={},"production"!==o.env.NODE_ENV&&(J.displayName="TopLevelWrapper"),J.prototype.render=function(){return this.props};var ee={TopLevelWrapper:J,_instancesByReactRootID:G,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,s){return ee.scrollMonitor(n,function(){M.enqueueElementInternal(e,t),s&&M.enqueueCallbackInternal(e,s)}),"production"!==o.env.NODE_ENV&&($[a(n)]=r(n)),e},_registerComponent:function(e,t){!t||t.nodeType!==q&&t.nodeType!==K&&t.nodeType!==z?"production"!==o.env.NODE_ENV?V(!1,"_registerComponent(...): Target container is not a DOM element."):V(!1):void 0,y.ensureScrollValueMonitoring();var n=ee.registerContainer(t);return G[n]=e,n},_renderNewRootComponent:function(e,t,n,a){"production"!==o.env.NODE_ENV?B(null==E.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",E.current&&E.current.getName()||"ReactCompositeComponent"):void 0;var s=k(e,null),l=ee._registerComponent(s,t);return S.batchedUpdates(h,s,l,t,n,a),"production"!==o.env.NODE_ENV&&($[l]=r(t)),s},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?"production"!==o.env.NODE_ENV?V(!1,"parentComponent must be a valid React Component"):V(!1):void 0,ee._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,s){C.isValidElement(t)?void 0:"production"!==o.env.NODE_ENV?V(!1,"ReactDOM.render(): Invalid component element.%s","string"==typeof t?" Instead of passing an element string, make sure to instantiate it by passing it to React.createElement.":"function"==typeof t?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":""):V(!1),"production"!==o.env.NODE_ENV?B(!n||!n.tagName||"BODY"!==n.tagName.toUpperCase(),"render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app."):void 0;var i=new C(J,null,null,null,null,null,t),c=G[a(n)];if(c){var d=c._currentElement,u=d.props;if(L(u,t))return ee._updateRootComponent(c,i,n,s)._renderedComponent.getPublicInstance();ee.unmountComponentAtNode(n)}var p=r(n),b=p&&!!l(p),m=_(n);if("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(!m,"render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."):void 0,!b||p.nextSibling))for(var f=p;f;){if(l(f)){"production"!==o.env.NODE_ENV?B(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):void 0;break}f=f.nextSibling}var h=b&&!c&&!m,v=ee._renderNewRootComponent(i,n,h,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):I)._renderedComponent.getPublicInstance();return s&&s.call(v),v},render:function(e,t,o){return ee._renderSubtreeIntoContainer(null,e,t,o)},registerContainer:function(e){var t=a(e);return t&&(t=O.getReactRootIDFromNodeID(t)),t||(t=O.createReactRootID()),Q[t]=e,t},unmountComponentAtNode:function(e){"production"!==o.env.NODE_ENV?B(null==E.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",E.current&&E.current.getName()||"ReactCompositeComponent"):void 0,!e||e.nodeType!==q&&e.nodeType!==K&&e.nodeType!==z?"production"!==o.env.NODE_ENV?V(!1,"unmountComponentAtNode(...): Target container is not a DOM element."):V(!1):void 0;var t=a(e),n=G[t];if(!n){var r=_(e),s=l(e),i=s&&s===O.getReactRootIDFromNodeID(s);return"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(!r,"unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",i?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."):void 0),!1}return S.batchedUpdates(v,n,e),delete G[t],delete Q[t],"production"!==o.env.NODE_ENV&&delete $[t],!0},findReactContainerForID:function(e){var t=O.getReactRootIDFromNodeID(e),n=Q[t];if("production"!==o.env.NODE_ENV){var r=$[t];if(r&&r.parentNode!==n){"production"!==o.env.NODE_ENV?B(l(r)===t,"ReactMount: Root element ID differed from reactRootID."):void 0;var a=n.firstChild;a&&t===l(a)?$[t]=a:"production"!==o.env.NODE_ENV?B(!1,"ReactMount: Root element has been removed from its original container. New container: %s",r.parentNode):void 0}}return n},findReactNodeByID:function(e){var t=ee.findReactContainerForID(e);return ee.findComponentRoot(t,e)},getFirstReactDOM:function(e){return g(e)},findComponentRoot:function(e,t){var n=X,r=0,a=m(t)||e;for("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(null!=a,"React can't find the root component node for data-reactid value `%s`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.",t):void 0),n[0]=a.firstChild,n.length=1;r<n.length;){for(var s,l=n[r++];l;){var i=ee.getID(l); i?t===i?s=l:O.isAncestorIDOf(i,t)&&(n.length=r=0,n.push(l.firstChild)):n.push(l.firstChild),l=l.nextSibling}if(s)return n.length=0,s}n.length=0,"production"!==o.env.NODE_ENV?V(!1,"findComponentRoot(..., %s): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",t,ee.getID(e)):V(!1)},_mountImageIntoNode:function(e,t,a,s){if(!t||t.nodeType!==q&&t.nodeType!==K&&t.nodeType!==z?"production"!==o.env.NODE_ENV?V(!1,"mountComponentIntoNode(...): Target container is not valid."):V(!1):void 0,a){var l=r(t);if(U.canReuseMarkup(e,l))return;var i=l.getAttribute(U.CHECKSUM_ATTR_NAME);l.removeAttribute(U.CHECKSUM_ATTR_NAME);var c=l.outerHTML;l.setAttribute(U.CHECKSUM_ATTR_NAME,i);var d=e;if("production"!==o.env.NODE_ENV){var u;t.nodeType===q?(u=document.createElement("div"),u.innerHTML=e,d=u.innerHTML):(u=document.createElement("iframe"),document.body.appendChild(u),u.contentDocument.write(e),d=u.contentDocument.documentElement.outerHTML,document.body.removeChild(u))}var p=n(d,c),b=" (client) "+d.substring(p-20,p+20)+"\n (server) "+c.substring(p-20,p+20);t.nodeType===K?"production"!==o.env.NODE_ENV?V(!1,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",b):V(!1):void 0,"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?B(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",b):void 0)}if(t.nodeType===K?"production"!==o.env.NODE_ENV?V(!1,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering."):V(!1):void 0,s.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);t.appendChild(e)}else A(t,e)},ownerDocumentContextKey:Y,getReactRootID:a,getID:s,setID:i,getNode:c,getNodeFromInstance:d,isValid:u,purgeID:p};w.measureMethods(ee,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),t.exports=ee}).call(this,e("_process"))},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOMFeatureFlags":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMFeatureFlags.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactEmptyComponentRegistry":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponentRegistry.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactMarkupChecksum":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdateQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js","./shouldUpdateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js","./validateDOMNesting":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/validateDOMNesting.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/containsNode":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/containsNode.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChild.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o){v.push({parentID:e,parentNode:null,type:u.INSERT_MARKUP,markupIndex:_.push(t)-1,content:null,fromIndex:null,toIndex:o})}function r(e,t,o){v.push({parentID:e,parentNode:null,type:u.MOVE_EXISTING,markupIndex:null,content:null,fromIndex:t,toIndex:o})}function a(e,t){v.push({parentID:e,parentNode:null,type:u.REMOVE_NODE,markupIndex:null,content:null,fromIndex:t,toIndex:null})}function s(e,t){v.push({parentID:e,parentNode:null,type:u.SET_MARKUP,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function l(e,t){v.push({parentID:e,parentNode:null,type:u.TEXT_CONTENT,markupIndex:null,content:t,fromIndex:null,toIndex:null})}function i(){v.length&&(d.processChildrenUpdates(v,_),c())}function c(){v.length=0,_.length=0}var d=e("./ReactComponentEnvironment"),u=e("./ReactMultiChildUpdateTypes"),p=e("./ReactCurrentOwner"),b=e("./ReactReconciler"),m=e("./ReactChildReconciler"),f=e("./flattenChildren"),h=0,v=[],_=[],g={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){if("production"!==o.env.NODE_ENV&&this._currentElement)try{return p.current=this._currentElement._owner,m.instantiateChildren(e,t,n)}finally{p.current=null}return m.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r){var a;if("production"!==o.env.NODE_ENV&&this._currentElement){try{p.current=this._currentElement._owner,a=f(t)}finally{p.current=null}return m.updateChildren(e,a,n,r)}return a=f(t),m.updateChildren(e,a,n,r)},mountChildren:function(e,t,o){var n=this._reconcilerInstantiateChildren(e,t,o);this._renderedChildren=n;var r=[],a=0;for(var s in n)if(n.hasOwnProperty(s)){var l=n[s],i=this._rootNodeID+s,c=b.mountComponent(l,i,t,o);l._mountIndex=a++,r.push(c)}return r},updateTextContent:function(e){h++;var t=!0;try{var o=this._renderedChildren;m.unmountChildren(o);for(var n in o)o.hasOwnProperty(n)&&this._unmountChild(o[n]);this.setTextContent(e),t=!1}finally{h--,h||(t?c():i())}},updateMarkup:function(e){h++;var t=!0;try{var o=this._renderedChildren;m.unmountChildren(o);for(var n in o)o.hasOwnProperty(n)&&this._unmountChildByName(o[n],n);this.setMarkup(e),t=!1}finally{h--,h||(t?c():i())}},updateChildren:function(e,t,o){h++;var n=!0;try{this._updateChildren(e,t,o),n=!1}finally{h--,h||(n?c():i())}},_updateChildren:function(e,t,o){var n=this._renderedChildren,r=this._reconcilerUpdateChildren(n,e,t,o);if(this._renderedChildren=r,r||n){var a,s=0,l=0;for(a in r)if(r.hasOwnProperty(a)){var i=n&&n[a],c=r[a];i===c?(this.moveChild(i,l,s),s=Math.max(i._mountIndex,s),i._mountIndex=l):(i&&(s=Math.max(i._mountIndex,s),this._unmountChild(i)),this._mountChildByNameAtIndex(c,a,l,t,o)),l++}for(a in n)!n.hasOwnProperty(a)||r&&r.hasOwnProperty(a)||this._unmountChild(n[a])}},unmountChildren:function(){var e=this._renderedChildren;m.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,o){e._mountIndex<o&&r(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){n(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){a(this._rootNodeID,e._mountIndex)},setTextContent:function(e){l(this._rootNodeID,e)},setMarkup:function(e){s(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,o,n,r){var a=this._rootNodeID+t,s=b.mountComponent(e,a,n,r);e._mountIndex=o,this.createChild(e,s)},_unmountChild:function(e){this.removeChild(e),e._mountIndex=null}}};t.exports=g}).call(this,e("_process"))},{"./ReactChildReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactChildReconciler.js","./ReactComponentEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactMultiChildUpdateTypes":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./flattenChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/flattenChildren.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactMultiChildUpdateTypes.js"][0].apply(o,arguments)},{"fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){if("function"==typeof e.type)return e.type;var t=e.type,o=u[t];return null==o&&(u[t]=o=c(t)),o}function r(e){return d?void 0:"production"!==o.env.NODE_ENV?i(!1,"There is no registered component for the tag %s",e.type):i(!1),new d(e.type,e.props)}function a(e){return new p(e)}function s(e){return e instanceof p}var l=e("./Object.assign"),i=e("fbjs/lib/invariant"),c=null,d=null,u={},p=null,b={injectGenericComponentClass:function(e){d=e},injectTextComponentClass:function(e){p=e},injectComponentClasses:function(e){l(u,e)}},m={getComponentClassForElement:n,createInternalComponent:r,createInstanceForText:a,isTextComponent:s,injection:b};t.exports=m}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNoopUpdateQueue.js":[function(e,t,o){(function(o){"use strict";function n(e,t){"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?r(!1,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op. Please check the code for the %s component.",t,t,e.constructor&&e.constructor.displayName||""):void 0)}var r=e("fbjs/lib/warning"),a={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){n(e,"forceUpdate")},enqueueReplaceState:function(e,t){n(e,"replaceState")},enqueueSetState:function(e,t){n(e,"setState")},enqueueSetProps:function(e,t){n(e,"setProps")},enqueueReplaceProps:function(e,t){n(e,"replaceProps")}};t.exports=a}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactOwner.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,a){r.isValidOwner(a)?void 0:"production"!==o.env.NODE_ENV?n(!1,"addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."):n(!1),a.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,a){r.isValidOwner(a)?void 0:"production"!==o.env.NODE_ENV?n(!1,"removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."):n(!1),a.getPublicInstance().refs[t]===e.getPublicInstance()&&a.detachRef(t)}};t.exports=r}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js":[function(e,t,o){(function(e){"use strict";function o(e,t,o){return o}var n={enableMeasure:!1,storedMeasure:o,measureMethods:function(t,o,r){if("production"!==e.env.NODE_ENV)for(var a in r)r.hasOwnProperty(a)&&(t[a]=n.measure(o,r[a],t[a]))},measure:function(t,o,r){if("production"!==e.env.NODE_ENV){var a=null,s=function(){return n.enableMeasure?(a||(a=n.storedMeasure(t,o,r)),a.apply(this,arguments)):r.apply(this,arguments)};return s.displayName=t+"_"+o,s}return r},injection:{injectMeasure:function(e){n.storedMeasure=e}}};t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js":[function(e,t,o){(function(e){"use strict";var o={};"production"!==e.env.NODE_ENV&&(o={prop:"prop",context:"context",childContext:"child context"}),t.exports=o}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypeLocations.js"][0].apply(o,arguments)},{"fbjs/lib/keyMirror":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyMirror.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactPropTypes.js"][0].apply(o,arguments)},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocationNames":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconcileTransaction.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconcileTransaction.js"][0].apply(o,arguments)},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactDOMFeatureFlags":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDOMFeatureFlags.js","./ReactInputSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactReconciler.js"][0].apply(o,arguments)},{"./ReactRef":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRef.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRef.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRef.js"][0].apply(o,arguments)},{"./ReactOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactOwner.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactRootIndex.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerBatchingStrategy.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerBatchingStrategy.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRendering.js":[function(e,t,o){(function(o){"use strict";function n(e){s.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?m(!1,"renderToString(): You must pass a valid ReactElement."):m(!1);var t;try{u.injection.injectBatchingStrategy(c);var n=l.createReactRootID();return t=d.getPooled(!1),t.perform(function(){var o=b(e,null),r=o.mountComponent(n,t,p);return i.addChecksumToMarkup(r)},null)}finally{d.release(t),u.injection.injectBatchingStrategy(a)}}function r(e){s.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?m(!1,"renderToStaticMarkup(): You must pass a valid ReactElement."):m(!1);var t;try{u.injection.injectBatchingStrategy(c);var n=l.createReactRootID();return t=d.getPooled(!0),t.perform(function(){var o=b(e,null);return o.mountComponent(n,t,p)},null)}finally{d.release(t),u.injection.injectBatchingStrategy(a)}}var a=e("./ReactDefaultBatchingStrategy"),s=e("./ReactElement"),l=e("./ReactInstanceHandles"),i=e("./ReactMarkupChecksum"),c=e("./ReactServerBatchingStrategy"),d=e("./ReactServerRenderingTransaction"),u=e("./ReactUpdates"),p=e("fbjs/lib/emptyObject"),b=e("./instantiateReactComponent"),m=e("fbjs/lib/invariant");t.exports={renderToString:n,renderToStaticMarkup:r}}).call(this,e("_process"))},{"./ReactDefaultBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMarkupChecksum":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js","./ReactServerBatchingStrategy":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerBatchingStrategy.js","./ReactServerRenderingTransaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRenderingTransaction.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./instantiateReactComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyObject":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyObject.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactServerRenderingTransaction.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactServerRenderingTransaction.js"][0].apply(o,arguments)},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js":[function(e,t,o){(function(o){"use strict";function n(e){i.enqueueUpdate(e)}function r(e,t){var n=l.get(e);return n?("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?u(null==a.current,"%s(...): Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.",t):void 0),n):("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?u(!t,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op. Please check the code for the %s component.",t,t,e.constructor.displayName):void 0),null)}var a=e("./ReactCurrentOwner"),s=e("./ReactElement"),l=e("./ReactInstanceMap"),i=e("./ReactUpdates"),c=e("./Object.assign"),d=e("fbjs/lib/invariant"),u=e("fbjs/lib/warning"),p={isMounted:function(e){if("production"!==o.env.NODE_ENV){var t=a.current;null!==t&&("production"!==o.env.NODE_ENV?u(t._warnedAboutRefsInRender,"%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):void 0,t._warnedAboutRefsInRender=!0)}var n=l.get(e);return n?!!n._renderedComponent:!1},enqueueCallback:function(e,t){"function"!=typeof t?"production"!==o.env.NODE_ENV?d(!1,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):d(!1):void 0;var a=r(e);return a?(a._pendingCallbacks?a._pendingCallbacks.push(t):a._pendingCallbacks=[t],void n(a)):null},enqueueCallbackInternal:function(e,t){"function"!=typeof t?"production"!==o.env.NODE_ENV?d(!1,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):d(!1):void 0,e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],n(e)},enqueueForceUpdate:function(e){var t=r(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,n(t))},enqueueReplaceState:function(e,t){var o=r(e,"replaceState");o&&(o._pendingStateQueue=[t],o._pendingReplaceState=!0,n(o))},enqueueSetState:function(e,t){var o=r(e,"setState");if(o){var a=o._pendingStateQueue||(o._pendingStateQueue=[]);a.push(t),n(o)}},enqueueSetProps:function(e,t){var o=r(e,"setProps");o&&p.enqueueSetPropsInternal(o,t)},enqueueSetPropsInternal:function(e,t){var r=e._topLevelWrapper;r?void 0:"production"!==o.env.NODE_ENV?d(!1,"setProps(...): You called `setProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):d(!1);var a=r._pendingElement||r._currentElement,l=a.props,i=c({},l.props,t);r._pendingElement=s.cloneAndReplaceProps(a,s.cloneAndReplaceProps(l,i)),n(r)},enqueueReplaceProps:function(e,t){var o=r(e,"replaceProps");o&&p.enqueueReplacePropsInternal(o,t)},enqueueReplacePropsInternal:function(e,t){var r=e._topLevelWrapper;r?void 0:"production"!==o.env.NODE_ENV?d(!1,"replaceProps(...): You called `replaceProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):d(!1);var a=r._pendingElement||r._currentElement,l=a.props;r._pendingElement=s.cloneAndReplaceProps(a,s.cloneAndReplaceProps(l,t)),n(r)},enqueueElementInternal:function(e,t){e._pendingElement=t,n(e)}};t.exports=p}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactUpdates":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js":[function(e,t,o){(function(o){"use strict";function n(){O.ReactReconcileTransaction&&N?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must inject a reconcile transaction class and batching strategy"):h(!1)}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=d.getPooled(),this.reconcileTransaction=O.ReactReconcileTransaction.getPooled(!1)}function a(e,t,o,r,a,s){n(),N.batchedUpdates(e,t,o,r,a,s)}function s(e,t){return e._mountOrder-t._mountOrder}function l(e){var t=e.dirtyComponentsLength;t!==v.length?"production"!==o.env.NODE_ENV?h(!1,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",t,v.length):h(!1):void 0,v.sort(s);for(var n=0;t>n;n++){var r=v[n],a=r._pendingCallbacks;if(r._pendingCallbacks=null,b.performUpdateIfNecessary(r,e.reconcileTransaction),a)for(var l=0;l<a.length;l++)e.callbackQueue.enqueue(a[l],r.getPublicInstance())}}function i(e){return n(),N.isBatchingUpdates?void v.push(e):void N.batchedUpdates(i,e)}function c(e,t){N.isBatchingUpdates?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."):h(!1),_.enqueue(e,t),g=!0}var d=e("./CallbackQueue"),u=e("./PooledClass"),p=e("./ReactPerf"),b=e("./ReactReconciler"),m=e("./Transaction"),f=e("./Object.assign"),h=e("fbjs/lib/invariant"),v=[],_=d.getPooled(),g=!1,N=null,y={initialize:function(){this.dirtyComponentsLength=v.length},close:function(){this.dirtyComponentsLength!==v.length?(v.splice(0,this.dirtyComponentsLength),C()):v.length=0}},E={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},j=[y,E];f(r.prototype,m.Mixin,{getTransactionWrappers:function(){return j},destructor:function(){this.dirtyComponentsLength=null,d.release(this.callbackQueue),this.callbackQueue=null,O.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,o){return m.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,o)}}),u.addPoolingTo(r);var C=function(){for(;v.length||g;){if(v.length){var e=r.getPooled();e.perform(l,null,e),r.release(e)}if(g){g=!1;var t=_;_=d.getPooled(),t.notifyAll(),d.release(t)}}};C=p.measure("ReactUpdates","flushBatchedUpdates",C);var R={injectReconcileTransaction:function(e){e?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide a reconcile transaction class"):h(!1),O.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e?void 0:"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide a batching strategy"):h(!1),"function"!=typeof e.batchedUpdates?"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide a batchedUpdates() function"):h(!1):void 0,"boolean"!=typeof e.isBatchingUpdates?"production"!==o.env.NODE_ENV?h(!1,"ReactUpdates: must provide an isBatchingUpdates boolean attribute"):h(!1):void 0,N=e}},O={ReactReconcileTransaction:null,batchedUpdates:a,enqueueUpdate:i,flushBatchedUpdates:C,injection:R,asap:c};t.exports=O}).call(this,e("_process"))},{"./CallbackQueue":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactPerf":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./Transaction":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactVersion.js":[function(e,t,o){"use strict";t.exports="0.14.0"},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SVGDOMPropertyConfig.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SVGDOMPropertyConfig.js"][0].apply(o,arguments)},{"./DOMProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/DOMProperty.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SelectEventPlugin.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SelectEventPlugin.js"][0].apply(o,arguments)},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactInputSelection":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./isTextInputElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js","fbjs/lib/getActiveElement":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/getActiveElement.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js","fbjs/lib/shallowEqual":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/shallowEqual.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ServerReactRootIndex.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ServerReactRootIndex.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SimpleEventPlugin.js":[function(e,t,o){ (function(o){"use strict";var n=e("./EventConstants"),r=e("fbjs/lib/EventListener"),a=e("./EventPropagators"),s=e("./ReactMount"),l=e("./SyntheticClipboardEvent"),i=e("./SyntheticEvent"),c=e("./SyntheticFocusEvent"),d=e("./SyntheticKeyboardEvent"),u=e("./SyntheticMouseEvent"),p=e("./SyntheticDragEvent"),b=e("./SyntheticTouchEvent"),m=e("./SyntheticUIEvent"),f=e("./SyntheticWheelEvent"),h=e("fbjs/lib/emptyFunction"),v=e("./getEventCharCode"),_=e("fbjs/lib/invariant"),g=e("fbjs/lib/keyOf"),N=n.topLevelTypes,y={abort:{phasedRegistrationNames:{bubbled:g({onAbort:!0}),captured:g({onAbortCapture:!0})}},blur:{phasedRegistrationNames:{bubbled:g({onBlur:!0}),captured:g({onBlurCapture:!0})}},canPlay:{phasedRegistrationNames:{bubbled:g({onCanPlay:!0}),captured:g({onCanPlayCapture:!0})}},canPlayThrough:{phasedRegistrationNames:{bubbled:g({onCanPlayThrough:!0}),captured:g({onCanPlayThroughCapture:!0})}},click:{phasedRegistrationNames:{bubbled:g({onClick:!0}),captured:g({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:g({onContextMenu:!0}),captured:g({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:g({onCopy:!0}),captured:g({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:g({onCut:!0}),captured:g({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:g({onDoubleClick:!0}),captured:g({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:g({onDrag:!0}),captured:g({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:g({onDragEnd:!0}),captured:g({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:g({onDragEnter:!0}),captured:g({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:g({onDragExit:!0}),captured:g({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:g({onDragLeave:!0}),captured:g({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:g({onDragOver:!0}),captured:g({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:g({onDragStart:!0}),captured:g({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:g({onDrop:!0}),captured:g({onDropCapture:!0})}},durationChange:{phasedRegistrationNames:{bubbled:g({onDurationChange:!0}),captured:g({onDurationChangeCapture:!0})}},emptied:{phasedRegistrationNames:{bubbled:g({onEmptied:!0}),captured:g({onEmptiedCapture:!0})}},encrypted:{phasedRegistrationNames:{bubbled:g({onEncrypted:!0}),captured:g({onEncryptedCapture:!0})}},ended:{phasedRegistrationNames:{bubbled:g({onEnded:!0}),captured:g({onEndedCapture:!0})}},error:{phasedRegistrationNames:{bubbled:g({onError:!0}),captured:g({onErrorCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:g({onFocus:!0}),captured:g({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:g({onInput:!0}),captured:g({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:g({onKeyDown:!0}),captured:g({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:g({onKeyPress:!0}),captured:g({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:g({onKeyUp:!0}),captured:g({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:g({onLoad:!0}),captured:g({onLoadCapture:!0})}},loadedData:{phasedRegistrationNames:{bubbled:g({onLoadedData:!0}),captured:g({onLoadedDataCapture:!0})}},loadedMetadata:{phasedRegistrationNames:{bubbled:g({onLoadedMetadata:!0}),captured:g({onLoadedMetadataCapture:!0})}},loadStart:{phasedRegistrationNames:{bubbled:g({onLoadStart:!0}),captured:g({onLoadStartCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:g({onMouseDown:!0}),captured:g({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:g({onMouseMove:!0}),captured:g({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:g({onMouseOut:!0}),captured:g({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:g({onMouseOver:!0}),captured:g({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:g({onMouseUp:!0}),captured:g({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:g({onPaste:!0}),captured:g({onPasteCapture:!0})}},pause:{phasedRegistrationNames:{bubbled:g({onPause:!0}),captured:g({onPauseCapture:!0})}},play:{phasedRegistrationNames:{bubbled:g({onPlay:!0}),captured:g({onPlayCapture:!0})}},playing:{phasedRegistrationNames:{bubbled:g({onPlaying:!0}),captured:g({onPlayingCapture:!0})}},progress:{phasedRegistrationNames:{bubbled:g({onProgress:!0}),captured:g({onProgressCapture:!0})}},rateChange:{phasedRegistrationNames:{bubbled:g({onRateChange:!0}),captured:g({onRateChangeCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:g({onReset:!0}),captured:g({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:g({onScroll:!0}),captured:g({onScrollCapture:!0})}},seeked:{phasedRegistrationNames:{bubbled:g({onSeeked:!0}),captured:g({onSeekedCapture:!0})}},seeking:{phasedRegistrationNames:{bubbled:g({onSeeking:!0}),captured:g({onSeekingCapture:!0})}},stalled:{phasedRegistrationNames:{bubbled:g({onStalled:!0}),captured:g({onStalledCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:g({onSubmit:!0}),captured:g({onSubmitCapture:!0})}},suspend:{phasedRegistrationNames:{bubbled:g({onSuspend:!0}),captured:g({onSuspendCapture:!0})}},timeUpdate:{phasedRegistrationNames:{bubbled:g({onTimeUpdate:!0}),captured:g({onTimeUpdateCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:g({onTouchCancel:!0}),captured:g({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:g({onTouchEnd:!0}),captured:g({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:g({onTouchMove:!0}),captured:g({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:g({onTouchStart:!0}),captured:g({onTouchStartCapture:!0})}},volumeChange:{phasedRegistrationNames:{bubbled:g({onVolumeChange:!0}),captured:g({onVolumeChangeCapture:!0})}},waiting:{phasedRegistrationNames:{bubbled:g({onWaiting:!0}),captured:g({onWaitingCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:g({onWheel:!0}),captured:g({onWheelCapture:!0})}}},E={topAbort:y.abort,topBlur:y.blur,topCanPlay:y.canPlay,topCanPlayThrough:y.canPlayThrough,topClick:y.click,topContextMenu:y.contextMenu,topCopy:y.copy,topCut:y.cut,topDoubleClick:y.doubleClick,topDrag:y.drag,topDragEnd:y.dragEnd,topDragEnter:y.dragEnter,topDragExit:y.dragExit,topDragLeave:y.dragLeave,topDragOver:y.dragOver,topDragStart:y.dragStart,topDrop:y.drop,topDurationChange:y.durationChange,topEmptied:y.emptied,topEncrypted:y.encrypted,topEnded:y.ended,topError:y.error,topFocus:y.focus,topInput:y.input,topKeyDown:y.keyDown,topKeyPress:y.keyPress,topKeyUp:y.keyUp,topLoad:y.load,topLoadedData:y.loadedData,topLoadedMetadata:y.loadedMetadata,topLoadStart:y.loadStart,topMouseDown:y.mouseDown,topMouseMove:y.mouseMove,topMouseOut:y.mouseOut,topMouseOver:y.mouseOver,topMouseUp:y.mouseUp,topPaste:y.paste,topPause:y.pause,topPlay:y.play,topPlaying:y.playing,topProgress:y.progress,topRateChange:y.rateChange,topReset:y.reset,topScroll:y.scroll,topSeeked:y.seeked,topSeeking:y.seeking,topStalled:y.stalled,topSubmit:y.submit,topSuspend:y.suspend,topTimeUpdate:y.timeUpdate,topTouchCancel:y.touchCancel,topTouchEnd:y.touchEnd,topTouchMove:y.touchMove,topTouchStart:y.touchStart,topVolumeChange:y.volumeChange,topWaiting:y.waiting,topWheel:y.wheel};for(var j in E)E[j].dependencies=[j];var C=g({onClick:null}),R={},O={eventTypes:y,extractEvents:function(e,t,n,r,s){var h=E[e];if(!h)return null;var g;switch(e){case N.topAbort:case N.topCanPlay:case N.topCanPlayThrough:case N.topDurationChange:case N.topEmptied:case N.topEncrypted:case N.topEnded:case N.topError:case N.topInput:case N.topLoad:case N.topLoadedData:case N.topLoadedMetadata:case N.topLoadStart:case N.topPause:case N.topPlay:case N.topPlaying:case N.topProgress:case N.topRateChange:case N.topReset:case N.topSeeked:case N.topSeeking:case N.topStalled:case N.topSubmit:case N.topSuspend:case N.topTimeUpdate:case N.topVolumeChange:case N.topWaiting:g=i;break;case N.topKeyPress:if(0===v(r))return null;case N.topKeyDown:case N.topKeyUp:g=d;break;case N.topBlur:case N.topFocus:g=c;break;case N.topClick:if(2===r.button)return null;case N.topContextMenu:case N.topDoubleClick:case N.topMouseDown:case N.topMouseMove:case N.topMouseOut:case N.topMouseOver:case N.topMouseUp:g=u;break;case N.topDrag:case N.topDragEnd:case N.topDragEnter:case N.topDragExit:case N.topDragLeave:case N.topDragOver:case N.topDragStart:case N.topDrop:g=p;break;case N.topTouchCancel:case N.topTouchEnd:case N.topTouchMove:case N.topTouchStart:g=b;break;case N.topScroll:g=m;break;case N.topWheel:g=f;break;case N.topCopy:case N.topCut:case N.topPaste:g=l}g?void 0:"production"!==o.env.NODE_ENV?_(!1,"SimpleEventPlugin: Unhandled event type, `%s`.",e):_(!1);var y=g.getPooled(h,n,r,s);return a.accumulateTwoPhaseDispatches(y),y},didPutListener:function(e,t,o){if(t===C){var n=s.getNode(e);R[e]||(R[e]=r.listen(n,"click",h))}},willDeleteListener:function(e,t){t===C&&(R[e].remove(),delete R[e])}};t.exports=O}).call(this,e("_process"))},{"./EventConstants":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./SyntheticClipboardEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticClipboardEvent.js","./SyntheticDragEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticDragEvent.js","./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./SyntheticFocusEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticFocusEvent.js","./SyntheticKeyboardEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticKeyboardEvent.js","./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js","./SyntheticTouchEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticTouchEvent.js","./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./SyntheticWheelEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticWheelEvent.js","./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/EventListener":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/EventListener.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/keyOf":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/keyOf.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticClipboardEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticClipboardEvent.js"][0].apply(o,arguments)},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticCompositionEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticCompositionEvent.js"][0].apply(o,arguments)},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticDragEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticDragEvent.js"][0].apply(o,arguments)},{"./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js":[function(e,t,o){(function(o){"use strict";function n(e,t,o,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=o,this.target=n,this.currentTarget=n;var r=this.constructor.Interface;for(var a in r)if(r.hasOwnProperty(a)){var l=r[a];l?this[a]=l(o):this[a]=o[a]}var i=null!=o.defaultPrevented?o.defaultPrevented:o.returnValue===!1;i?this.isDefaultPrevented=s.thatReturnsTrue:this.isDefaultPrevented=s.thatReturnsFalse,this.isPropagationStopped=s.thatReturnsFalse}var r=e("./PooledClass"),a=e("./Object.assign"),s=e("fbjs/lib/emptyFunction"),l=e("fbjs/lib/warning"),i={type:null,currentTarget:s.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};a(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?l(e,"This synthetic event is reused for performance reasons. If you're seeing this, you're calling `preventDefault` on a released/nullified synthetic event. This is a no-op. See https://fb.me/react-event-pooling for more information."):void 0),e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=s.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?l(e,"This synthetic event is reused for performance reasons. If you're seeing this, you're calling `stopPropagation` on a released/nullified synthetic event. This is a no-op. See https://fb.me/react-event-pooling for more information."):void 0),e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=s.thatReturnsTrue)},persist:function(){this.isPersistent=s.thatReturnsTrue},isPersistent:s.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),n.Interface=i,n.augmentClass=function(e,t){var o=this,n=Object.create(o.prototype);a(n,e.prototype),e.prototype=n,e.prototype.constructor=e,e.Interface=a({},o.Interface,t),e.augmentClass=o.augmentClass,r.addPoolingTo(e,r.fourArgumentPooler)},r.addPoolingTo(n,r.fourArgumentPooler),t.exports=n}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/PooledClass.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticFocusEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticFocusEvent.js"][0].apply(o,arguments)},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticInputEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticInputEvent.js"][0].apply(o,arguments)},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticKeyboardEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticKeyboardEvent.js"][0].apply(o,arguments)},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js","./getEventKey":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventKey.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticMouseEvent.js"][0].apply(o,arguments)},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./ViewportMetrics":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticTouchEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticTouchEvent.js"][0].apply(o,arguments)},{"./SyntheticUIEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./getEventModifierState":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticUIEvent.js"][0].apply(o,arguments)},{"./SyntheticEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticWheelEvent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/SyntheticWheelEvent.js"][0].apply(o,arguments)},{"./SyntheticMouseEvent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Transaction.js":[function(e,t,o){(function(o){"use strict";var n=e("fbjs/lib/invariant"),r={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,r,a,s,l,i,c){this.isInTransaction()?"production"!==o.env.NODE_ENV?n(!1,"Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction."):n(!1):void 0;var d,u;try{this._isInTransaction=!0,d=!0,this.initializeAll(0),u=e.call(t,r,a,s,l,i,c),d=!1}finally{try{if(d)try{this.closeAll(0)}catch(p){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return u},initializeAll:function(e){for(var t=this.transactionWrappers,o=e;o<t.length;o++){var n=t[o];try{this.wrapperInitData[o]=a.OBSERVED_ERROR,this.wrapperInitData[o]=n.initialize?n.initialize.call(this):null}finally{if(this.wrapperInitData[o]===a.OBSERVED_ERROR)try{this.initializeAll(o+1)}catch(r){}}}},closeAll:function(e){this.isInTransaction()?void 0:"production"!==o.env.NODE_ENV?n(!1,"Transaction.closeAll(): Cannot close transaction when none are open."):n(!1);for(var t=this.transactionWrappers,r=e;r<t.length;r++){var s,l=t[r],i=this.wrapperInitData[r];try{s=!0,i!==a.OBSERVED_ERROR&&l.close&&l.close.call(this,i),s=!1}finally{if(s)try{this.closeAll(r+1)}catch(c){}}}this.wrapperInitData.length=0}},a={Mixin:r,OBSERVED_ERROR:{}};t.exports=a}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ViewportMetrics.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/accumulateInto.js":[function(e,t,o){(function(o){"use strict";function n(e,t){if(null==t?"production"!==o.env.NODE_ENV?r(!1,"accumulateInto(...): Accumulated items must not be null or undefined."):r(!1):void 0,null==e)return t;var n=Array.isArray(e),a=Array.isArray(t);return n&&a?(e.push.apply(e,t),e):n?(e.push(t),e):a?[e].concat(t):[e,t]}var r=e("fbjs/lib/invariant");t.exports=n}).call(this,e("_process"))},{_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/adler32.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/adler32.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/dangerousStyleValue.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/dangerousStyleValue.js"][0].apply(o,arguments)},{"./CSSProperty":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/CSSProperty.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/deprecated.js":[function(e,t,o){(function(o){"use strict";function n(e,t,n,s,l){var i=!1;if("production"!==o.env.NODE_ENV){var c=function(){return"production"!==o.env.NODE_ENV?a(i,"React.%s is deprecated. Please use %s.%s from require('%s') instead.",e,t,e,n):void 0,i=!0,l.apply(s,arguments)};return r(c,l)}return l}var r=e("./Object.assign"),a=e("fbjs/lib/warning");t.exports=n}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/escapeTextContentForBrowser.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/findDOMNode.js":[function(e,t,o){(function(o){"use strict";function n(e){if("production"!==o.env.NODE_ENV){var t=r.current;null!==t&&("production"!==o.env.NODE_ENV?i(t._warnedAboutRefsInRender,"%s is accessing getDOMNode or findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",t.getName()||"A component"):void 0,t._warnedAboutRefsInRender=!0)}return null==e?null:1===e.nodeType?e:a.has(e)?s.getNodeFromInstance(e):(null!=e.render&&"function"==typeof e.render?"production"!==o.env.NODE_ENV?l(!1,"findDOMNode was called on an unmounted component."):l(!1):void 0,void("production"!==o.env.NODE_ENV?l(!1,"Element appears to be neither ReactComponent nor DOMNode (keys: %s)",Object.keys(e)):l(!1)))}var r=e("./ReactCurrentOwner"),a=e("./ReactInstanceMap"),s=e("./ReactMount"),l=e("fbjs/lib/invariant"),i=e("fbjs/lib/warning");t.exports=n}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactInstanceMap":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/flattenChildren.js":[function(e,t,o){(function(o){"use strict";function n(e,t,n){var r=e,a=void 0===r[n];"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?s(a,"flattenChildren(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",n):void 0),a&&null!=t&&(r[n]=t)}function r(e){if(null==e)return e;var t={};return a(e,n,t),t}var a=e("./traverseAllChildren"),s=e("fbjs/lib/warning");t.exports=r}).call(this,e("_process"))},{"./traverseAllChildren":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/forEachAccumulated.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventCharCode.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventKey.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventKey.js"][0].apply(o,arguments)},{"./getEventCharCode":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventModifierState.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getEventTarget.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getEventTarget.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getIteratorFn.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getNodeForCharacterOffset.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getNodeForCharacterOffset.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/getTextContentAccessor.js"][0].apply(o,arguments)},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js":[function(e,t,o){(function(o){"use strict";function n(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e){var t;if(null===e||e===!1)t=new l(a);else if("object"==typeof e){var s=e;!s||"function"!=typeof s.type&&"string"!=typeof s.type?"production"!==o.env.NODE_ENV?d(!1,"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",null==s.type?s.type:typeof s.type,n(s._owner)):d(!1):void 0,t="string"==typeof s.type?i.createInternalComponent(s):r(s.type)?new s.type(s):new p}else"string"==typeof e||"number"==typeof e?t=i.createInstanceForText(e):"production"!==o.env.NODE_ENV?d(!1,"Encountered invalid React node of type %s",typeof e):d(!1);return"production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?u("function"==typeof t.construct&&"function"==typeof t.mountComponent&&"function"==typeof t.receiveComponent&&"function"==typeof t.unmountComponent,"Only React Components can be mounted."):void 0),t.construct(e),t._mountIndex=0,t._mountImage=null,"production"!==o.env.NODE_ENV&&(t._isOwnerNecessary=!1,t._warnedAboutRefsInRender=!1),"production"!==o.env.NODE_ENV&&Object.preventExtensions&&Object.preventExtensions(t),t}var s=e("./ReactCompositeComponent"),l=e("./ReactEmptyComponent"),i=e("./ReactNativeComponent"),c=e("./Object.assign"),d=e("fbjs/lib/invariant"),u=e("fbjs/lib/warning"),p=function(){};c(p.prototype,s.Mixin,{_instantiateReactComponent:a}),t.exports=a}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCompositeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCompositeComponent.js","./ReactEmptyComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isEventSupported.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isEventSupported.js"][0].apply(o,arguments)},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/isTextInputElement.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/onlyChild.js":[function(e,t,o){(function(o){"use strict";function n(e){return r.isValidElement(e)?void 0:"production"!==o.env.NODE_ENV?a(!1,"onlyChild must be passed a children with exactly one child."):a(!1),e}var r=e("./ReactElement"),a=e("fbjs/lib/invariant");t.exports=n}).call(this,e("_process"))},{"./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/quoteAttributeValueForBrowser.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/quoteAttributeValueForBrowser.js"][0].apply(o,arguments)},{"./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/renderSubtreeIntoContainer.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/renderSubtreeIntoContainer.js"][0].apply(o,arguments); },{"./ReactMount":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactMount.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setInnerHTML.js"][0].apply(o,arguments)},{"fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setTextContent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/setTextContent.js"][0].apply(o,arguments)},{"./escapeTextContentForBrowser":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./setInnerHTML":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js","fbjs/lib/ExecutionEnvironment":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/ExecutionEnvironment.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/shouldUpdateReactComponent.js"][0].apply(o,arguments)},{}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js":[function(e,t,o){(function(o){"use strict";function n(e){return v[e]}function r(e,t){return e&&null!=e.key?s(e.key):t.toString(36)}function a(e){return(""+e).replace(_,n)}function s(e){return"$"+a(e)}function l(e,t,n,a){var i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||d.isValidElement(e))return n(a,e,""===t?f+r(e,0):t),1;var u,v,_=0,N=""===t?f:t+h;if(Array.isArray(e))for(var y=0;y<e.length;y++)u=e[y],v=N+r(u,y),_+=l(u,v,n,a);else{var E=p(e);if(E){var j,C=E.call(e);if(E!==e.entries)for(var R=0;!(j=C.next()).done;)u=j.value,v=N+r(u,R++),_+=l(u,v,n,a);else for("production"!==o.env.NODE_ENV&&("production"!==o.env.NODE_ENV?m(g,"Using Maps as children is not yet fully supported. It is an experimental feature that might be removed. Convert it to a sequence / iterable of keyed ReactElements instead."):void 0,g=!0);!(j=C.next()).done;){var O=j.value;O&&(u=O[1],v=N+s(O[0])+h+r(u,0),_+=l(u,v,n,a))}}else if("object"===i){var D="";if("production"!==o.env.NODE_ENV&&(D=" If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons.",e._isReactElement&&(D=" It looks like you're using an element created by a different version of React. Make sure to use only one copy of React."),c.current)){var U=c.current.getName();U&&(D+=" Check the render method of `"+U+"`.")}var w=String(e);"production"!==o.env.NODE_ENV?b(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===w?"object with keys {"+Object.keys(e).join(", ")+"}":w,D):b(!1)}}return _}function i(e,t,o){return null==e?0:l(e,"",t,o)}var c=e("./ReactCurrentOwner"),d=e("./ReactElement"),u=e("./ReactInstanceHandles"),p=e("./getIteratorFn"),b=e("fbjs/lib/invariant"),m=e("fbjs/lib/warning"),f=u.SEPARATOR,h=":",v={"=":"=0",".":"=1",":":"=2"},_=/[=.:]/g,g=!1;t.exports=i}).call(this,e("_process"))},{"./ReactCurrentOwner":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./getIteratorFn":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/invariant":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/invariant.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/validateDOMNesting.js":[function(e,t,o){(function(o){"use strict";var n=e("./Object.assign"),r=e("fbjs/lib/emptyFunction"),a=e("fbjs/lib/warning"),s=r;if("production"!==o.env.NODE_ENV){var l=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],i=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],c=i.concat(["button"]),d=["dd","dt","li","option","optgroup","p","rp","rt"],u={parentTag:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null},p=function(e,t,o){var r=n({},e||u),a={tag:t,instance:o};return-1!==i.indexOf(t)&&(r.aTagInScope=null,r.buttonTagInScope=null,r.nobrTagInScope=null),-1!==c.indexOf(t)&&(r.pTagInButtonScope=null),-1!==l.indexOf(t)&&"address"!==t&&"div"!==t&&"p"!==t&&(r.listItemTagAutoclosing=null,r.dlItemTagAutoclosing=null),r.parentTag=a,"form"===t&&(r.formTag=a),"a"===t&&(r.aTagInScope=a),"button"===t&&(r.buttonTagInScope=a),"nobr"===t&&(r.nobrTagInScope=a),"p"===t&&(r.pTagInButtonScope=a),"li"===t&&(r.listItemTagAutoclosing=a),"dd"!==t&&"dt"!==t||(r.dlItemTagAutoclosing=a),r},b=function(e,t){switch(t){case"select":return"option"===e||"optgroup"===e||"#text"===e;case"optgroup":return"option"===e||"#text"===e;case"option":return"#text"===e;case"tr":return"th"===e||"td"===e||"style"===e||"script"===e||"template"===e;case"tbody":case"thead":case"tfoot":return"tr"===e||"style"===e||"script"===e||"template"===e;case"colgroup":return"col"===e||"template"===e;case"table":return"caption"===e||"colgroup"===e||"tbody"===e||"tfoot"===e||"thead"===e||"style"===e||"script"===e||"template"===e;case"head":return"base"===e||"basefont"===e||"bgsound"===e||"link"===e||"meta"===e||"title"===e||"noscript"===e||"noframes"===e||"style"===e||"script"===e||"template"===e;case"html":return"head"===e||"body"===e}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t;case"rp":case"rt":return-1===d.indexOf(t);case"caption":case"col":case"colgroup":case"frame":case"head":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return null==t}return!0},m=function(e,t){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t.pTagInButtonScope;case"form":return t.formTag||t.pTagInButtonScope;case"li":return t.listItemTagAutoclosing;case"dd":case"dt":return t.dlItemTagAutoclosing;case"button":return t.buttonTagInScope;case"a":return t.aTagInScope;case"nobr":return t.nobrTagInScope}return null},f=function(e){if(!e)return[];var t=[];do t.push(e);while(e=e._currentElement._owner);return t.reverse(),t},h={};s=function(e,t,n){n=n||u;var r=n.parentTag,s=r&&r.tag,l=b(e,s)?null:r,i=l?null:m(e,n),c=l||i;if(c){var d,p=c.tag,v=c.instance,_=t&&t._currentElement._owner,g=v&&v._currentElement._owner,N=f(_),y=f(g),E=Math.min(N.length,y.length),j=-1;for(d=0;E>d&&N[d]===y[d];d++)j=d;var C="(unknown)",R=N.slice(j+1).map(function(e){return e.getName()||C}),O=y.slice(j+1).map(function(e){return e.getName()||C}),D=[].concat(-1!==j?N[j].getName()||C:[],O,p,i?["..."]:[],R,e).join(" > "),U=!!l+"|"+e+"|"+p+"|"+D;if(h[U])return;if(h[U]=!0,l){var w="";"table"===p&&"tr"===e&&(w+=" Add a <tbody> to your code to match the DOM tree generated by the browser."),"production"!==o.env.NODE_ENV?a(!1,"validateDOMNesting(...): <%s> cannot appear as a child of <%s>. See %s.%s",e,p,D,w):void 0}else"production"!==o.env.NODE_ENV?a(!1,"validateDOMNesting(...): <%s> cannot appear as a descendant of <%s>. See %s.",e,p,D):void 0}},s.ancestorInfoContextKey="__validateDOMNesting_ancestorInfo$"+Math.random().toString(36).slice(2),s.updatedAncestorInfo=p,s.isTagValidInContext=function(e,t){t=t||u;var o=t.parentTag,n=o&&o.tag;return b(e,n)&&!m(e,t)}}t.exports=s}).call(this,e("_process"))},{"./Object.assign":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/Object.assign.js",_process:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/process/browser.js","fbjs/lib/emptyFunction":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/emptyFunction.js","fbjs/lib/warning":"/Users/allen/Node/react-bootstrap-table/node_modules/fbjs/lib/warning.js"}],"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js":[function(e,t,o){arguments[4]["/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/node_modules/react/react.js"][0].apply(o,arguments)},{"./lib/React":"/Users/allen/Node/react-bootstrap-table/node_modules/react/lib/React.js"}],"/Users/allen/Node/react-bootstrap-table/src/BootstrapTable.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function _(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:_(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("classnames")),d=n(e("./Const")),u=n(e("./TableHeader")),p=n(e("./TableBody")),b=n(e("./pagination/PaginationList")),m=n(e("./toolbar/ToolBar")),f=n(e("./TableFilter")),h=e("./store/TableDataStore").TableDataStore,v=function(e){function t(e){var o=this;l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._attachCellEditFunc();var n=e.keyField,r={};if("string"==typeof n&&n.length||i.Children.forEach(this.props.children,function(e){if(e.props.isKey){if(null!=n)throw"Error. Multiple key column be detected in TableHeaderColumn.";n=e.props.dataField}},this),i.Children.forEach(this.props.children,function(e){e.props.sortFunc&&(r[e.props.dataField]=e.props.sortFunc)},this),null==n)throw"Error. No any key column defined in TableHeaderColumn. Use 'isKey={true}' to specify an unique column after version 0.5.4.";Array.isArray(this.props.data)?this.store=new h(this.props.data):(this.store=new h(this.props.data.getData()),this.props.data.clear(),this.props.data.on("change",function(e){o.store.setData(e),o.setState({data:o.getTableData()})})),this.store.setProps(this.props.pagination,n,r,this.isRemoteDataSource()),this.props.selectRow&&this.props.selectRow.selected&&this.store.setSelectedRowKey(this.props.selectRow.selected),this.state={data:this.getTableData(),selectedRowKeys:this.store.getSelectedRowKeys()}}return s(t,e),r(t,{getTableData:{value:function(){var e=[];if(this.props.pagination){var t=void 0,o=void 0;this.store.isChangedPage()?(o=this.refs.pagination.getSizePerPage(),t=this.refs.pagination.getCurrentPage()):(o=this.props.options.sizePerPage||d.SIZE_PER_PAGE_LIST[0],t=this.props.options.page||1),e=this.store.page(t,o).get()}else e=this.store.get();return e}},componentWillReceiveProps:{value:function(e){Array.isArray(e.data)&&(this.store.setData(e.data),this.setState({data:this.getTableData()})),e.selectRow&&e.selectRow.selected&&(this.store.setSelectedRowKey(e.selectRow.selected),this.setState({selectedRowKeys:e.selectRow.selected}))}},componentDidMount:{value:function(){this._adjustHeaderWidth(),window.addEventListener("resize",this._adjustHeaderWidth.bind(this))}},componentWillUnmount:{value:function(){window.removeEventListener("resize",this._adjustHeaderWidth.bind(this))}},componentDidUpdate:{value:function(){this._adjustHeaderWidth(),this._attachCellEditFunc(),this.props.options.afterTableComplete&&this.props.options.afterTableComplete()}},_attachCellEditFunc:{value:function(){this.props.cellEdit&&(this.props.cellEdit.__onCompleteEdit__=this.handleEditCell.bind(this),this.props.cellEdit.mode!==d.CELL_EDIT_NONE&&(this.props.selectRow.clickToSelect=!1))}},isRemoteDataSource:{value:function(e){return(e||this.props).remote}},render:{value:function(){var e=c("react-bs-table"),t=this.props.children,o={height:this.props.height};Array.isArray(this.props.children)||(t=[this.props.children]);var n=t.map(function(e,t){return{name:e.props.dataField,align:e.props.dataAlign,sort:e.props.dataSort,format:e.props.dataFormat,editable:e.props.editable,hidden:e.props.hidden,className:e.props.columnClassName,width:e.props.width,index:t}},this),r=this.renderPagination(),a=this.renderToolBar(),s=this.renderTableFilter(n);return i.createElement("div",{className:"react-bs-container"},a,i.createElement("div",{ref:"table",style:o,className:e},i.createElement(u,{rowSelectType:this.props.selectRow.mode,hideSelectColumn:this.props.selectRow.hideSelectColumn,sortName:this.props.options.sortName,sortOrder:this.props.options.sortOrder,onSort:this.handleSort.bind(this),onSelectAllRow:this.handleSelectAllRow.bind(this),bordered:this.props.bordered},this.props.children),i.createElement(p,{ref:"body",data:this.state.data,columns:n,trClassName:this.props.trClassName,striped:this.props.striped,bordered:this.props.bordered,hover:this.props.hover,keyField:this.store.getKeyField(),condensed:this.props.condensed,selectRow:this.props.selectRow,cellEdit:this.props.cellEdit,selectedRowKeys:this.state.selectedRowKeys,onSelectRow:this.handleSelectRow.bind(this)}),s,r))}},handleSort:{value:function(e,t){if(this.props.options.onSortChange&&this.props.options.onSortChange(t,e,this.props),!this.isRemoteDataSource()){var o=this.store.sort(e,t).get();this.setState({data:o})}}},handlePaginationData:{value:function(e,t){var o=this.props.options.onPageChange;if(o&&o(e,t),!this.isRemoteDataSource()){var n=this.store.page(e,t).get();this.setState({data:n})}}},handleSelectAllRow:{value:function(e){var t=e.currentTarget.checked,o=[];t&&(o=this.store.getAllRowkey()),this.store.setSelectedRowKey(o),this.setState({selectedRowKeys:o}),this.props.selectRow.onSelectAll&&this.props.selectRow.onSelectAll(t,t?this.store.get():[])}},handleSelectRow:{value:function(e,t){var o=this.store.getSelectedRowKeys(),n=e[this.store.getKeyField()];this.props.selectRow.mode===d.ROW_SELECT_SINGLE?o=t?[n]:[]:t?o.push(n):o=o.filter(function(e){return n!==e}),this.store.setSelectedRowKey(o),this.setState({selectedRowKeys:o}),this.props.selectRow.onSelect&&this.props.selectRow.onSelect(e,t)}},handleEditCell:{value:function(e,t,o){var n=void 0;i.Children.forEach(this.props.children,function(e,t){return t==o?(n=e.props.dataField,!1):void 0});var r=this.store.edit(e,t,n).get();this.setState({data:r}),this.props.cellEdit.afterSaveCell&&this.props.cellEdit.afterSaveCell(this.state.data[t],n,e)}},handleAddRowBegin:{value:function(){this.refs.body}},handleAddRow:{value:function(e){var t=void 0;try{this.store.add(e)}catch(o){return o}if(this.props.pagination){var n=this.refs.pagination.getSizePerPage(),r=Math.ceil(this.store.getDataNum()/n);t=this.store.page(r,n).get(),this.setState({data:t}),this.refs.pagination.changePage(r)}else t=this.store.get(),this.setState({data:t});this.props.options.afterInsertRow&&this.props.options.afterInsertRow(e)}},getSizePerPage:{value:function(){return this.props.pagination?this.refs.pagination.getSizePerPage():void 0}},getCurrentPage:{value:function(){return this.props.pagination?this.refs.pagination.getCurrentPage():void 0}},handleDropRow:{value:function(){var e=void 0,t=this.store.getSelectedRowKeys();if(!(t&&t.length>0)||confirm("Are you sure want delete?")){if(this.store.remove(t),this.store.setSelectedRowKey([]),this.props.pagination){var o=this.refs.pagination.getSizePerPage(),n=Math.ceil(this.store.getDataNum()/o),r=this.refs.pagination.getCurrentPage();r>n&&(r=n),e=this.store.page(r,o).get(),this.setState({data:e,selectedRowKeys:this.store.getSelectedRowKeys()}),this.refs.pagination.changePage(r)}else e=this.store.get(),this.setState({data:e,selectedRowKeys:this.store.getSelectedRowKeys()});this.props.options.afterDeleteRow&&this.props.options.afterDeleteRow(t)}}},handleFilterData:{value:function(e){this.store.filter(e);var t=void 0;if(this.props.pagination){var o=this.refs.pagination.getSizePerPage();t=this.store.page(1,o).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.setState({data:t})}},handleSearch:{value:function(e){this.store.search(e,this.props.multiColumnSearch);var t=void 0;if(this.props.pagination){var o=this.refs.pagination.getSizePerPage();t=this.store.page(1,o).get(),this.refs.pagination.changePage(1)}else t=this.store.get();this.setState({data:t})}},renderPagination:{value:function(){if(this.props.pagination){var e=void 0;return e=this.isRemoteDataSource()?this.props.fetchInfo.dataTotalSize:this.store.getDataNum(),i.createElement("div",null,i.createElement(b,{ref:"pagination",currPage:this.props.options.page||1,changePage:this.handlePaginationData.bind(this),sizePerPage:this.props.options.sizePerPage||d.SIZE_PER_PAGE_LIST[0],sizePerPageList:this.props.options.sizePerPageList||d.SIZE_PER_PAGE_LIST,paginationSize:this.props.options.paginationSize||d.PAGINATION_SIZE,remote:this.isRemoteDataSource(),dataSize:e}))}return null}},renderToolBar:{value:function(){var e=void 0;return e=Array.isArray(this.props.children)?this.props.children.map(function(e){var t=e.props;return{name:t.children,field:t.dataField,autoValue:t.autoValue||!1,editable:t.editable&&"function"==typeof t.editable?t.editable():t.editable,format:t.format?format:!1}}):[{name:this.props.children.props.children,field:this.props.children.props.dataField,editable:this.props.children.props.editable}],this.props.insertRow||this.props.deleteRow||this.props.search?i.createElement("div",{className:"tool-bar"},i.createElement(m,{enableInsert:this.props.insertRow,enableDelete:this.props.deleteRow,enableSearch:this.props.search,columns:e,searchPlaceholder:this.props.searchPlaceholder,onAddRow:this.handleAddRow.bind(this),onAddRowBegin:this.handleAddRowBegin.bind(this),onDropRow:this.handleDropRow.bind(this),onSearch:this.handleSearch.bind(this)})):null}},renderTableFilter:{value:function(e){return this.props.columnFilter?i.createElement(f,{columns:e,rowSelectType:this.props.selectRow.mode,onFilter:this.handleFilterData.bind(this)}):null}},_adjustHeaderWidth:{value:function(){var e=this.refs.table.childNodes[0].childNodes[0],t=this.refs.table.childNodes[1].childNodes[0];e.offsetWidth!==t.offsetWidth&&(e.style.width=t.offsetWidth+"px")}}}),t}(i.Component);v.propTypes={keyField:i.PropTypes.string,height:i.PropTypes.string,data:i.PropTypes.oneOfType([i.PropTypes.array,i.PropTypes.object]),remote:i.PropTypes.bool,striped:i.PropTypes.bool,bordered:i.PropTypes.bool,hover:i.PropTypes.bool,condensed:i.PropTypes.bool,pagination:i.PropTypes.bool,searchPlaceholder:i.PropTypes.string,selectRow:i.PropTypes.shape({mode:i.PropTypes.string,bgColor:i.PropTypes.string,selected:i.PropTypes.array,onSelect:i.PropTypes.func,onSelectAll:i.PropTypes.func,clickToSelect:i.PropTypes.bool,hideSelectColumn:i.PropTypes.bool,clickToSelectAndEditCell:i.PropTypes.bool}),cellEdit:i.PropTypes.shape({mode:i.PropTypes.string,blurToSave:i.PropTypes.bool,afterSaveCell:i.PropTypes.func}),insertRow:i.PropTypes.bool,deleteRow:i.PropTypes.bool,search:i.PropTypes.bool,columnFilter:i.PropTypes.bool,trClassName:i.PropTypes.any,options:i.PropTypes.shape({sortName:i.PropTypes.string,sortOrder:i.PropTypes.string,afterTableComplete:i.PropTypes.func,afterDeleteRow:i.PropTypes.func,afterInsertRow:i.PropTypes.func,page:i.PropTypes.number,sizePerPageList:i.PropTypes.array,sizePerPage:i.PropTypes.number,paginationSize:i.PropTypes.number,onSortChange:i.PropTypes.func,onPageChange:i.PropTypes.func}),fetchInfo:i.PropTypes.shape({dataTotalSize:i.PropTypes.number})},v.defaultProps={height:"100%",striped:!1,bordered:!0,hover:!1,condensed:!1,pagination:!1,searchPlaceholder:void 0,selectRow:{mode:d.ROW_SELECT_NONE,bgColor:d.ROW_SELECT_BG_COLOR,selected:[],onSelect:void 0,onSelectAll:void 0,clickToSelect:!1,hideSelectColumn:!1,clickToSelectAndEditCell:!1},cellEdit:{mode:d.CELL_EDIT_NONE,blurToSave:!1,afterSaveCell:void 0},insertRow:!1,deleteRow:!1,search:!1,multiColumnSearch:!1,columnFilter:!1,trClassName:"",options:{sortName:void 0,sortOrder:d.SORT_DESC,afterTableComplete:void 0,afterDeleteRow:void 0,afterInsertRow:void 0,page:1,sizePerPageList:d.SIZE_PER_PAGE_LIST,sizePerPage:d.SIZE_PER_PAGE_LIST[0],paginationSize:d.PAGINATION_SIZE},fetchInfo:{dataTotalSize:0}},t.exports=v},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./TableBody":"/Users/allen/Node/react-bootstrap-table/src/TableBody.js","./TableFilter":"/Users/allen/Node/react-bootstrap-table/src/TableFilter.js","./TableHeader":"/Users/allen/Node/react-bootstrap-table/src/TableHeader.js","./pagination/PaginationList":"/Users/allen/Node/react-bootstrap-table/src/pagination/PaginationList.js","./store/TableDataStore":"/Users/allen/Node/react-bootstrap-table/src/store/TableDataStore.js","./toolbar/ToolBar":"/Users/allen/Node/react-bootstrap-table/src/toolbar/ToolBar.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/Const.js":[function(e,t,o){"use strict";t.exports={SORT_DESC:"desc",SORT_ASC:"asc",SIZE_PER_PAGE:10,NEXT_PAGE:">",LAST_PAGE:">>",PRE_PAGE:"<",FIRST_PAGE:"<<",ROW_SELECT_BG_COLOR:"",ROW_SELECT_NONE:"none",ROW_SELECT_SINGLE:"radio",ROW_SELECT_MULTI:"checkbox",CELL_EDIT_NONE:"none",CELL_EDIT_CLICK:"click",CELL_EDIT_DBCLICK:"dbclick",SIZE_PER_PAGE_LIST:[10,25,30,50],PAGINATION_SIZE:5}},{}],"/Users/allen/Node/react-bootstrap-table/src/Editor.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a=n(e("react")),s=function(e,t,o,n,s){if(e===!0||"string"==typeof e){var l=e===!0?"text":e;return a.createElement("input",r({},t,{type:l,defaultValue:s,className:(n||"")+" form-control editor edit-text"}))}if(!e){var l=e===!0?"text":e;return a.createElement("input",r({},t,{type:l,defaultValue:s,disabled:"disabled",className:(n||"")+" form-control editor edit-text"}))}if(e.type){if(e.style&&(t.style=e.style),t.className=(n||"")+" form-control editor edit-"+e.type+(e.className?" "+e.className:""),"select"===e.type){var i=[],c=e.options.values;if(Array.isArray(c)){var d;i=c.map(function(e,t){return d=o?o(e):e,a.createElement("option",{key:"option"+t,value:e},d)})}return a.createElement("select",r({},t,{defaultValue:s}),i)}if("textarea"===e.type){e.cols&&(t.cols=e.cols),e.rows&&(t.rows=e.rows);var u=t.onKeyDown,p=null;return u&&(t.onKeyDown=function(e){13!=e.keyCode&&u(e)},p=a.createElement("butto",{className:"btn btn-info btn-xs textarea-save-btn",onClick:u},"save")),a.createElement("div",null,a.createElement("textarea",r({},t,{defaultValue:s})),p)}if("checkbox"===e.type){var b="true:false";e.options&&e.options.values&&(b=e.options.values),t.className=t.className.replace("form-control",""),t.className+=" checkbox pull-right";var m=s.toString()==b.split(":")[0];return a.createElement("input",r({},t,{type:"checkbox",value:b,defaultChecked:m}))}return a.createElement("input",r({},t,{type:l,defaultValue:s}))}return a.createElement("input",r({},t,{type:"text",className:(n||"")+" form-control editor edit-text"}))};t.exports=s},{react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/Notification.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function(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&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("react")),i=(n(e("./Const")),n(e("react-toastr"))),c=i.ToastContainer,d=l.createFactory(i.ToastMessage.animation),u=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{notice:{value:function(e,t,o){this.refs.toastr[e](t,o,{mode:"single",timeOut:5e3,extendedTimeOut:1e3,showAnimation:"animated bounceIn",hideAnimation:"animated bounceOut"})}},render:{value:function(){return l.createElement(c,{ref:"toastr",toastMessageFactory:d,id:"toast-container",className:"toast-top-right"})}}}),t}(l.Component);t.exports=u},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js","react-toastr":"/Users/allen/Node/react-bootstrap-table/node_modules/react-toastr/lib/index.js"}],"/Users/allen/Node/react-bootstrap-table/src/SelectRowHeaderColumn.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function(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&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("react")),i=(n(e("classnames")),n(e("./Const")),function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{render:{value:function(){var e={width:35};return l.createElement("th",{style:e},l.createElement("div",{className:"th-inner table-header-column"},this.props.children))}}}),t}(l.Component));t.exports=i},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableBody.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function h(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:h(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("./Const")),d=n(e("./TableRow")),u=n(e("./TableColumn")),p=n(e("./TableEditColumn")),b=n(e("classnames")),m=function(e){return e&&"function"==typeof e},f=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={currEditCell:null},this.editing=!1}return s(t,e),r(t,{render:{value:function(){var e=b("table-container"),t=b("table",{"table-striped":this.props.striped,"table-bordered":this.props.bordered,"table-hover":this.props.hover,"table-condensed":this.props.condensed}),o=this._isSelectRowDefined(),n=this.renderTableHeader(o),r=this.props.data.map(function(e,t){var n=this.props.columns.map(function(o,n){var r=e[o.name];if(this.editing&&o.name!==this.props.keyField&&o.editable&&null!=this.state.currEditCell&&this.state.currEditCell.rid==t&&this.state.currEditCell.cid==n){var a=o.format?function(t){return o.format(t,e).replace(/<.*?>/g,"")}:!1;return i.createElement(p,{completeEdit:this.handleCompleteEditCell.bind(this),editable:m(o.editable)?o.editable(r,e,t,n):o.editable,format:o.format?a:!1,key:n,blurToSave:this.props.cellEdit.blurToSave,rowIndex:t,colIndex:n},r)}var s=m(o.className)?o.className(r,e,t,n):o.className;if("undefined"!=typeof o.format){var l=o.format(r,e);return i.isValidElement(l)||(l=i.createElement("div",{dangerouslySetInnerHTML:{__html:l}})),i.createElement(u,{dataAlign:o.align,key:n,className:s,cellEdit:this.props.cellEdit,onEdit:this.handleEditCell.bind(this),width:o.width},l)}return i.createElement(u,{dataAlign:o.align,key:n,className:s,cellEdit:this.props.cellEdit,hidden:o.hidden,onEdit:this.handleEditCell.bind(this),width:o.width},r)},this),r=-1!=this.props.selectedRowKeys.indexOf(e[this.props.keyField]),a=o&&!this.props.selectRow.hideSelectColumn?this.renderSelectRowColumn(r):null,s=m(this.props.trClassName)?this.props.trClassName(e,t):this.props.trClassName;return i.createElement(d,{isSelected:r,key:t,className:s,selectRow:o?this.props.selectRow:void 0,enableCellEdit:this.props.cellEdit.mode!==c.CELL_EDIT_NONE,onSelectRow:this.handleSelectRow.bind(this)},a,n)},this);return 0===r.length&&r.push(i.createElement(d,{key:"##table-empty##"},i.createElement("td",{colSpan:this.props.columns.length+(o?1:0),style:{textAlign:"center"}},"There is no data to display"))),this.editing=!1,i.createElement("div",{className:e},i.createElement("table",{className:t},n,i.createElement("tbody",null,r)))}},renderTableHeader:{value:function(e){var t=null;if(e){var o={width:35};t=this.props.selectRow.hideSelectColumn?null:i.createElement("th",{style:o,key:-1})}var n=this.props.columns.map(function(e,t){var o={display:e.hidden?"none":null,width:e.width};return i.createElement("th",{style:o,key:t,className:e.className})});return i.createElement("thead",null,i.createElement("tr",null,t,n))}},handleSelectRow:{value:function(e,t){var o,n;this.props.data.forEach(function(t,r){r==e-1&&(o=t[this.props.keyField],n=t)},this),this.props.onSelectRow(n,t)}},handleSelectRowColumChange:{value:function(e){this.props.selectRow.clickToSelect&&this.props.selectRow.clickToSelectAndEditCell||this.handleSelectRow(e.currentTarget.parentElement.parentElement.rowIndex,e.currentTarget.checked)}},handleEditCell:{value:function(e,t){this.editing=!0,this._isSelectRowDefined()&&(t--,this.props.selectRow.hideSelectColumn&&t++),e--;var o={currEditCell:{rid:e,cid:t}};if(this.props.selectRow.clickToSelectAndEditCell){var n=-1!=this.props.selectedRowKeys.indexOf(this.props.data[e][this.props.keyField]); this.handleSelectRow(e+1,!n)}this.setState(o)}},cancelEdit:{value:function(){var e=this.state.currEditCell;e&&this.handleCompleteEditCell(null,e.rid,e.cid)}},handleCompleteEditCell:{value:function(e,t,o){this.setState({currEditCell:null}),null!=e&&this.props.cellEdit.__onCompleteEdit__(e,t,o)}},renderSelectRowColumn:{value:function(e){return this.props.selectRow.mode==c.ROW_SELECT_SINGLE?i.createElement(u,null,i.createElement("input",{type:"radio",name:"selection",checked:e,onChange:this.handleSelectRowColumChange.bind(this)})):i.createElement(u,null,i.createElement("input",{type:"checkbox",checked:e,onChange:this.handleSelectRowColumChange.bind(this)}))}},_isSelectRowDefined:{value:function(){return this.props.selectRow.mode==c.ROW_SELECT_SINGLE||this.props.selectRow.mode==c.ROW_SELECT_MULTI}}}),t}(i.Component);f.propTypes={data:i.PropTypes.array,columns:i.PropTypes.array,striped:i.PropTypes.bool,bordered:i.PropTypes.bool,hover:i.PropTypes.bool,condensed:i.PropTypes.bool,keyField:i.PropTypes.string,selectedRowKeys:i.PropTypes.array,onSelectRow:i.PropTypes.func},t.exports=f},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./TableColumn":"/Users/allen/Node/react-bootstrap-table/src/TableColumn.js","./TableEditColumn":"/Users/allen/Node/react-bootstrap-table/src/TableEditColumn.js","./TableRow":"/Users/allen/Node/react-bootstrap-table/src/TableRow.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableColumn.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function p(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:p(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},c=n(e("react")),d=n(e("./Const")),u=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e)}return s(t,e),r(t,{handleCellEdit:{value:function(e){if(this.props.cellEdit.mode==d.CELL_EDIT_DBCLICK)if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var t=window.getSelection();t.removeAllRanges()}this.props.onEdit(e.currentTarget.parentElement.rowIndex,e.currentTarget.cellIndex)}},render:{value:function(){var e={textAlign:this.props.dataAlign,display:this.props.hidden?"none":null},t={};return this.props.cellEdit&&(this.props.cellEdit.mode==d.CELL_EDIT_CLICK?t.onClick=this.handleCellEdit.bind(this):this.props.cellEdit.mode==d.CELL_EDIT_DBCLICK&&(t.onDoubleClick=this.handleCellEdit.bind(this))),c.createElement("td",i({style:e,className:this.props.className},t),this.props.children)}}}),t}(c.Component);u.propTypes={dataAlign:c.PropTypes.string,hidden:c.PropTypes.bool,className:c.PropTypes.string},u.defaultProps={dataAlign:"left",hidden:!1,className:""},t.exports=u},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableEditColumn.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function b(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:b(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=(n(e("./Const")),n(e("./Editor"))),d=n(e("./Notification.js")),u=n(e("classnames")),p=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.timeouteClear=0,this.state={shakeEditor:!1}}return s(t,e),r(t,{handleKeyPress:{value:function(e){if(13==e.keyCode){var t="checkbox"==e.currentTarget.type?this._getCheckBoxValue(e):e.currentTarget.value;if(!this.validator(t))return;this.props.completeEdit(t,this.props.rowIndex,this.props.colIndex)}else 27==e.keyCode&&this.props.completeEdit(null,this.props.rowIndex,this.props.colIndex)}},handleBlur:{value:function(e){if(this.props.blurToSave){var t="checkbox"==e.currentTarget.type?this._getCheckBoxValue(e):e.currentTarget.value;if(!this.validator(t))return;this.props.completeEdit(t,this.props.rowIndex,this.props.colIndex)}}},validator:{value:function(e){var t=this;if(t.props.editable.validator){var o=t.props.editable.validator(e);if(o!==!0){t.refs.notifier.notice("error",o,"Pressed ESC can cancel");var n=t.refs.inputRef;return t.clearTimeout(),t.setState({shakeEditor:!0}),t.timeouteClear=setTimeout(function(){t.setState({shakeEditor:!1})},300),n.focus(),!1}}return!0}},clearTimeout:{value:function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(){0!=this.timeouteClear&&(clearTimeout(this.timeouteClear),this.timeouteClear=0)})},componentDidMount:{value:function(){var e=this.refs.inputRef;e.focus()}},componentWillUnmount:{value:function(){this.clearTimeout()}},render:{value:function(){var e=this.props.editable,t=this.props.format,o={ref:"inputRef",onKeyDown:this.handleKeyPress.bind(this),onBlur:this.handleBlur.bind(this)};e.placeholder&&(o.placeholder=e.placeholder);var n=u({animated:this.state.shakeEditor,shake:this.state.shakeEditor});return i.createElement("td",{ref:"td",style:{position:"relative"}},c(e,o,t,n,this.props.children||""),i.createElement(d,{ref:"notifier"}))}},_getCheckBoxValue:{value:function(e){var t="",o=e.currentTarget.value.split(":");return t=e.currentTarget.checked?o[0]:o[1]}}}),t}(i.Component);p.propTypes={completeEdit:i.PropTypes.func,rowIndex:i.PropTypes.number,colIndex:i.PropTypes.number,blurToSave:i.PropTypes.bool},t.exports=p},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./Editor":"/Users/allen/Node/react-bootstrap-table/src/Editor.js","./Notification.js":"/Users/allen/Node/react-bootstrap-table/src/Notification.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableFilter.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function p(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:p(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("./Const")),d=n(e("classnames")),u=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.filterObj={}}return s(t,e),r(t,{handleKeyUp:{value:function(e){""===e.currentTarget.value.trim()?delete this.filterObj[e.currentTarget.name]:this.filterObj[e.currentTarget.name]=e.currentTarget.value,this.props.onFilter(this.filterObj)}},render:{value:function(){var e=d("table",{"table-striped":this.props.striped,"table-condensed":this.props.condensed}),t=null;if(this.props.rowSelectType==c.ROW_SELECT_SINGLE||this.props.rowSelectType==c.ROW_SELECT_MULTI){var o={width:35,paddingLeft:0,paddingRight:0};t=i.createElement("th",{style:o,key:-1},"Filter")}var n=this.props.columns.map(function(e){var t={display:e.hidden?"none":null,width:e.width};return i.createElement("th",{key:e.name,style:t},i.createElement("div",{className:"th-inner table-header-column"},i.createElement("input",{type:"text",placeholder:e.name,name:e.name,onKeyUp:this.handleKeyUp.bind(this)})))},this);return i.createElement("table",{className:e,style:{marginTop:5}},i.createElement("thead",null,i.createElement("tr",{style:{borderBottomStyle:"hidden"}},t,n)))}}}),t}(i.Component);u.propTypes={columns:i.PropTypes.array,rowSelectType:i.PropTypes.string,onFilter:i.PropTypes.func},t.exports=u},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableHeader.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function m(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:m(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("./Const")),d=n(e("./util")),u=n(e("classnames")),p=n(e("./SelectRowHeaderColumn")),b=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e)}return s(t,e),r(t,{clearSortCaret:{value:function(e,t){for(var o=this.refs.header,n=0;n<o.childElementCount;n++){var r=o.childNodes[n].childNodes[0];r.getElementsByClassName("order").length>0&&r.removeChild(r.getElementsByClassName("order")[0])}this.props.onSort(e,t)}},componentDidMount:{value:function(){if(this.props.sortName){this.clearSortCaret(this.props.sortOrder,this.props.sortName);for(var e=this.refs.header,t=0;t<e.childElementCount;t++){var o=e.childNodes[t].childNodes[0];if(o.getAttribute("data-field")===this.props.sortName){o.appendChild(d.renderSortCaret(this.props.sortOrder));break}}}}},render:{value:function(){var e=u("table-header"),t=u("table","table-hover",{"table-bordered":this.props.bordered}),o=this.props.hideSelectColumn?null:this.renderSelectRowHeader();return this._attachClearSortCaretFunc(),i.createElement("div",{className:e},i.createElement("table",{className:t},i.createElement("thead",null,i.createElement("tr",{ref:"header"},o,this.props.children))))}},renderSelectRowHeader:{value:function(){return this.props.rowSelectType==c.ROW_SELECT_SINGLE?i.createElement(p,null):this.props.rowSelectType==c.ROW_SELECT_MULTI?i.createElement(p,null,i.createElement("input",{type:"checkbox",onChange:this.props.onSelectAllRow})):null}},_attachClearSortCaretFunc:{value:function(){if(Array.isArray(this.props.children))for(var e=0;e<this.props.children.length;e++)this.props.children[e]=i.cloneElement(this.props.children[e],{key:e,clearSortCaret:this.clearSortCaret.bind(this)});else this.props.children=i.cloneElement(this.props.children,{key:0,clearSortCaret:this.clearSortCaret.bind(this)})}}}),t}(i.Component);b.propTypes={rowSelectType:i.PropTypes.string,onSort:i.PropTypes.func,onSelectAllRow:i.PropTypes.func,sortName:i.PropTypes.string,sortOrder:i.PropTypes.string,hideSelectColumn:i.PropTypes.bool,bordered:i.PropTypes.bool},b.defaultProps={},t.exports=b},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./SelectRowHeaderColumn":"/Users/allen/Node/react-bootstrap-table/src/SelectRowHeaderColumn.js","./util":"/Users/allen/Node/react-bootstrap-table/src/util.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableHeaderColumn.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function(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&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=n(e("react")),i=(n(e("classnames")),n(e("./Const"))),c=n(e("./util")),d=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{handleColumnClick:{value:function(e){if(this.props.dataSort){var t=this.refs.innerDiv;this.order=this.order==i.SORT_DESC?i.SORT_ASC:i.SORT_DESC,this.props.clearSortCaret(this.order,this.props.dataField),t.appendChild(c.renderSortCaret(this.order))}}},componentDidMount:{value:function(){this.refs.innerDiv.setAttribute("data-field",this.props.dataField)}},render:{value:function(){var e={textAlign:this.props.dataAlign,display:this.props.hidden?"none":null,width:this.props.width},t=this.props.className+" "+(this.props.dataSort?"sort-column":"");return l.createElement("th",{className:t,style:e},l.createElement("div",{ref:"innerDiv",className:"th-inner table-header-column",onClick:this.handleColumnClick.bind(this)},this.props.children))}}}),t}(l.Component);d.propTypes={dataField:l.PropTypes.string,dataAlign:l.PropTypes.string,dataSort:l.PropTypes.bool,clearSortCaret:l.PropTypes.func,dataFormat:l.PropTypes.func,isKey:l.PropTypes.bool,editable:l.PropTypes.any,hidden:l.PropTypes.bool,className:l.PropTypes.string,width:l.PropTypes.string,sortFunc:l.PropTypes.func,columnClassName:l.PropTypes.any},d.defaultProps={dataAlign:"left",dataSort:!1,dataFormat:void 0,isKey:!1,editable:!0,clearSortCaret:void 0,hidden:!1,className:"",width:null,sortFunc:void 0,columnClassName:""},t.exports=d},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./util":"/Users/allen/Node/react-bootstrap-table/src/util.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/TableRow.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function(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&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},i=n(e("react")),c=(n(e("./Const")),function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),r(t,{rowClick:{value:function(e){"INPUT"!==e.target.tagName&&this.props.onSelectRow(e.currentTarget.rowIndex,!this.props.isSelected)}},render:{value:function(){var e={style:{backgroundColor:this.props.isSelected?this.props.selectRow.bgColor:null},className:this.props.className||""};return this.props.selectRow&&!this.props.enableCellEdit&&(this.props.selectRow.clickToSelect||this.props.selectRow.clickToSelectAndEditCell)?i.createElement("tr",l({},e,{onClick:this.rowClick.bind(this)}),this.props.children):i.createElement("tr",e,this.props.children)}}}),t}(i.Component));c.propTypes={isSelected:i.PropTypes.bool,enableCellEdit:i.PropTypes.bool,onSelectRow:i.PropTypes.func},t.exports=c},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/pagination/PageButton.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function u(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:u(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("classnames")),d=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e)}return s(t,e),r(t,{pageBtnClick:{value:function(e){e.preventDefault(),this.props.changePage(e.currentTarget.text)}},render:{value:function(){var e=this.props.active?c("active"):null;return i.createElement("li",{className:e},i.createElement("a",{href:"#",onClick:this.pageBtnClick.bind(this)},this.props.children))}}}),t}(i.Component);d.propTypes={changePage:i.PropTypes.func,active:i.PropTypes.bool},t.exports=d},{classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/pagination/PaginationList.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function p(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:p(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("./PageButton.js")),d=n(e("../Const")),u=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={currentPage:this.props.currPage,sizePerPage:this.props.sizePerPage}}return s(t,e),r(t,{changePage:{value:function(e){e=e==d.PRE_PAGE?this.state.currentPage-1<1?1:this.state.currentPage-1:e==d.NEXT_PAGE?this.state.currentPage+1>this.totalPages?this.totalPages:this.state.currentPage+1:e==d.LAST_PAGE?this.totalPages:e==d.FIRST_PAGE?1:parseInt(e),e!=this.state.currentPage&&(this.setState({currentPage:e}),this.props.changePage(e,this.state.sizePerPage))}},componentWillReceiveProps:{value:function(e){this.props.remote&&(e.currPage||e.sizePerPage)&&this.setState({currentPage:e.currPage,sizePerPage:e.sizePerPage})}},changeSizePerPage:{value:function(e){e.preventDefault();var t=parseInt(e.currentTarget.text);t!=this.state.sizePerPage&&(this.totalPages=Math.ceil(this.props.dataSize/t),this.state.currentPage>this.totalPages&&(this.state.currentPage=this.totalPages),this.setState({sizePerPage:t,currentPage:this.state.currentPage}),this.props.changePage(this.state.currentPage,t))}},render:{value:function(){var e=this;this.totalPages=Math.ceil(this.props.dataSize/this.state.sizePerPage);var t=this.makePage(),o={marginTop:"0px"},n=this.props.sizePerPageList.map(function(t){return i.createElement("li",{key:t,role:"presentation"},i.createElement("a",{role:"menuitem",tabIndex:"-1",href:"#",onClick:e.changeSizePerPage.bind(e)},t))});return i.createElement("div",{className:"row"},i.createElement("div",{className:"col-md-1"},i.createElement("div",{className:"dropdown"},i.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"pageDropDown","data-toggle":"dropdown","aria-expanded":"true"},this.state.sizePerPage,i.createElement("span",{className:"caret"})),i.createElement("ul",{className:"dropdown-menu",role:"menu","aria-labelledby":"pageDropDown"},n))),i.createElement("div",{className:"col-md-6"},i.createElement("ul",{className:"pagination",style:o},t)))}},makePage:{value:function(){var e=this.getPages();return e.map(function(e){var t=e===this.state.currentPage;return i.createElement(c,{changePage:this.changePage.bind(this),active:t,key:e},e)},this)}},getPages:{value:function(){var e=1,t=this.totalPages;e=Math.max(this.state.currentPage-Math.floor(this.props.paginationSize/2),1),t=e+this.props.paginationSize-1,t>this.totalPages&&(t=this.totalPages,e=t-this.props.paginationSize+1);for(var o=[d.FIRST_PAGE,d.PRE_PAGE],n=e;t>=n;n++)n>0&&o.push(n);return o.push(d.NEXT_PAGE),o.push(d.LAST_PAGE),o}},getCurrentPage:{value:function(){return this.state.currentPage}},getSizePerPage:{value:function(){return this.state.sizePerPage}}}),t}(i.Component);u.propTypes={currPage:i.PropTypes.number,sizePerPage:i.PropTypes.number,dataSize:i.PropTypes.number,changePage:i.PropTypes.func,sizePerPageList:i.PropTypes.array,paginationSize:i.PropTypes.number,remote:i.PropTypes.bool},u.defaultProps={sizePerPage:d.SIZE_PER_PAGE},t.exports=u},{"../Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","./PageButton.js":"/Users/allen/Node/react-bootstrap-table/src/pagination/PageButton.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/store/TableDataStore.js":[function(e,t,o){"use strict";function n(e,t,o,n){return o=o.toLowerCase(),e.sort(function(e,r){return n?n(e,r,o):o==c.SORT_DESC?e[t]>r[t]?-1:e[t]<r[t]?1:0:e[t]<r[t]?-1:e[t]>r[t]?1:0}),e}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),s=function u(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:u(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},l=function(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&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(o,"__esModule",{value:!0});var c=r(e("../Const")),d=e("events").EventEmitter;o.TableDataSet=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.data=e}return l(t,e),a(t,{setData:{value:function(e){this.emit("change",e)}},clear:{value:function(){this.data=null}},getData:{value:function(){return this.data}}}),t}(d),o.TableDataStore=function(){function e(t){i(this,e),this.data=t,this.customSortFuncMap=null,this.filteredData=null,this.isOnFilter=!1,this.filterObj=null,this.searchText=null,this.sortObj=null,this.pageObj={},this.selected=[],this.remote=!1}return a(e,{setProps:{value:function(e,t,o,n){this.keyField=t,this.enablePagination=e,this.customSortFuncMap=o,this.remote=n}},setData:{value:function(e){this.data=e,this.isOnFilter&&(null!==this.filterObj&&this.filter(this.filterObj),null!==this.searchText&&this.search(this.searchText)),this.sortObj&&this.sort(this.sortObj.order,this.sortObj.sortField)}},setSelectedRowKey:{value:function(e){this.selected=e}},getSelectedRowKeys:{value:function(){return this.selected}},getCurrentDisplayData:{value:function(){return this.isOnFilter?this.filteredData:this.data}},sort:{value:function(e,t){this.sortObj={order:e,sortField:t};var o=this.getCurrentDisplayData(),r=this.customSortFuncMap[t];return o=n(o,t,e,r),this}},page:{value:function(e){var t=function(t,o){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(e,t){return this.pageObj.end=e*t-1,this.pageObj.start=this.pageObj.end-(t-1),this})},edit:{value:function(e,t,o){var n=this.getCurrentDisplayData(),r=void 0;return this.enablePagination?(n[this.pageObj.start+t][o]=e,r=n[this.pageObj.start+t][this.keyField]):(n[t][o]=e,r=n[t][this.keyField]),this.isOnFilter&&this.data.forEach(function(t){t[this.keyField]===r&&(t[this.keyField][o]=e)},this),this}},add:{value:function(e){if(""===e[this.keyField].trim())throw this.keyField+" can't be empty value.";var t=this.getCurrentDisplayData();t.forEach(function(t){if(t[this.keyField].toString()===e[this.keyField])throw this.keyField+" "+e[this.keyField]+" already exists"},this),t.push(e),this.isOnFilter&&this.data.push(e)}},remove:{value:function(e){var t=this.getCurrentDisplayData(),o=t.filter(function(t){return-1==e.indexOf(t[this.keyField])},this);this.isOnFilter?(this.data=this.data.filter(function(t){return-1==e.indexOf(t[this.keyField])},this),this.filteredData=o):this.data=o}},filter:{value:function(e){0==Object.keys(e).length?(this.filteredData=null,this.isOnFilter=!1,this.filterObj=null):(this.filterObj=e,this.filteredData=this.data.filter(function(t){var o=!0;for(var n in e)if(-1==t[n].toString().toLowerCase().indexOf(e[n].toLowerCase())){o=!1;break}return o}),this.isOnFilter=!0)}},search:{value:function(e,t){if(""===e.trim())this.filteredData=null,this.isOnFilter=!1,this.searchText=null;else{this.searchText=e;var o=[];this.filteredData=this.data.filter(function(n){var r=!1;t?o=e.split(" "):o.push(e);for(var a in n)if(n[a]&&(o.forEach(function(e){-1!==n[a].toString().toLowerCase().indexOf(e.toLowerCase())&&(r=!0)}),r))break;return r}),this.isOnFilter=!0}}},get:{value:function(){var e=this.getCurrentDisplayData();if(0==e.length)return e;if(this.remote||!this.enablePagination)return e;for(var t=[],o=this.pageObj.start;o<=this.pageObj.end&&(t.push(e[o]),o+1!=e.length);o++);return t}},getKeyField:{value:function(){return this.keyField}},getDataNum:{value:function(){return this.getCurrentDisplayData().length}},isChangedPage:{value:function(){return!(!this.pageObj.start||!this.pageObj.end)}},getAllRowkey:{value:function(){return this.data.map(function(e){return e[this.keyField]},this)}}}),e}()},{"../Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js",events:"/Users/allen/Node/react-bootstrap-table/node_modules/browserify/node_modules/events/events.js"}],"/Users/allen/Node/react-bootstrap-table/src/toolbar/ToolBar.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,t){for(var o in t){var n=t[o];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=function b(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:b(r,t,o)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(o)},s=function(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&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(e("react")),c=n(e("classnames")),d=(n(e("../Const")),n(e("../Editor"))),u=n(e("../Notification.js")),p=function(e){function t(e){l(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.timeouteClear=0,this.state={isInsertRowTrigger:!0,validateState:null,shakeEditor:!1}}return s(t,e),r(t,{componentWillUnmount:{value:function(){this.clearTimeout()}},clearTimeout:{value:function(e){var t=function(){return e.apply(this,arguments)};return t.toString=function(){return e.toString()},t}(function(){this.timeouteClear&&(clearTimeout(this.timeouteClear),this.timeouteClear=0)})},checkAndParseForm:{value:function(){var e,t,o=this,n={},r=!0,a={};return this.props.columns.forEach(function(o,s){if(o.autoValue)e="function"==typeof o.autoValue?o.autoValue():"autovalue-"+(new Date).getTime();else{var l=this.refs[o.field+s];if(e=l.value,o.editable&&"checkbox"==o.editable.type){var i=l.value.split(":");e=l.checked?i[0]:i[1]}o.editable&&o.editable.validator&&(t=o.editable.validator(e),t!==!0&&(r=!1,a[o.field]=t))}n[o.field]=e},this),r?n:(o.clearTimeout(),this.setState({validateState:a,shakeEditor:!0}),o.refs.notifier.notice("error","Form validate errors, please checking!","Pressed ESC can cancel"),o.timeouteClear=setTimeout(function(){o.setState({shakeEditor:!1})},300),null)}},handleSaveBtnClick:{value:function(e){var t=this.checkAndParseForm();if(t){var o=this.props.onAddRow(t);if(o){var n=this;n.refs.notifier.notice("error",o,"Pressed ESC can cancel"),n.clearTimeout(),n.setState({shakeEditor:!0,validateState:"this is hack for prevent bootstrap modal hide"}),n.timeouteClear=setTimeout(function(){n.setState({shakeEditor:!1})},300)}else this.setState({validateState:null,shakeEditor:!1}),this.refs.form.reset()}}},handleDropRowBtnClick:{value:function(e){this.props.onDropRow()}},handleCloseBtn:{value:function(e){this.refs.warning.style.display="none"}},handleKeyUp:{value:function(e){this.props.onSearch(e.currentTarget.value)}},render:{value:function(){var e="bs-table-modal-sm"+(new Date).getTime(),t=this.props.enableInsert?i.createElement("button",{type:"button",onClick:this.props.onAddRowBegin,className:"btn btn-info","data-toggle":"modal","data-target":"."+e},i.createElement("i",{className:"glyphicon glyphicon-plus"})," New"):null,o=this.props.enableDelete?i.createElement("button",{type:"button",className:"btn btn-warning","data-toggle":"tooltip","data-placement":"right",title:"Drop selected row",onClick:this.handleDropRowBtnClick.bind(this)},i.createElement("i",{className:"glyphicon glyphicon-trash" })," Delete"):null,n=this.props.enableSearch?i.createElement("input",{type:"text",placeholder:this.props.searchPlaceholder?this.props.searchPlaceholder:"Search",onKeyUp:this.handleKeyUp.bind(this)}):null,r=this.props.enableInsert?this.renderInsertRowModal(e):null;return i.createElement("div",null,i.createElement("div",{className:"btn-group btn-group-xs",role:"group","aria-label":"..."},t,o),n,i.createElement(u,{ref:"notifier"}),r)}},renderInsertRowModal:{value:function(e){var t=this.state.validateState||{},o=this.props.columns.map(function(e,o){var n=e.editable,r=e.format,a={ref:e.field+o,placeholder:n.placeholder?n.placeholder:e.name};if(e.autoValue)return null;var s=t[e.field]?i.createElement("span",{className:"help-block bg-danger"},t[e.field]):null;return i.createElement("div",{className:"form-group",key:e.field},i.createElement("label",null,e.name),d(n,a,r,""),s)}),n=c("modal","fade",e,{"in":this.state.shakeEditor||this.state.validateState}),r=c("modal-dialog","modal-sm",{animated:this.state.shakeEditor,shake:this.state.shakeEditor});return i.createElement("div",{ref:"modal",className:n,tabIndex:"-1",role:"dialog"},i.createElement("div",{className:r},i.createElement("div",{className:"modal-content"},i.createElement("div",{className:"modal-header"},i.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},i.createElement("span",{"aria-hidden":"true"},"×")),i.createElement("h4",{className:"modal-title"},"New Record")),i.createElement("div",{className:"modal-body"},i.createElement("form",{ref:"form"},o)),i.createElement("div",{className:"modal-footer"},i.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"),i.createElement("button",{type:"button",className:"btn btn-info",onClick:this.handleSaveBtnClick.bind(this)},"Save")))))}}}),t}(i.Component);p.propTypes={onAddRow:i.PropTypes.func,onDropRow:i.PropTypes.func,enableInsert:i.PropTypes.bool,enableDelete:i.PropTypes.bool,enableSearch:i.PropTypes.bool,columns:i.PropTypes.array,searchPlaceholder:i.PropTypes.string},p.defaultProps={enableInsert:!1,enableDelete:!1,enableSearch:!1},t.exports=p},{"../Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js","../Editor":"/Users/allen/Node/react-bootstrap-table/src/Editor.js","../Notification.js":"/Users/allen/Node/react-bootstrap-table/src/Notification.js",classnames:"/Users/allen/Node/react-bootstrap-table/node_modules/classnames/index.js",react:"/Users/allen/Node/react-bootstrap-table/node_modules/react/react.js"}],"/Users/allen/Node/react-bootstrap-table/src/util.js":[function(e,t,o){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},r=n(e("./Const"));t.exports={renderSortCaret:function(e){var t=document.createElement("span");t.className="order",e==r.SORT_ASC&&(t.className+=" dropup");var o=document.createElement("span");return o.className="caret",o.style.margin="10px 5px",t.appendChild(o),t}}},{"./Const":"/Users/allen/Node/react-bootstrap-table/src/Const.js"}]},{},["./src/index.js"]); //# sourceMappingURL=react-bootstrap-table.min.js.map
components/Todo.js
tim-speed/manifold-todo
import React from 'react' import PropTypes from 'prop-types' const Todo = ({ onClick, onRemoveClick, completed, text }) => ( <li className={completed ? 'todo complete' : 'todo'} > <span onClick={onClick}>{text}</span> <a href='javascript:void(0)' onClick={onRemoveClick}>x</a> <style jsx>{` .todo.complete > span { text-decoration: line-through; } .todo > a { padding: 5px; cursor: pointer; } `}</style> </li> ) Todo.propTypes = { onClick: PropTypes.func.isRequired, onRemoveClick: PropTypes.func.isRequired, completed: PropTypes.bool.isRequired, text: PropTypes.string.isRequired } export default Todo
lib/Form.js
brigand/react-simple-forms
var _ = require('lodash'); var React = require('react/addons'); var invariant = require('react/lib/invariant'); var cloneWithProps = require('react/lib/cloneWithProps'); var update = require('react/lib/update'); var RSVP = require('rsvp'); var applyContext = require('./utils/applyContext'); function isPromise(value) { return value && value.then; } var Form = React.createClass({ displayName: 'Form', mixins: [React.addons.PureRenderMixin], propTypes: { validators: React.PropTypes.object, onSubmit: React.PropTypes.func, onSuccess: React.PropTypes.func, onErrors: React.PropTypes.func }, componentWillMount: function() { this._debouncedFuncs = {}; this._loadingValidators = {}; this._fieldCount = 0; this._formState = { submitting: false, submitted: false, submitError: null }; this._formElements = []; this._formFieldElements = {}; this._fieldStates = {}; this.setAvailableValidators(this.props); }, componentWillReceiveProps: function(nextProps) { this.setAvailableValidators(nextProps); }, getDefaultProps: function() { return { defaultValues: {} }; }, getContext: function() { return { // Element methods registerElement: this.registerElement, unregisterElement: this.unregisterElement, // Field methods registerField: this.registerField, unregisterField: this.unregisterField, changeFieldValue: this.changeFieldValue, // Form methods submit: this.submit, // getState methods getFormState: this.getFormState, getFieldState: this.getFieldState }; }, getFormState: function() { return { submitting: this._formState.submitting, submitted: this._formState.submitted, submitError: this._formState.submitError, validatorNames: this.validatorNames }; }, setAvailableValidators: function(props) { this.validatorNames = _.keys(props.validators); }, // Element methods registerElement: function(element) { this._formElements.push(element); }, unregisterElement: function(element) { this._formElements = _.without(this._formElements, element); }, // Field methods registerField: function(element, fieldName, validators) { this._formFieldElements[fieldName] = element; var value = this.props.defaultValues[fieldName] || null; var initialFieldState = { value: value, error: null, state: 'loading', // Set to loading for initial validation. isPristine: true, isFirst: this._fieldCount++ === 0 }; this._fieldStates[fieldName] = initialFieldState; // Initially validate the newly-registered field. this._updateFieldValidationState(fieldName, value, validators); }, unregisterField: function(fieldName) { delete this._formFieldElements[fieldName]; delete this._fieldStates[fieldName]; }, changeFieldValue: function(fieldName, value, params) { var _this = this; params = params || {}; // Set field loading state. _this._updateFieldState(fieldName, { value: value, state: 'loading', error: null, isPristine: false }); function change() { // TODO: Add a promise to this._loadingValidators to prevent a race // condition. _this._updateFieldValidationState(fieldName, value, params.validators); } if (params.debounce) { if (!this._debouncedFuncs[fieldName]) { this._debouncedFuncs[fieldName] = _.debounce(function(func) { func(); }, params.debounce); } this._debouncedFuncs[fieldName](change); } else { change(); } }, _updateFieldValidationState: function(fieldName, value, validators) { var self = this; // Keep track of loading validators. var promise = this.validateField(fieldName, value, validators) .then(function(message) { var state; if (message) { state = {state: 'invalid', error: message}; } else { state = {state: 'valid', error: null}; } self._updateFieldState(fieldName, state); }) .catch(function(err) { self._updateFieldState({state: 'invalid', error: err}); }) .finally(function() { delete self._loadingValidators[fieldName]; }); this._loadingValidators[fieldName] = promise; }, _updateFieldState: function(fieldName, state) { _.extend(this._fieldStates[fieldName], state); // Re-render the changed element. this._formFieldElements[fieldName].forceUpdate(); }, _updateFormState: function(state) { _.extend(this._formState, state); _.each(this._formElements, function(element) { element.forceUpdate(); }); }, getFieldState: function(fieldName) { return this._fieldStates[fieldName]; }, setFieldValue: function(fieldName, value) { this._updateFieldState(fieldName, { value: value, state: 'valid', error: null }); }, // Form methods submit: function() { var self = this; // Prevent concurrent submits. if (this._formState.submitting) { return; } if (this.props.onSubmit) { this.props.onSubmit(); } // Change form state for all form elements. this._updateFormState({ submitting: true, submitted: true, submitError: null }); // Asynchronously wait for all loading validations before using errors. RSVP.hash(this._loadingValidators || {}) .then(function() { var errors = _.mapValues(self._fieldStates, 'error'); var filteredErrors = _.pick(errors, _.identity); if (!_.isEmpty(filteredErrors)) { return self.handleErrors(filteredErrors); } return self.handleSuccess(_.mapValues(self._fieldStates, 'value')); }) .catch(function(err) { console.error((err && err.stack) || err); }); }, validateField: function(name, value, validators) { var self = this; // Only check for errors if validators are defined for the field. if (!validators) { return RSVP.resolve(null); } // Ignore validators if the field is empty and required is not set. if (!validators.required && (!value || value === '')) { return RSVP.resolve(null); } // Combine into one resolved error string or null. var result = RSVP.resolve(null); // TODO: Even though it is supported my most major browsers, make the // validator order explicit instead of depending on the object's key order. _.each(validators, function(options, validatorName) { result = result.then(function() { // Validator will return a validation result value (error or null) or // a promise that will be fulfilled with a validation result value. var result = self.props.validators[validatorName](value, options); if (isPromise(result)) { // Reject on error result.then(function(value) { if (value) { return RSVP.reject(value); } return null; }); } else if (result) { // Handle static value result = RSVP.reject(result); } else { // Handle static value result = RSVP.resolve(null); } return result; }); }); return result.catch(function(err) { return err; }); }, handleErrors: function(errors) { if (this.props.onErrors) { this.props.onErrors(errors); } this._updateFormState({submitting: false}); }, handleSuccess: function(data) { var self = this; if (this.props.onSuccess) { var promise = this.props.onSuccess(data); if (isPromise(promise)) { return promise.then(function() { self._updateFormState({submitting: false}); }).catch(function(err) { self._updateFormState({submitError: err, submitting: false}); }); } } self._updateFormState({submitting: false}); }, handleKeyDown: function(e) { if (e.key === 'Enter') { this.submit(); } }, render: function() { // Add form data to all field props. applyContext(this.props.children, { _formContext: this.getContext() }, []); return React.DOM.div({ className: 'Form', key: this.props.key, onKeyDown: this.handleKeyDown }, this.props.children); } }); module.exports = Form;
ajax/libs/yui/3.2.0/event-custom/event-custom-debug.js
gswalden/cdnjs
YUI.add('event-custom-base', function(Y) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ (function() { /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var BEFORE = 0, AFTER = 1; Y.Do = { /** * Cache of objects touched by the utility * @property objs * @static */ objs: {}, /** * Execute the supplied method before the specified function * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { // Y.log('Do before: ' + sFn, 'info', 'event'); var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(BEFORE, f, obj, sFn); }, /** * Execute the supplied method after the specified function * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(AFTER, f, obj, sFn); }, /** * Execute the supplied method after the specified function * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (! this.objs[id]) { // create a map entry for the obj if it doesn't exist this.objs[id] = {}; } o = this.objs[id]; if (! o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription * @method detach * @param handle {string} the subscription handle */ detach: function(handle) { if (handle.detach) { handle.detach(); } }, _unload: function(e, me) { } }; ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ Y.Do.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ Y.Do.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ Y.Do.Method.prototype._delete = function (sid) { // Y.log('Y.Do._delete: ' + sid, 'info', 'Event'); delete this.before[sid]; delete this.after[sid]; }; /** * Execute the wrapped method * @method exec */ Y.Do.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case Y.Do.Halt: return ret.retVal; case Y.Do.AlterArgs: args = ret.newArgs; break; case Y.Do.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor == Y.Do.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor == Y.Do.AlterReturn) { ret = newRet.newRetVal; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. An example would be a service that scrubs * out illegal characters prior to executing the core business logic. * @class Do.AlterArgs */ Y.Do.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller * @class Do.AlterReturn */ Y.Do.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. * @class Do.Halt */ Y.Do.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute * @class Do.Prevent */ Y.Do.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @deprecated use Y.Do.Halt or Y.Do.Prevent */ Y.Do.Error = Y.Do.Halt; ////////////////////////////////////////////////////////////////////////// // Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do); })(); /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param evt {CustomEvent} the custom event * @param sub {Subscriber} the subscriber */ // var onsubscribeType = "_event:onsub", var AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log'; Y.EventHandle = function(evt, sub) { /** * The custom event * @type CustomEvent */ this.evt = evt; /** * The subscriber object * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { each: function(f) { f(this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.each(f); }); } }, /** * Detaches this subscriber * @method detach */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { // Y.log('EventHandle.detach: ' + this.sub, 'info', 'Event'); if (Y.Lang.isArray(evt)) { for (i=0; i<evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish') * @return {EventHandle} return value from the monitor event subscription */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires * @param o configuration object * @class CustomEvent * @constructor */ Y.CustomEvent = function(type, o) { // if (arguments.length > 2) { // this.log('CustomEvent context and silent are now in the config', 'warn', 'Event'); // } o = o || {}; this.id = Y.stamp(this); /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ this.context = Y; /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ // this.monitored = false; this.logSystem = (type == YUI_LOG); /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ // this.broadcast = 0; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = this.logSystem; /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ // this.queuable = false; /** * The subscribers to this event * @property subscribers * @type Subscriber{} */ this.subscribers = {}; /** * 'After' subscribers * @property afters * @type Subscriber{} */ this.afters = {}; /** * This event has fired if true * * @property fired * @type boolean * @default false; */ // this.fired = false; /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ // this.firedWith; /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ // this.fireOnce = false; /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ //this.async = false; /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ // this.stopped = 0; /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ // this.prevented = 0; /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ // this.host = null; /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ // this.defaultFn = null; /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ // this.stoppedFn = null; /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ // this.preventedFn = null; /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ this.preventable = true; /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ this.bubbles = true; /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ this.signature = YUI3_SIGNATURE; this.subCount = 0; this.afterCount = 0; // this.hasSubscribers = false; // this.hasAfters = false; /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ // this.emitFacade = false; this.applyConfig(o, true); // this.log("Creating " + this.type); }; Y.CustomEvent.prototype = { hasSubs: function(when) { var s = this.subCount, a = this.afterCount, sib = this.sibling; if (sib) { s += sib.subCount; a += sib.afterCount; } if (when) { return (when == 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish') * @return {EventHandle} return value from the monitor event subscription */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = Y.Array(arguments, 0, true); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @return {Array} first item is the on subscribers, second the after */ getSubs: function() { var s = Y.merge(this.subscribers), a = Y.merge(this.afters), sib = this.sibling; if (sib) { Y.mix(s, sib.subscribers); Y.mix(a, sib.afters); } return [s, a]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { if (o) { Y.mix(this, o, force, CONFIGS); } }, _on: function(fn, context, args, when) { if (!fn) { this.log("Invalid callback for CE: " + this.type); } var s = new Y.Subscriber(fn, context, args, when); if (this.fireOnce && this.fired) { if (this.async) { setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0); } else { this._notify(s, this.firedWith); } } if (when == AFTER) { this.afters[s.id] = s; this.afterCount++; } else { this.subscribers[s.id] = s; this.subCount++; } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute * @return {EventHandle} Unsubscribe handle * @deprecated use on */ subscribe: function(fn, context) { Y.log('ce.subscribe deprecated, use "on"', 'warn', 'deprecated'); var a = (arguments.length > 2) ? Y.Array(arguments, 2, true): null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s) */ on: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true): null; if (this.host) { this.host._monitor('attach', this.type, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle */ after: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true): null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = Y.merge(this.subscribers, this.afters); for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed * @deprecated use detach */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param s {Subscriber} the subscriber * @param args {Array} the arguments array to apply to the listener * @private */ _notify: function(s, args, ef) { this.log(this.type + "->" + "sub: " + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + " cancelled by subscriber"); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param msg {string} message to log * @param cat {string} log category */ log: function(msg, cat) { if (!this.silent) { Y.log(this.id + ': ' + msg, cat || "info", "event"); } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise * */ fire: function() { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { var args = Y.Array(arguments, 0, true); // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; this.firedWith = args; if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { // this._procSubs(Y.merge(this.subscribers, this.afters), args); var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } this._broadcast(args); return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { Y.log('Missing event-custom-complex needed to emit a facade for: ' + this.type); args[0] = args[0] || {}; return this.fireSimple(args); }, _procSubs: function(subs, args, ef) { var s, i; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped == 2) { return false; } } } } return true; }, _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = Y.Array(args); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast == 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed * @deprecated use detachAll */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed */ detachAll: function() { return this.detach(); }, /** * @method _delete * @param subscriber object * @private */ _delete: function(s) { if (s) { if (this.subscribers[s.id]) { delete this.subscribers[s.id]; this.subCount--; } if (this.afters[s.id]) { delete this.afters[s.id]; this.afterCount--; } } if (this.host) { this.host._monitor('detach', this.type, { ce: this, sub: s }); } if (s) { delete s.fn; delete s.context; } } }; ///////////////////////////////////////////////////////////////////// /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute * @param {Object} context The value of the keyword 'this' in the listener * @param {Array} args* 0..n additional arguments to supply the listener * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.stamp(this); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { _notify: function(c, args, ce) { var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber * @param ce {CustomEvent} The custom event that sent the notification */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch(e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute * @param {Object} context optional 'this' keyword for the listener * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn == fn) && this.context == context); } else { return (this.fn == fn); } } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ (function() { /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {string} the prefix to apply to non-prefixed event names * @config chain {boolean} if true, on/after/detach return the host to allow * chaining, otherwise they return an EventHandle (default false) */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', YArray = Y.Array, _wildType = Y.cached(function(type) { return type.replace(/(.*)(:)(.*)/, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = Y.cached(function(type, pre) { if (!pre || !L.isString(type) || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }), /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); // Y.log(t); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t == '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { // Y.log('EventTarget constructor executed: ' + this._yuid); var o = (L.isObject(opts)) ? opts : {}; this._yuievt = this._yuievt || { id: Y.guid(), events: {}, targets: {}, config: o, chain: ('chain' in o) ? o.chain : Y.config.chain, bubbling: false, defaults: { context: o.context || this, host: this, emitFacade: o.emitFacade, fireOnce: o.fireOnce, queuable: o.queuable, monitored: o.monitored, broadcast: o.broadcast, defaultTargetOnly: o.defaultTargetOnly, bubbles: ('bubbles' in o) ? o.bubbles : true } }; }; ET.prototype = { /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param type {string} The type of the event * @param fn {Function} The callback * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return the event target or a detach handle per 'chain' config */ once: function() { var handle = this.on.apply(this, arguments); handle.each(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Subscribe to a custom event hosted by this object * @method on * @param type {string} The type of the event * @param fn {Function} The callback * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return the event target or a detach handle per 'chain' config */ on: function(type, fn, context) { var parts = _parseType(type, this._yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = YArray(arguments, 0, true); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (this._yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && (this instanceof Node) && (shorttype in Node.DOM_EVENTS)) { args = YArray(arguments, 0, true); args.splice(2, 0, Node.getDOMNode(this)); // Y.log("Node detected, redirecting with these args: " + args); return Y.on.apply(Y, args); } type = parts[1]; if (this instanceof YUI) { adapt = Y.Env.evt.plugins[type]; args = YArray(arguments, 0, true); args[0] = shorttype; if (Node) { n = args[2]; if (n instanceof Y.NodeList) { n = Y.NodeList.getDOMNodes(n); } else if (n instanceof Node) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { Y.log('Using adaptor for ' + shorttype + ', ' + n, 'info', 'event'); handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = this._yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? YArray(arguments, 3, true) : null, (after) ? 'after' : true); } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (this._yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { Y.log('EventTarget subscribe() is deprecated, use on()', 'warn', 'deprecated'); return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (this instanceof Node); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = YArray(arguments, 0, true); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (this instanceof YUI) { args = YArray(arguments, 0, true); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { Y.log('EventTarget unsubscribe() is deprecated, use detach()', 'warn', 'deprecated'); return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {string} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {string} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'deprecated'); return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {string} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var events, ce, ret, defaults, edata = this._yuievt, pre = edata.config.prefix; type = (pre) ? _getType(type, pre) : type; this._monitor('publish', type, { args: arguments }); if (L.isObject(type)) { ret = {}; Y.each(type, function(v, k) { ret[k] = this.publish(k, v || opts); }, this); return ret; } events = edata.events; ce = events[type]; if (ce) { // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event'); if (opts) { ce.applyConfig(opts, true); } } else { defaults = edata.defaults; // apply defaults ce = new Y.CustomEvent(type, (opts) ? Y.merge(defaults, opts) : defaults); events[type] = ce; } // make sure we turn the broadcast flag off if this // event was published as a result of bubbling // if (opts instanceof Y.CustomEvent) { // events[type].broadcast = false; // } return events[type]; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @private */ _monitor: function(what, type, o) { var monitorevt, ce = this.getEvent(type); if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; // Y.log('monitoring: ' + monitorevt); o.monitored = what; this.fire.call(this, monitorevt, o); } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {EventTarget} the event host * */ fire: function(type) { var typeIncluded = L.isString(type), t = (typeIncluded) ? type : (type && type.type), ce, ret, pre = this._yuievt.config.prefix, ce2, args = (typeIncluded) ? YArray(arguments, 1, true) : arguments; t = (pre) ? _getType(t, pre) : t; this._monitor('fire', t, { args: args }); ce = this.getEvent(t, true); ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } // this event has not been published or subscribed to if (!ce) { if (this._yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { ce.sibling = ce2; ret = ce.fire.apply(ce, args); } return (this._yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); // console.log(type); ce2 = this.getEvent(type, true); if (ce2) { // console.log("GOT ONE: " + type); ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; // ret = ce2.fire.apply(ce2, a); } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {string} the type, or name of the event * @param prefixed {string} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * @method after * @param type {string} The type of the event * @param fn {Function} The callback * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return the event target or a detach handle per 'chain' config */ after: function(type, fn) { var a = YArray(arguments, 0, true); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype, false, false, { bubbles: false }); ET.call(Y); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? })(); /** * <code>YUI</code>'s <code>on</code> method is a unified interface for subscribing to * most events exposed by YUI. This includes custom events, DOM events, and * function events. <code>detach</code> is also provided to remove listeners * serviced by this function. * * The signature that <code>on</code> accepts varies depending on the type * of event being consumed. Refer to the specific methods that will * service a specific request for additional information about subscribing * to that type of event. * * <ul> * <li>Custom events. These events are defined by various * modules in the library. This type of event is delegated to * <code>EventTarget</code>'s <code>on</code> method. * <ul> * <li>The type of the event</li> * <li>The callback to execute</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example: * <code>Y.on('drag:drophit', function() { // start work });</code> * </li> * <li>DOM events. These are moments reported by the browser related * to browser functionality and user interaction. * This type of event is delegated to <code>Event</code>'s * <code>attach</code> method. * <ul> * <li>The type of the event</li> * <li>The callback to execute</li> * <li>The specification for the Node(s) to attach the listener * to. This can be a selector, collections, or Node/Element * refereces.</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example: * <code>Y.on('click', function(e) { // something was clicked }, '#someelement');</code> * </li> * <li>Function events. These events can be used to react before or after a * function is executed. This type of event is delegated to <code>Event.Do</code>'s * <code>before</code> method. * <ul> * <li>The callback to execute</li> * <li>The object that has the function that will be listened for.</li> * <li>The name of the function to listen for.</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example <code>Y.on(function(arg1, arg2, etc) { // obj.methodname was executed }, obj 'methodname');</code> * </li> * </ul> * * <code>on</code> corresponds to the moment before any default behavior of * the event. <code>after</code> works the same way, but these listeners * execute after the event's default behavior. <code>before</code> is an * alias for <code>on</code>. * * @method on * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ /** * Listen for an event one time. Equivalent to <code>on</code>, except that * the listener is immediately detached when executed. * @see on * @method once * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ /** * after() is a unified interface for subscribing to * most events exposed by YUI. This includes custom events, * DOM events, and AOP events. This works the same way as * the on() function, only it operates after any default * behavior for the event has executed. @see <code>on</code> for more * information. * @method after * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ }, '@VERSION@' ,{requires:['oop']}); YUI.add('event-custom-complex', function(Y) { /** * Adds event facades, preventable default behavior, and bubbling. * events. * @module event-custom * @submodule event-custom-complex */ (function() { var FACADE, FACADE_KEYS, CEProto = Y.CustomEvent.prototype, ETProto = Y.EventTarget.prototype; /** * Wraps and protects a custom event for use when emitFacade is set to true. * Requires the event-custom-complex module * @class EventFacade * @param e {Event} the custom event * @param currentTarget {HTMLElement} the element the listener was attached to */ Y.EventFacade = function(e, currentTarget) { e = e || {}; /** * The arguments passed to fire * @property details * @type Array */ this.details = e.details; /** * The event type, this can be overridden by the fire() payload * @property type * @type string */ this.type = e.type; /** * The real event type * @property type * @type string */ this._type = e.type; ////////////////////////////////////////////////////// /** * Node reference for the targeted eventtarget * @propery target * @type Node */ this.target = e.target; /** * Node reference for the element that the listener was attached to. * @propery currentTarget * @type Node */ this.currentTarget = currentTarget; /** * Node reference to the relatedTarget * @propery relatedTarget * @type Node */ this.relatedTarget = e.relatedTarget; /** * Stops the propagation to the next bubble target * @method stopPropagation */ this.stopPropagation = function() { e.stopPropagation(); this.stopped = 1; }; /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ this.stopImmediatePropagation = function() { e.stopImmediatePropagation(); this.stopped = 2; }; /** * Prevents the event's default behavior * @method preventDefault */ this.preventDefault = function() { e.preventDefault(); this.prevented = 1; }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ this.halt = function(immediate) { e.halt(immediate); this.prevented = 1; this.stopped = (immediate) ? 2 : 1; }; }; CEProto.fireComplex = function(args) { var es = Y.Env._eventstack, ef, q, queue, ce, ret, events, subs, self = this, host = self.host || self, next, oldbubble; if (es) { // queue this event if the current item in the queue bubbles if (self.queuable && self.type != es.next.type) { self.log('queue ' + self.type); es.queue.push([self, args]); return true; } } else { Y.Env._eventstack = { // id of the first event in the stack id: self.id, next: self, silent: self.silent, stopped: 0, prevented: 0, bubbling: null, type: self.type, // defaultFnQueue: new Y.Queue(), afterQueue: new Y.Queue(), defaultTargetOnly: self.defaultTargetOnly, queue: [] }; es = Y.Env._eventstack; } subs = self.getSubs(); self.stopped = (self.type !== es.type) ? 0 : es.stopped; self.prevented = (self.type !== es.type) ? 0 : es.prevented; self.target = self.target || host; events = new Y.EventTarget({ fireOnce: true, context: host }); self.events = events; if (self.preventedFn) { events.on('prevented', self.preventedFn); } if (self.stoppedFn) { events.on('stopped', self.stoppedFn); } self.currentTarget = host; self.details = args.slice(); // original arguments in the details // self.log("Firing " + self + ", " + "args: " + args); self.log("Firing " + self.type); self._facade = null; // kill facade to eliminate stale properties ef = self._getFacade(args); if (Y.Lang.isObject(args[0])) { args[0] = ef; } else { args.unshift(ef); } // if (subCount) { if (subs[0]) { // self._procSubs(Y.merge(self.subscribers), args, ef); self._procSubs(subs[0], args, ef); } // bubble if this is hosted in an event target and propagation has not been stopped if (self.bubbles && host.bubble && !self.stopped) { oldbubble = es.bubbling; // self.bubbling = true; es.bubbling = self.type; // if (host !== ef.target || es.type != self.type) { if (es.type != self.type) { es.stopped = 0; es.prevented = 0; } ret = host.bubble(self); self.stopped = Math.max(self.stopped, es.stopped); self.prevented = Math.max(self.prevented, es.prevented); // self.bubbling = false; es.bubbling = oldbubble; } // execute the default behavior if not prevented // console.log('defaultTargetOnly: ' + self.defaultTargetOnly); // console.log('host === target: ' + (host === ef.target)); // if (self.defaultFn && !self.prevented && ((!self.defaultTargetOnly) || host === es.id === self.id)) { if (self.defaultFn && !self.prevented && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) { // if (es.id === self.id) { // self.defaultFn.apply(host, args); // while ((next = es.defaultFnQueue.last())) { // next(); // } // } else { // es.defaultFnQueue.add(function() { // self.defaultFn.apply(host, args); // }); // } self.defaultFn.apply(host, args); } // broadcast listeners are fired as discreet events on the // YUI instance and potentially the YUI global. self._broadcast(args); // process after listeners. If the default behavior was // prevented, the after events don't fire. // if (self.afterCount && !self.prevented && self.stopped < 2) { // if (subs[1] && !self.prevented && self.stopped < 2) { // // self._procSubs(Y.merge(self.afters), args, ef); // self._procSubs(subs[1], args, ef); // } // Queue the after if (subs[1] && !self.prevented && self.stopped < 2) { if (es.id === self.id || self.type != host._yuievt.bubbling) { self._procSubs(subs[1], args, ef); while ((next = es.afterQueue.last())) { next(); } } else { es.afterQueue.add(function() { self._procSubs(subs[1], args, ef); }); } } self.target = null; // es.stopped = 0; // es.prevented = 0; if (es.id === self.id) { queue = es.queue; while (queue.length) { q = queue.pop(); ce = q[0]; // set up stack to allow the next item to be processed es.next = ce; ce.fire.apply(ce, q[1]); // es.stopped = 0; // es.prevented = 0; } Y.Env._eventstack = null; } ret = !(self.stopped); if (self.type != host._yuievt.bubbling) { es.stopped = 0; es.prevented = 0; self.stopped = 0; self.prevented = 0; } return ret; }; CEProto._getFacade = function() { var ef = this._facade, o, o2, args = this.details; if (!ef) { ef = new Y.EventFacade(this, this.currentTarget); } // if the first argument is an object literal, apply the // properties to the event facade o = args && args[0]; if (Y.Lang.isObject(o, true)) { o2 = {}; // protect the event facade properties Y.mix(o2, ef, true, FACADE_KEYS); // mix the data Y.mix(ef, o, true); // restore ef Y.mix(ef, o2, true, FACADE_KEYS); // Allow the event type to be faked // http://yuilibrary.com/projects/yui3/ticket/2528376 ef.type = o.type || ef.type; } // update the details field with the arguments // ef.type = this.type; ef.details = this.details; // use the original target when the event bubbled to this target ef.target = this.originalTarget || this.target; ef.currentTarget = this.currentTarget; ef.stopped = 0; ef.prevented = 0; this._facade = ef; return this._facade; }; /** * Stop propagation to bubble targets * @for CustomEvent * @method stopPropagation */ CEProto.stopPropagation = function() { this.stopped = 1; Y.Env._eventstack.stopped = 1; this.events.fire('stopped', this); }; /** * Stops propagation to bubble targets, and prevents any remaining * subscribers on the current target from executing. * @method stopImmediatePropagation */ CEProto.stopImmediatePropagation = function() { this.stopped = 2; Y.Env._eventstack.stopped = 2; this.events.fire('stopped', this); }; /** * Prevents the execution of this event's defaultFn * @method preventDefault */ CEProto.preventDefault = function() { if (this.preventable) { this.prevented = 1; Y.Env._eventstack.prevented = 1; this.events.fire('prevented', this); } }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ CEProto.halt = function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); }; /** * Registers another EventTarget as a bubble target. Bubble order * is determined by the order registered. Multiple targets can * be specified. * * Events can only bubble if emitFacade is true. * * Included in the event-custom-complex submodule. * * @method addTarget * @param o {EventTarget} the target to add * @for EventTarget */ ETProto.addTarget = function(o) { this._yuievt.targets[Y.stamp(o)] = o; this._yuievt.hasTargets = true; }; /** * Returns an array of bubble targets for this object. * @method getTargets * @return EventTarget[] */ ETProto.getTargets = function() { return Y.Object.values(this._yuievt.targets); }; /** * Removes a bubble target * @method removeTarget * @param o {EventTarget} the target to remove * @for EventTarget */ ETProto.removeTarget = function(o) { delete this._yuievt.targets[Y.stamp(o)]; }; /** * Propagate an event. Requires the event-custom-complex module. * @method bubble * @param evt {Event.Custom} the custom event to propagate * @return {boolean} the aggregated return value from Event.Custom.fire * @for EventTarget */ ETProto.bubble = function(evt, args, target) { var targs = this._yuievt.targets, ret = true, t, type = evt && evt.type, ce, i, bc, ce2, originalTarget = target || (evt && evt.target) || this, es = Y.Env._eventstack, oldbubble; if (!evt || ((!evt.stopped) && targs)) { // Y.log('Bubbling ' + evt.type); for (i in targs) { if (targs.hasOwnProperty(i)) { t = targs[i]; ce = t.getEvent(type, true); ce2 = t.getSibling(type, ce); if (ce2 && !ce) { ce = t.publish(type); } oldbubble = t._yuievt.bubbling; t._yuievt.bubbling = type; // if this event was not published on the bubble target, // continue propagating the event. if (!ce) { if (t._yuievt.hasTargets) { t.bubble(evt, args, originalTarget); } } else { ce.sibling = ce2; // set the original target to that the target payload on the // facade is correct. ce.target = originalTarget; ce.originalTarget = originalTarget; ce.currentTarget = t; bc = ce.broadcast; ce.broadcast = false; // default publish may not have emitFacade true -- that // shouldn't be what the implementer meant to do ce.emitFacade = true; ret = ret && ce.fire.apply(ce, args || evt.details || []); ce.broadcast = bc; ce.originalTarget = null; // stopPropagation() was called if (ce.stopped) { break; } } t._yuievt.bubbling = oldbubble; } } } return ret; }; FACADE = new Y.EventFacade(); FACADE_KEYS = Y.Object.keys(FACADE); })(); }, '@VERSION@' ,{requires:['event-custom-base']}); YUI.add('event-custom', function(Y){}, '@VERSION@' ,{use:['event-custom-base', 'event-custom-complex']});
src/js/components/icons/base/Sort.js
odedre/grommet-final
/** * @description Sort SVG Icon. * @property {string} a11yTitle - Accessibility Title. If not set uses the default title of the status icon. * @property {string} colorIndex - The color identifier to use for the stroke color. * If not specified, this component will default to muiTheme.palette.textColor. * @property {xsmall|small|medium|large|xlarge|huge} size - The icon size. Defaults to small. * @property {boolean} responsive - Allows you to redefine what the coordinates. * @example * <svg width="24" height="24" ><path d="M7,3 L22,3 M7,9 L16,9 M7,15 L22,15 M2,2 L4,2 L4,4 L2,4 L2,2 Z M2,8 L4,8 L4,10 L2,10 L2,8 Z M2,14 L4,14 L4,16 L2,16 L2,14 Z M2,20 L4,20 L4,22 L2,22 L2,20 Z M7,21 L16,21"/></svg> */ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CSSClassnames from '../../../utils/CSSClassnames'; import Intl from '../../../utils/Intl'; import Props from '../../../utils/Props'; const CLASS_ROOT = CSSClassnames.CONTROL_ICON; const COLOR_INDEX = CSSClassnames.COLOR_INDEX; export default class Icon extends Component { render () { const { className, colorIndex } = this.props; let { a11yTitle, size, responsive } = this.props; let { intl } = this.context; const classes = classnames( CLASS_ROOT, `${CLASS_ROOT}-sort`, className, { [`${CLASS_ROOT}--${size}`]: size, [`${CLASS_ROOT}--responsive`]: responsive, [`${COLOR_INDEX}-${colorIndex}`]: colorIndex } ); a11yTitle = a11yTitle || Intl.getMessage(intl, 'sort'); const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000" strokeWidth="2" d="M7,3 L22,3 M7,9 L16,9 M7,15 L22,15 M2,2 L4,2 L4,4 L2,4 L2,2 Z M2,8 L4,8 L4,10 L2,10 L2,8 Z M2,14 L4,14 L4,16 L2,16 L2,14 Z M2,20 L4,20 L4,22 L2,22 L2,20 Z M7,21 L16,21"/></svg>; } }; Icon.contextTypes = { intl: PropTypes.object }; Icon.defaultProps = { responsive: true }; Icon.displayName = 'Sort'; Icon.icon = true; Icon.propTypes = { a11yTitle: PropTypes.string, colorIndex: PropTypes.string, size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']), responsive: PropTypes.bool };
components/chatbar/index.js
craigspaeth/baobab-spike
import React from 'react' import { tree, chats } from 'tree' import functional from 'react-functional' let { input, div } = React.DOM let componentDidUpdate = (_, __, refs) => { if (tree.get().closedAuthModal) refs.input.focus() } let onKeyUp = (refs, e) => { if (e.which != 13) return chats.push({ message: e.target.value, from: tree.get().currentUserName }) refs.input.focus() } let onChange = (refs, e) => { tree.set('chatInputValue', refs.input.value) } let render = (props, cmp) => ( div({ style: Object.assign({}, styles.divinput, styles.div) }, input({ style: Object.assign({}, styles.divinput, styles.input), placeholder: 'Type in a chat', onChange: onChange.bind(null, cmp.refs), onKeyUp: onKeyUp.bind(null, cmp.refs), value: tree.get().chatInputValue, ref: 'input' })) ) let styles = { divinput: { height: '50px' }, div: { width: '100%', position: 'absolute', bottom: '0', left: '0', padding: '10px' }, input: { width: 'calc(100% - 20px)' } } export default functional({ componentDidUpdate, onKeyUp, render, onChange })
docs/src/examples/addons/Radio/Types/index.js
Semantic-Org/Semantic-UI-React
import React from 'react' import { Message } from 'semantic-ui-react' import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample' import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection' const RadioTypesExamples = () => ( <ExampleSection title='Types'> <ComponentExample title='Radio' description='A radio for checking.' examplePath='addons/Radio/Types/RadioExampleRadio' /> <ComponentExample title='Toggle' description='A radio can toggle.' examplePath='addons/Radio/Types/RadioExampleToggle' /> <ComponentExample title='Slider' description='A radio can look like a slider.' examplePath='addons/Radio/Types/RadioExampleSlider' /> <ComponentExample title='Radio Group' description='Radios can be part of a group.' examplePath='addons/Radio/Types/RadioExampleRadioGroup' > <Message warning> Radios in a group must be <a href='https://facebook.github.io/react/docs/forms.html#controlled-components' rel='noopener noreferrer' target='_blank' > &nbsp;controlled components. </a> </Message> </ComponentExample> </ExampleSection> ) export default RadioTypesExamples
node_modules/react-router-dom/Link.js
vinhtran19950804/procure_react
'use strict'; exports.__esModule = true; 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; }; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _propTypes = require('prop-types'); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var isModifiedEvent = function isModifiedEvent(event) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); }; /** * The public API for rendering a history-aware <a>. */ var Link = function (_React$Component) { _inherits(Link, _React$Component); function Link() { var _temp, _this, _ret; _classCallCheck(this, Link); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) { if (_this.props.onClick) _this.props.onClick(event); if (!event.defaultPrevented && // onClick prevented default event.button === 0 && // ignore right clicks !_this.props.target && // let browser handle "target=_blank" etc. !isModifiedEvent(event) // ignore clicks with modifier keys ) { event.preventDefault(); var history = _this.context.router.history; var _this$props = _this.props, replace = _this$props.replace, to = _this$props.to; if (replace) { history.replace(to); } else { history.push(to); } } }, _temp), _possibleConstructorReturn(_this, _ret); } Link.prototype.render = function render() { var _props = this.props, replace = _props.replace, to = _props.to, props = _objectWithoutProperties(_props, ['replace', 'to']); // eslint-disable-line no-unused-vars var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to); return _react2.default.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href })); }; return Link; }(_react2.default.Component); Link.propTypes = { onClick: _propTypes2.default.func, target: _propTypes2.default.string, replace: _propTypes2.default.bool, to: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired }; Link.defaultProps = { replace: false }; Link.contextTypes = { router: _propTypes2.default.shape({ history: _propTypes2.default.shape({ push: _propTypes2.default.func.isRequired, replace: _propTypes2.default.func.isRequired, createHref: _propTypes2.default.func.isRequired }).isRequired }).isRequired }; exports.default = Link;
packages/react-error-overlay/src/components/CloseButton.js
just-boris/create-preact-app
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* @flow */ import React from 'react'; import { black } from '../styles'; const closeButtonStyle = { color: black, lineHeight: '1rem', fontSize: '1.5rem', padding: '1rem', cursor: 'pointer', position: 'absolute', right: 0, top: 0, }; type CloseCallback = () => void; function CloseButton({ close }: {| close: CloseCallback |}) { return ( <span title="Click or press Escape to dismiss." onClick={close} style={closeButtonStyle} > × </span> ); } export default CloseButton;
ajax/libs/rxjs/2.3.12/rx.js
hpneo/cdnjs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; var root = (objectTypes[typeof window] && window) || this, freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { root = freeGlobal; } var Rx = { internals: {}, config: { Promise: root.Promise // Detect if promise exists }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; }, identity = Rx.helpers.identity = function (x) { return x; }, pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = Date.now, defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; }, asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, not = Rx.helpers.not = function (a) { return !a; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { return typeof value == 'function' || false; } // fallback for older versions of Chrome and Safari if (isFn(/x/)) { isFn = function(value) { return typeof value == 'function' && toString.call(value) == '[object Function]'; }; } return isFn; }()); // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; Rx.iterator = $iterator$; /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass, errorProto = Error.prototype, objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch(e) { suportNodeClass = true; } var shadowedProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; nonEnumProps[objectClass] = { 'constructor': true }; var support = {}; (function () { var ctor = function() { this.x = 1; }, props = []; ctor.prototype = { 'valueOf': 1, 'y': 1 }; for (var key in new ctor) { props.push(key); } for (key in arguments) { } // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); // Detect if `prototype` properties are enumerable by default. support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); // Detect if `arguments` object indexes are non-enumerable support.nonEnumArgs = key != 0; // Detect if properties shadowing those on `Object.prototype` are non-enumerable. support.nonEnumShadows = !/valueOf/.test(props); }(1)); function isObject(value) { // check if the value is the ECMAScript language type of Object // http://es5.github.io/#x8 // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; return value && (type == 'function' || type == 'object') || false; } function keysIn(object) { var result = []; if (!isObject(object)) { return result; } if (support.nonEnumArgs && object.length && isArguments(object)) { object = slice.call(object); } var skipProto = support.enumPrototypes && typeof object == 'function', skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error); for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name'))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var ctor = object.constructor, index = -1, length = shadowedProps.length; if (object === (ctor && ctor.prototype)) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } while (++index < length) { key = shadowedProps[index]; if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { result.push(key); } } } return result; } function internalFor(object, callback, keysFunc) { var index = -1, props = keysFunc(object), length = props.length; while (++index < length) { var key = props[index]; if (callback(object[key], key, object) === false) { break; } } return object; } function internalForIn(object, callback) { return internalFor(object, callback, keysIn); } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } var isEqual = Rx.internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && (a == null || b == null || (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { return false; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b // but treat `-0` vs. `+0` as not equal : (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && ('constructor' in a && 'constructor' in b) ) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var initedStack = !stackA; stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary length = a.length; size = b.length; result = size == length; if (result) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } } } else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly internalForIn(b, function(value, key, b) { if (hasOwnProperty.call(b, key)) { // count the number of properties. size++; // deep compare each property value. return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); } }); if (result) { // ensure both objects have the same number of properties internalForIn(a, function(value, key, a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } }); } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; var addProperties = Rx.internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Collections function IndexedItem(id, value) { this.id = id; this.value = value; } IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); c === 0 && (c = this.id - other.id); return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { +index || (index = 0); if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () { function BooleanDisposable () { this.isDisposed = false; this.current = null; } var booleanDisposablePrototype = BooleanDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } old && old.dispose(); }; return BooleanDisposable; }()); var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } ScheduledDisposable.prototype.dispose = function () { var parent = this; this.scheduler.schedule(function () { if (!parent.isDisposed) { parent.isDisposed = true; parent.disposable.dispose(); } }); }; var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function scheduleInnerRecursive(action, self) { action(function(dt) { self(action, dt); }); } /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, action); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new Error('Periodic scheduling not supported.'); } var s = state; var id = root.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { root.clearInterval(id); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchError = schedulerProto['catch'] = function (handler) { return new CatchScheduler(this, handler); }; }(Scheduler.prototype)); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); /** * Gets a scheduler that schedules work immediately on the current thread. */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { var dt = normalizeTime(dt); while (dt - this.now() > 0) { } return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function runTrampoline (q) { var item; while (q.length > 0) { item = q.dequeue(); if (!item.isCancelled()) { // Note, do not schedule blocking work! while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } } function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); try { runTrampoline(queue); } catch (e) { throw e; } finally { queue = null; } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return !queue; }; currentScheduler.ensureTrampoline = function (action) { if (!queue) { this.schedule(action); } else { action(); } }; return currentScheduler; }()); var scheduleMethod, clearMethod = noop; var localTimer = (function () { var localSetTimeout, localClearTimeout = noop; if ('WScript' in this) { localSetTimeout = function (fn, time) { WScript.Sleep(time); fn(); }; } else if (!!root.setTimeout) { localSetTimeout = root.setTimeout; localClearTimeout = root.clearTimeout; } else { throw new Error('No concurrency detected!'); } return { setTimeout: localSetTimeout, clearTimeout: localClearTimeout }; }()); var localSetTimeout = localTimer.setTimeout, localClearTimeout = localTimer.clearTimeout; (function () { var reNative = RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate, clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' && !reNative.test(clearImmediate) && clearImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('','*'); root.onmessage = oldHandler; return isAsync; } // Use in order, nextTick, setImmediate, postMessage, MessageChannel, script readystatechanged, setTimeout if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (typeof setImmediate === 'function') { scheduleMethod = setImmediate; clearMethod = clearImmediate; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (root.addEventListener) { root.addEventListener('message', onGlobalPostMessage, false); } else { root.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; root.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return localSetTimeout(action, 0); }; clearMethod = localClearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = localSetTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { localClearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** @private */ var CatchScheduler = (function (_super) { function localNow() { return this._scheduler.now(); } function scheduleNow(state, action) { return this._scheduler.scheduleWithState(state, this._wrap(action)); } function scheduleRelative(state, dueTime, action) { return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action)); } function scheduleAbsolute(state, dueTime, action) { return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action)); } inherits(CatchScheduler, _super); /** @private */ function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; _super.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } /** @private */ CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; /** @private */ CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { try { return action(parent._getRecursiveWrapper(self), state); } catch (e) { if (!parent._handler(e)) { throw e; } return disposableEmpty; } }; }; /** @private */ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; /** @private */ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) { if (failed) { return null; } try { return action(state1); } catch (e) { failed = true; if (!self._handler(e)) { throw e; } d.dispose(); return null; } })); return d; }; return CatchScheduler; }(Scheduler)); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObservable(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var notification = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); notification.kind === 'N' && observer.onCompleted(); }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (exception) { var notification = new Notification('E'); notification.exception = exception; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); var Enumerator = Rx.internals.Enumerator = function (next) { this._next = next; }; Enumerator.prototype.next = function () { return this._next(); }; Enumerator.prototype[$iterator$] = function () { return this; } var Enumerable = Rx.internals.Enumerable = function (iterator) { this._iterator = iterator; }; Enumerable.prototype[$iterator$] = function () { return this._iterator(); }; Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var currentItem; if (isDisposed) { return; } try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { observer.onCompleted(); return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, lastException, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { if (isDisposed) { return; } var currentItem; try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount == null) { repeatCount = -1; } return new Enumerable(function () { var left = repeatCount; return new Enumerator(function () { if (left === 0) { return doneEnumerator; } if (left > 0) { left--; } return { done: false, value: value }; }); }); }; var enumerableOf = Enumerable.of = function (source, selector, thisArg) { selector || (selector = identity); return new Enumerable(function () { var index = -1; return new Enumerator( function () { return ++index < source.length ? { done: false, value: selector.call(thisArg, source[index], index, source) } : doneEnumerator; }); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { return new AnonymousObserver(function (x) { return handler.call(thisArg, notificationCreateOnNext(x)); }, function (e) { return handler.call(thisArg, notificationCreateOnError(e)); }, function () { return handler.call(thisArg, notificationCreateOnCompleted()); }); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { inherits(AbstractObserver, __super__); /** * Creates a new observer in a non-stopped state. */ function AbstractObserver() { this.isStopped = false; __super__.call(this); } /** * Notifies the observer of a new element in the sequence. * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { inherits(AnonymousObserver, __super__); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { __super__.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (error) { this._onError(error); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (_super) { inherits(CheckedObserver, _super); function CheckedObserver(observer) { _super.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); try { this._observer.onNext(value); } catch (e) { throw e; } finally { this._state = 0; } }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); try { this._observer.onError(err); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); try { this._observer.onCompleted(); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { inherits(ScheduledObserver, __super__); function ScheduledObserver(scheduler, observer) { __super__.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; ScheduledObserver.prototype.error = function (err) { var self = this; this.queue.push(function () { self.observer.onError(err); }); }; ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; ScheduledObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); var ObserveOnObserver = (function (__super__) { inherits(ObserveOnObserver, __super__); function ObserveOnObserver() { __super__.apply(this, arguments); } ObserveOnObserver.prototype.next = function (value) { __super__.prototype.next.call(this, value); this.ensureActive(); }; ObserveOnObserver.prototype.error = function (e) { __super__.prototype.error.call(this, e); this.ensureActive(); }; ObserveOnObserver.prototype.completed = function () { __super__.prototype.completed.call(this); this.ensureActive(); }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; /** * Subscribes an observer to the observable sequence. * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { return this._subscribe(typeof observerOrOnNext === 'object' ? observerOrOnNext : observerCreate(observerOrOnNext, onError, onCompleted)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onNext The function to invoke on each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnNext = function (onNext, thisArg) { return this._subscribe(observerCreate(arguments.length === 2 ? function(x) { onNext.call(thisArg, x); } : onNext)); }; /** * Subscribes to an exceptional condition in the sequence with an optional "this" argument. * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnError = function (onError, thisArg) { return this._subscribe(observerCreate(null, arguments.length === 2 ? function(e) { onError.call(thisArg, e); } : onError)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { return this._subscribe(observerCreate(null, null, arguments.length === 2 ? function() { onCompleted.call(thisArg); } : onCompleted)); }; return Observable; })(); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(new ObserveOnObserver(scheduler, observer)); }); }; /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(scheduler.schedule(function () { d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer))); })); return d; }); }; /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise) { return observableDefer(function () { var subject = new Rx.AsyncSubject(); promise.then( function (value) { if (!subject.isDisposed) { subject.onNext(value); subject.onCompleted(); } }, subject.onError.bind(subject)); return subject; }); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new TypeError('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value, hasValue = false; source.subscribe(function (v) { value = v; hasValue = true; }, reject, function () { hasValue && resolve(value); }); }); }; /** * Creates a list from an observable sequence. * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { var self = this; return new AnonymousObservable(function(observer) { var arr = []; return self.subscribe( arr.push.bind(arr), observer.onError.bind(observer), function () { observer.onNext(arr); observer.onCompleted(); }); }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; var maxSafeInteger = Math.pow(2, 53) - 1; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function isIterable(o) { return o[$iterator$] !== undefined; } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } function isCallable(f) { return Object.prototype.toString.call(f) === '[object Function]' && typeof f === 'function'; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isCallable(mapFn)) { throw new Error('mapFn when provided must be a function'); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var list = Object(iterable), objIsIterable = isIterable(list), len = objIsIterable ? 0 : toLength(list), it = objIsIterable ? list[$iterator$]() : null, i = 0; return scheduler.scheduleRecursive(function (self) { if (i < len || objIsIterable) { var result; if (objIsIterable) { var next = it.next(); if (next.done) { observer.onCompleted(); return; } result = next.value; } else { result = list[i]; } if (mapFn && isCallable(mapFn)) { try { result = thisArg ? mapFn.call(thisArg, result, i) : mapFn(result, i); } catch (e) { observer.onError(e); return; } } observer.onNext(result); i++; self(); } else { observer.onCompleted(); } }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * var res = Rx.Observable.fromArray([1,2,3]); * var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return observableFromArray(args); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ var observableOf = Observable.ofWithScheduler = function (scheduler) { var len = arguments.length - 1, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i + 1]; } return observableFromArray(args, scheduler); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just', and 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.returnValue = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwError' for browsers <IE9. * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = Observable.throwError = function (exception, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new AnonymousObservable(function (observer) { var disposable = disposableEmpty, resource, source; try { resource = resourceFactory(); resource && (disposable = resource); source = observableFactory(resource); } catch (exception) { return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable); } return new CompositeDisposable(source.subscribe(observer), disposable); }); }; /** * Propagates the observable sequence or Promise that reacts first. * @param {Observable} rightSource Second observable sequence or Promise. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(rightSource) && (rightSource = observableFromPromise(rightSource)); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } leftSubscription.setDisposable(leftSource.subscribe(function (left) { choiceL(); if (choice === leftChoice) { observer.onNext(left); } }, function (err) { choiceL(); if (choice === leftChoice) { observer.onError(err); } }, function () { choiceL(); if (choice === leftChoice) { observer.onCompleted(); } })); rightSubscription.setDisposable(rightSource.subscribe(function (right) { choiceR(); if (choice === rightChoice) { observer.onNext(right); } }, function (err) { choiceR(); if (choice === rightChoice) { observer.onError(err); } }, function () { choiceR(); if (choice === rightChoice) { observer.onCompleted(); } })); return new CompositeDisposable(leftSubscription, rightSubscription); }); }; /** * Propagates the observable sequence or Promise that reacts first. * * @example * var = Rx.Observable.amb(xs, ys, zs); * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items = argsOrArray(arguments, 0); function func(previous, current) { return previous.amb(current); } for (var i = 0, len = items.length; i < len; i++) { acc = func(acc, items[i]); } return acc; }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } isPromise(result) && (result = observableFromPromise(result)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) { return typeof handlerOrSecond === 'function' ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs. * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = Observable.catchError = Observable['catch'] = function () { return enumerableOf(argsOrArray(arguments, 0)).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence. * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { return enumerableOf(argsOrArray(arguments, 0)).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = []; function subscribe(xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); // Check for promises support isPromise(xs) && (xs = observableFromPromise(xs)); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(subscription); if (q.length > 0) { subscribe(q.shift()); } else { activeCount--; isStopped && activeCount === 0 && observer.onCompleted(); } })); } group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; activeCount === 0 && observer.onCompleted(); })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll = function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); // Check for promises support isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(innerSubscription); isStopped && group.length === 1 && observer.onCompleted(); })); }, observer.onError.bind(observer), function () { isStopped = true; group.length === 1 && observer.onCompleted(); })); return group; }); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs); * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]); * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var pos = 0, subscription = new SerialDisposable(), cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, d; if (pos < sources.length) { current = sources[pos++]; isPromise(current) && (current = observableFromPromise(current)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self)); } else { observer.onCompleted(); } }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { isOpen && observer.onNext(left); }, observer.onError.bind(observer), function () { isOpen && observer.onCompleted(); })); isPromise(other) && (other = observableFromPromise(other)); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe( function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); // Check if Promise or Observable isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); d.setDisposable(innerSource.subscribe( function (x) { latest === id && observer.onNext(x); }, function (e) { latest === id && observer.onError(e); }, function () { if (latest === id) { hasLatest = false; isStopped && observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; !hasLatest && observer.onCompleted(); }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { isPromise(other) && (other = observableFromPromise(other)); return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { return new AnonymousObservable(this.subscribe.bind(this)); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * * @example * var res = xs.bufferWithCount(10); * var res = xs.bufferWithCount(10, 1); * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = function (count, skip) { if (typeof skip !== 'number') { skip = count; } return this.windowWithCount(count, skip).selectMany(function (x) { return x.toArray(); }).where(function (x) { return x.length > 0; }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.doAction = observableProto.tap = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (err) { if (onError) { try { onError(err); } catch (e) { observer.onError(e); } } observer.onError(err); }, function () { if (onCompleted) { try { onCompleted(); } catch (e) { observer.onError(e); } } observer.onCompleted(); }); }); }; /** * Invokes an action for each element in the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onNext Action to invoke for each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { return this.tap(arguments.length === 2 ? function (x) { onNext.call(thisArg, x); } : onNext); }; /** * Invokes an action upon exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { return this.tap(noop, arguments.length === 2 ? function (e) { onError.call(thisArg, e); } : onError); }; /** * Invokes an action upon graceful termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { return this.tap(noop, null, arguments.length === 2 ? function () { onCompleted.call(thisArg); } : onCompleted); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * var res = observable.finallyAction(function () { console.log('sequence ended'; }); * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription; try { subscription = source.subscribe(observer); } catch (e) { action(); throw e; } return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * var res = repeated = source.repeat(); * var res = repeated = source.repeat(42); * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { !hasValue && (hasValue = true); try { if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { !hasValue && hasSeed && observer.onNext(seed); observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && observer.onNext(q.shift()); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * @example * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * @param {Arguments} args The specified values to prepend to the observable sequence * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && isScheduler(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableOf([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence. * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { while(q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); }); }); }; /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * * var res = xs.windowWithCount(10); * var res = xs.windowWithCount(10, 1); * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = function (count, skip) { var source = this; +count || (count = 0); Math.abs(count) === Infinity && (count = 0); if (count <= 0) { throw new Error(argumentOutOfRange); } skip == null && (skip = count); +skip || (skip = 0); Math.abs(skip) === Infinity && (skip = 0); if (skip <= 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = []; function createWindow () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } createWindow(); m.setDisposable(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; c >=0 && c % skip === 0 && q.shift().onCompleted(); ++n % skip === 0 && createWindow(); }, function (e) { while (q.length > 0) { q.shift().onError(e); } observer.onError(e); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }); }; function concatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i); return isPromise(result) ? observableFromPromise(result) : result; }).concatAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { if (resultSelector) { return this.concatMap(function (x, i) { var selectorResult = selector(x, i), result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult; return result.map(function (y) { return resultSelector(x, y, i); }); }); } return typeof selector === 'function' ? concatMap(this, selector, thisArg) : concatMap(this, function () { return selector; }); }; /** * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }).concatAll(); }; /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; if (defaultValue === undefined) { defaultValue = null; } return new AnonymousObservable(function (observer) { var found = false; return source.subscribe(function (x) { found = true; observer.onNext(x); }, observer.onError.bind(observer), function () { if (!found) { observer.onNext(defaultValue); } observer.onCompleted(); }); }); }; // Swap out for Array.findIndex function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; } function HashSet(comparer) { this.comparer = comparer; this.set = []; } HashSet.prototype.push = function(value) { var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; retValue && this.set.push(value); return retValue; }; /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [comparer] Used to compare items in the collection. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, comparer) { var source = this; comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hashSet = new HashSet(comparer); return source.subscribe(function (x) { var key = x; if (keySelector) { try { key = keySelector(x); } catch (e) { observer.onError(e); return; } } hashSet.push(key) && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} prop The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (prop) { return this.map(function (x) { return x[prop]; }); }; /** * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }).mergeAll(); }; function flatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i); return isPromise(result) ? observableFromPromise(result) : result; }).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { if (resultSelector) { return this.flatMap(function (x, i) { var selectorResult = selector(x, i), result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult; return result.map(function (y) { return resultSelector(x, y, i); }); }, thisArg); } return typeof selector === 'function' ? flatMap(this, selector, thisArg) : flatMap(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var source = this; return new AnonymousObservable(function (observer) { var remaining = count; return source.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } running && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new RangeError(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining-- > 0) { observer.onNext(x); remaining === 0 && observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (e) { observer.onError(e); return; } shouldRun && observer.onNext(value); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /* * Performs a exclusive waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @returns {Observable} A exclusive observable with only the results that happen when subscribed. */ observableProto.exclusive = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasCurrent = false, isStopped = false, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); var innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (!hasCurrent && g.length === 1) { observer.onCompleted(); } })); return g; }); }; /* * Performs a exclusive map waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @param {Function} selector Selector to invoke for every item in the current subscription. * @param {Any} [thisArg] An optional context to invoke with the selector parameter. * @returns {Observable} An exclusive observable with only the results that happen when subscribed. */ observableProto.exclusiveMap = function (selector, thisArg) { var sources = this; return new AnonymousObservable(function (observer) { var index = 0, hasCurrent = false, isStopped = true, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe( function (x) { var result; try { result = selector.call(thisArg, x, index++, innerSource); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (g.length === 1 && !hasCurrent) { observer.onCompleted(); } })); return g; }); }; var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { inherits(AnonymousObservable, __super__); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; } return typeof subscriber === 'function' ? disposableCreate(subscriber) : disposableEmpty; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var setDisposable = function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }; var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(setDisposable); } else { setDisposable(); } return autoDetachObserver; } __super__.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception, hv = this.hasValue, v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, __super__); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { __super__.call(this, subscribe); this.isDisposed = false; this.isStopped = false; this.value = null; this.hasValue = false; this.observers = []; this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed.call(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var os = this.observers.slice(0), v = this.value, hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the error. * @param {Mixed} error The Error to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; this.hasValue = true; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this, this.observable.subscribe.bind(this.observable)); } addProperties(AnonymousSubject.prototype, Observer, { onCompleted: function () { this.observer.onCompleted(); }, onError: function (exception) { this.observer.onError(exception); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } }.call(this));
src/components/NotFoundPage.js
oded-soffrin/gkm_viewer
import React from 'react'; import { Link } from 'react-router'; const NotFoundPage = () => { return ( <div> <h4> 404 Page Not Found </h4> <Link to="/"> Go back to homepage </Link> </div> ); }; export default NotFoundPage;
packages/material/src/components/Popup.js
wq/wq.app
import React from 'react'; import Drawer from '@material-ui/core/Drawer'; import PropTypes from 'prop-types'; export default function Popup({ anchor = 'bottom', children, open, onClose, ...rest }) { return ( <Drawer anchor={anchor} open={open} onClose={onClose} {...rest}> {children} </Drawer> ); } Popup.propTypes = { anchor: PropTypes.string, children: PropTypes.node, open: PropTypes.bool, onClose: PropTypes.func };
ajax/libs/yui/3.11.0/event-focus/event-focus.js
drewfreyling/cdnjs
YUI.add('event-focus', function (Y, NAME) { /** * Adds bubbling and delegation support to DOM events focus and blur. * * @module event * @submodule event-focus */ var Event = Y.Event, YLang = Y.Lang, isString = YLang.isString, arrayIndex = Y.Array.indexOf, useActivate = (function() { // Changing the structure of this test, so that it doesn't use inline JS in HTML, // which throws an exception in Win8 packaged apps, due to additional security restrictions: // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences var supported = false, doc = Y.config.doc, p; if (doc) { p = doc.createElement("p"); p.setAttribute("onbeforeactivate", ";"); // onbeforeactivate is a function in IE8+. // onbeforeactivate is a string in IE6,7 (unfortunate, otherwise we could have just checked for function below). // onbeforeactivate is a function in IE10, in a Win8 App environment (no exception running the test). // onbeforeactivate is undefined in Webkit/Gecko. // onbeforeactivate is a function in Webkit/Gecko if it's a supported event (e.g. onclick). supported = (p.onbeforeactivate !== undefined); } return supported; }()); function define(type, proxy, directEvent) { var nodeDataKey = '_' + type + 'Notifiers'; Y.Event.define(type, { _useActivate : useActivate, _attach: function (el, notifier, delegate) { if (Y.DOM.isWindow(el)) { return Event._attach([type, function (e) { notifier.fire(e); }, el]); } else { return Event._attach( [proxy, this._proxy, el, this, notifier, delegate], { capture: true }); } }, _proxy: function (e, notifier, delegate) { var target = e.target, currentTarget = e.currentTarget, notifiers = target.getData(nodeDataKey), yuid = Y.stamp(currentTarget._node), defer = (useActivate || target !== currentTarget), directSub; notifier.currentTarget = (delegate) ? target : currentTarget; notifier.container = (delegate) ? currentTarget : null; // Maintain a list to handle subscriptions from nested // containers div#a>div#b>input #a.on(focus..) #b.on(focus..), // use one focus or blur subscription that fires notifiers from // #b then #a to emulate bubble sequence. if (!notifiers) { notifiers = {}; target.setData(nodeDataKey, notifiers); // only subscribe to the element's focus if the target is // not the current target ( if (defer) { directSub = Event._attach( [directEvent, this._notify, target._node]).sub; directSub.once = true; } } else { // In old IE, defer is always true. In capture-phase browsers, // The delegate subscriptions will be encountered first, which // will establish the notifiers data and direct subscription // on the node. If there is also a direct subscription to the // node's focus/blur, it should not call _notify because the // direct subscription from the delegate sub(s) exists, which // will call _notify. So this avoids _notify being called // twice, unnecessarily. defer = true; } if (!notifiers[yuid]) { notifiers[yuid] = []; } notifiers[yuid].push(notifier); if (!defer) { this._notify(e); } }, _notify: function (e, container) { var currentTarget = e.currentTarget, notifierData = currentTarget.getData(nodeDataKey), axisNodes = currentTarget.ancestors(), doc = currentTarget.get('ownerDocument'), delegates = [], // Used to escape loops when there are no more // notifiers to consider count = notifierData ? Y.Object.keys(notifierData).length : 0, target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret; // clear the notifications list (mainly for delegation) currentTarget.clearData(nodeDataKey); // Order the delegate subs by their placement in the parent axis axisNodes.push(currentTarget); // document.get('ownerDocument') returns null // which we'll use to prevent having duplicate Nodes in the list if (doc) { axisNodes.unshift(doc); } // ancestors() returns the Nodes from top to bottom axisNodes._nodes.reverse(); if (count) { // Store the count for step 2 tmp = count; axisNodes.some(function (node) { var yuid = Y.stamp(node), notifiers = notifierData[yuid], i, len; if (notifiers) { count--; for (i = 0, len = notifiers.length; i < len; ++i) { if (notifiers[i].handle.sub.filter) { delegates.push(notifiers[i]); } } } return !count; }); count = tmp; } // Walk up the parent axis, notifying direct subscriptions and // testing delegate filters. while (count && (target = axisNodes.shift())) { yuid = Y.stamp(target); notifiers = notifierData[yuid]; if (notifiers) { for (i = 0, len = notifiers.length; i < len; ++i) { notifier = notifiers[i]; sub = notifier.handle.sub; match = true; e.currentTarget = target; if (sub.filter) { match = sub.filter.apply(target, [target, e].concat(sub.args || [])); // No longer necessary to test against this // delegate subscription for the nodes along // the parent axis. delegates.splice( arrayIndex(delegates, notifier), 1); } if (match) { // undefined for direct subs e.container = notifier.container; ret = notifier.fire(e); } if (ret === false || e.stopped === 2) { break; } } delete notifiers[yuid]; count--; } if (e.stopped !== 2) { // delegates come after subs targeting this specific node // because they would not normally report until they'd // bubbled to the container node. for (i = 0, len = delegates.length; i < len; ++i) { notifier = delegates[i]; sub = notifier.handle.sub; if (sub.filter.apply(target, [target, e].concat(sub.args || []))) { e.container = notifier.container; e.currentTarget = target; ret = notifier.fire(e); } if (ret === false || e.stopped === 2) { break; } } } if (e.stopped) { break; } } }, on: function (node, sub, notifier) { sub.handle = this._attach(node._node, notifier); }, detach: function (node, sub) { sub.handle.detach(); }, delegate: function (node, sub, notifier, filter) { if (isString(filter)) { sub.filter = function (target) { return Y.Selector.test(target._node, filter, node === target ? null : node._node); }; } sub.handle = this._attach(node._node, notifier, true); }, detachDelegate: function (node, sub) { sub.handle.detach(); } }, true); } // For IE, we need to defer to focusin rather than focus because // `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate, // el.onfocusin, doSomething, then el.onfocus. All others support capture // phase focus, which executes before doSomething. To guarantee consistent // behavior for this use case, IE's direct subscriptions are made against // focusin so subscribers will be notified before js following el.focus() is // executed. if (useActivate) { // name capture phase direct subscription define("focus", "beforeactivate", "focusin"); define("blur", "beforedeactivate", "focusout"); } else { define("focus", "focus", "focus"); define("blur", "blur", "blur"); } }, '@VERSION@', {"requires": ["event-synthetic"]});
react/src/ProgressBar.js
jbadson/render_controller
import React from 'react'; import './ProgressBar.css'; /** * Horizontal progress bar widget * @prop {string} barClass - className of progress bar inner div. Can be used * to set height, border-radius, etc. * @prop {string} fillClass - className of progress bar fill. * @prop {float} percent - Progress percent * @prop {boolean} noText - Do not show percent in text overlay. */ function ProgressBar(props) { const barClass = props.barClass || "progress-bar"; return ( <div className="progress-container"> <div className={barClass}> <ProgressFill fillClass={props.fillClass} percent={props.percent} /> </div> {props.noText || <span className="progress-number">{props.percent.toFixed(1)} %</span> } </div> ) } function ProgressFill(props) { const fillClass = props.fillClass || "progress-fill" return <div className={fillClass} style={{ width: `${props.percent}%`}} /> } export default ProgressBar;
packages/cf-component-radio/test/RadioGroup.js
manatarms/cf-ui
import React from 'react'; import renderer from 'react-test-renderer'; import { RadioGroup } from 'cf-component-radio'; test('should render', () => { const component = renderer.create( <RadioGroup value="option1" onChange={() => {}} options={[ { label: 'Option 1', name: 'group-option-1', value: 'option1' }, { label: 'Option 2', name: 'group-option-2', value: 'option2' } ]} /> ); expect(component.toJSON()).toMatchSnapshot(); });
example/src/screens/button.js
cereigido/react-native-ez-layouts
import React, { Component } from 'react'; import { MonospacedText, Button, Separator, View } from '../../../src'; class ButtonScreen extends Component { static navigationOptions = { title: 'Button', } render() { return ( <View padding scroll> <MonospacedText>{`<Button>This is a button</Button>`}</MonospacedText> <Button>This is a button</Button> </View> ); } } export { ButtonScreen };
packages/material-ui-icons/src/ArrowDropDown.js
cherniavskii/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <g><path d="M7 10l5 5 5-5z" /></g> , 'ArrowDropDown');
app/components/Loader2/index.js
ca11ado/inache-pa
/** * * Loader2 * */ import React from 'react'; import styled, { keyframes } from 'styled-components'; import Wrapper from './Wrapper'; import Rectangle from './Rectangle'; const startColor = 'red'; const finalColor = 'black'; export const changeSize = keyframes` 0% { transform: scale(1); background-color: ${startColor}; } 25% { transform: scaleY(3); background-color: ${finalColor}; } 75% { transform: scaleY(3); background-color: ${finalColor}; } 100% { transform: scaleY(1); background-color: ${startColor}; } `; export const LeftRectangle = styled(Rectangle)` animation: ${changeSize} 1s ease-out infinite; `; export const MiddleRectangle = styled(Rectangle)` animation: ${changeSize} 1s ease-in 0.25s infinite; `; export const RightRectangle = styled(Rectangle)` animation: ${changeSize} 1s ease-out .5s infinite; `; function Loader2 () { return ( <Wrapper> <LeftRectangle /> <MiddleRectangle /> <RightRectangle /> </Wrapper> ); } export default Loader2;
src/server.js
sslash/bookr
import Express from 'express'; import React from 'react'; import ReactDOM from 'react-dom/server'; import config from './config'; import favicon from 'serve-favicon'; import compression from 'compression'; import httpProxy from 'http-proxy'; import path from 'path'; import createStore from './redux/create'; import ApiClient from './helpers/ApiClient'; import Html from './helpers/Html'; import PrettyError from 'pretty-error'; import http from 'http'; import SocketIo from 'socket.io'; import {ReduxRouter} from 'redux-router'; import createHistory from 'history/lib/createMemoryHistory'; import {reduxReactRouter, match} from 'redux-router/server'; import {Provider} from 'react-redux'; import qs from 'query-string'; import getRoutes from './routes'; import getStatusFromRoutes from './helpers/getStatusFromRoutes'; const pretty = new PrettyError(); const app = new Express(); const server = new http.Server(app); const proxy = httpProxy.createProxyServer({ target: 'http://localhost:' + config.apiPort, ws: true }); app.use(compression()); app.use(favicon(path.join(__dirname, '..', 'static', 'favicon.ico'))); app.use(require('serve-static')(path.join(__dirname, '..', 'static'))); // Proxy to API server app.use('/api', (req, res) => { proxy.web(req, res); }); // added the error handling to avoid https://github.com/nodejitsu/node-http-proxy/issues/527 proxy.on('error', (error, req, res) => { let json; if (error.code !== 'ECONNRESET') { console.error('proxy error', error); } if (!res.headersSent) { res.writeHead(500, {'content-type': 'application/json'}); } json = {error: 'proxy_error', reason: error.message}; res.end(JSON.stringify(json)); }); app.use((req, res) => { if (__DEVELOPMENT__) { // Do not cache webpack stats: the script file would change since // hot module replacement is enabled in the development env webpackIsomorphicTools.refresh(); } const client = new ApiClient(req); const store = createStore(reduxReactRouter, getRoutes, createHistory, client); function hydrateOnClient() { res.send('<!doctype html>\n' + ReactDOM.renderToString(<Html assets={webpackIsomorphicTools.assets()} store={store}/>)); } if (__DISABLE_SSR__) { hydrateOnClient(); return; } store.dispatch(match(req.originalUrl, (error, redirectLocation, routerState) => { if (redirectLocation) { res.redirect(redirectLocation.pathname + redirectLocation.search); } else if (error) { console.error('ROUTER ERROR:', pretty.render(error)); res.status(500); hydrateOnClient(); } else if (!routerState) { res.status(500); hydrateOnClient(); } else { // Workaround redux-router query string issue: // https://github.com/rackt/redux-router/issues/106 if (routerState.location.search && !routerState.location.query) { routerState.location.query = qs.parse(routerState.location.search); } store.getState().router.then(() => { const component = ( <Provider store={store} key="provider"> <ReduxRouter/> </Provider> ); const status = getStatusFromRoutes(routerState.routes); if (status) { res.status(status); } res.send('<!doctype html>\n' + ReactDOM.renderToString(<Html assets={webpackIsomorphicTools.assets()} component={component} store={store}/>)); }).catch((err) => { console.error('DATA FETCHING ERROR:', pretty.render(err)); res.status(500); hydrateOnClient(); }); } })); }); if (config.port) { if (config.isProduction) { const io = new SocketIo(server); io.path('/api/ws'); } server.listen(config.port, (err) => { if (err) { console.error(err); } console.info('----\n==> ✅ %s is running, talking to API server on %s.', config.app.title, config.apiPort); console.info('==> 💻 Open http://localhost:%s in a browser to view the app.', config.port); }); } else { console.error('==> ERROR: No PORT environment variable has been specified'); }
app/addons/documents/index-results/components/results/ResultsScreen.js
popojargo/couchdb-fauxton
// 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. import React from 'react'; import FauxtonAPI from '../../../../../core/api'; import Constants from '../../../constants'; import Components from "../../../../components/react-components"; import {ResultsToolBar} from "../../../components/results-toolbar"; import NoResultsScreen from './NoResultsScreen'; import TableView from './TableView'; const { LoadLines, Document } = Components; export default class ResultsScreen extends React.Component { constructor (props) { super(props); } componentDidMount () { prettyPrint(); } componentDidUpdate () { prettyPrint(); } onClick (id, doc) { if (doc.url) { FauxtonAPI.navigate(doc.url); } } getUrlFragment (url) { if (!this.props.isEditable) { return null; } return ( <a href={url}> <i className="fonticon-pencil"></i> </a>); } getDocumentList () { let noop = () => {}; let data = this.props.results.results; return _.map(data, function (doc, i) { return ( <Document key={doc.id + i} doc={doc} onClick={this.props.isEditable ? this.onClick : noop} keylabel={doc.keylabel} docContent={doc.content} checked={this.props.isSelected(doc.id)} header={doc.header} docChecked={this.props.docChecked} isDeletable={doc.isDeletable} docIdentifier={doc.id} > {doc.url ? this.getUrlFragment('#' + doc.url) : doc.url} </Document> ); }, this); } getDocumentStyleView () { let classNames = 'view'; if (this.props.isListDeletable) { classNames += ' show-select'; } return ( <div className={classNames}> <div id="doc-list"> {this.getDocumentList()} </div> </div> ); } getTableStyleView () { return ( <div> <TableView onClick={this.onClick} docChecked={this.props.docChecked} isSelected={this.props.isSelected} isListDeletable={this.props.isListDeletable} data={this.props.results} isLoading={this.props.isLoading} removeItem={this.props.removeItem} isChecked={this.props.allDocumentsSelected} hasSelectedItem={this.props.hasSelectedItem} toggleSelect={this.toggleSelectAll} changeField={this.props.changeTableHeaderAttribute} title="Select all docs that can be..." /> </div> ); } render () { let mainView = null; if (this.props.isLoading) { mainView = <div className="loading-lines-wrapper"><LoadLines /></div>; } else if (!this.props.hasResults) { mainView = <NoResultsScreen text={this.props.textEmptyIndex}/>; } else if (this.props.selectedLayout === Constants.LAYOUT_ORIENTATION.JSON) { mainView = this.getDocumentStyleView(); } else { mainView = this.getTableStyleView(); } return ( <div className="document-result-screen"> <ResultsToolBar {...this.props} /> {mainView} </div> ); } };
src/client/client-main.js
mearns/image-affinity
import {Affinity} from './components/Affinity'; import React from 'react'; import ReactDOM from 'react-dom'; import Promise from 'bluebird'; export function main() { getInitialProps() .then((props) => { ReactDOM.render(<Affinity {...props}/>, document.getElementById('frame')); }); } /** * Load the initial top-level React property object from the JSON element the server put in the document. This will become the initial * top-level state. */ function getInitialProps () { return Promise.resolve().then(() => { return JSON.parse(new Buffer(document.getElementById('initial-props').textContent, 'base64').toString()); }); }
src/containers/MainLayout.js
byoigres/minutes
import React from 'react'; import { FormattedMessage } from 'react-intl'; import { useDispatch } from 'react-redux'; import styled from 'styled-components'; import Navbar from '../components/Navbar'; import Footer from '../components/Footer'; import LanguageSelector from '../components/LanguageSelector'; import { changeLanguage } from '../actions/language'; import * as constants from '../constants'; const languages = [ { id: constants.LANGUAGE_SPANISH, locale: 'es', text: <FormattedMessage id="language.spanish" />, }, { id: constants.LANGUAGE_ENGLISH, locale: 'en', text: <FormattedMessage id="language.english" />, }, ]; const MainLayout = styled.div` margin-top: 5rem; padding-bottom: 6rem; flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; @media only screen and (min-width: 80rem) { /* width < 80rem (OK) */ margin: 4rem 0 0 0; /* margin: 4rem 1rem 0 1rem; */ } `; const Container = styled.div` flex: 1 0 auto; max-width: 76rem; width: 100%; & p { text-align: justify; } @media only screen and (max-width: 79.999rem) { /* width < 80rem */ margin: 0 1rem; width: auto; } `; const Wrapper = ({ children }) => { const dispatch = useDispatch(); const onChangeLanguage = (lang, locale) => { dispatch(changeLanguage(lang, locale)); }; return ( <MainLayout> <Navbar brandText={<FormattedMessage id="app.brand-text" />} /> <Container> {children} </Container> <Footer> <LanguageSelector languages={languages} onChangeLanguage={onChangeLanguage} /> </Footer> </MainLayout> ); } // export default connect(state => ({ // selectedLanguage: state.language.selected, // }), { // changeLanguage: _changeLanguage, // })(MainLayout); export default Wrapper;
ajax/libs/onsen/2.0.0-alpha.7/js/angular-onsenui.min.js
emmy41124/cdnjs
/*! angular-onsenui.js for onsenui - v2.0.0-alpha.7 - 2015-10-27 */ !function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/sliding_menu.tpl",'<div class="onsen-sliding-menu__menu ons-sliding-menu-inner"></div>\n<div class="onsen-sliding-menu__main ons-sliding-menu-inner"></div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/split_view.tpl",'<div class="onsen-split-view__secondary full-screen ons-split-view-inner"></div>\n<div class="onsen-split-view__main full-screen ons-split-view-inner"></div>\n')}])}(),function(ons){"use strict";function waitOnsenUILoad(){var unlockOnsenUI=ons._readyLock.lock();module.run(["$compile","$rootScope",function($compile,$rootScope){if("loading"===document.readyState||"uninitialized"==document.readyState)window.addEventListener("DOMContentLoaded",function(){document.body.appendChild(document.createElement("ons-dummy-for-init"))});else{if(!document.body)throw new Error("Invalid initialization state.");document.body.appendChild(document.createElement("ons-dummy-for-init"))}$rootScope.$on("$ons-ready",unlockOnsenUI)}])}function initAngularModule(){module.value("$onsGlobal",ons),module.run(["$compile","$rootScope","$onsen","$q",function($compile,$rootScope,$onsen,$q){ons._onsenService=$onsen,ons._qService=$q,$rootScope.ons=window.ons,$rootScope.console=window.console,$rootScope.alert=window.alert,ons.$compile=$compile}])}function initOnsenFacade(){ons._onsenService=null,ons.componentBase=window,ons.bootstrap=function(name,deps){angular.isArray(name)&&(deps=name,name=void 0),name||(name="myOnsenApp"),deps=["onsen"].concat(angular.isArray(deps)?deps:[]);var module=angular.module(name,deps),doc=window.document;if("loading"==doc.readyState||"uninitialized"==doc.readyState||"interactive"==doc.readyState)doc.addEventListener("DOMContentLoaded",function(){angular.bootstrap(doc.documentElement,[name])},!1);else{if(!doc.documentElement)throw new Error("Invalid state");angular.bootstrap(doc.documentElement,[name])}return module},ons.findParentComponentUntil=function(name,dom){var element;return dom instanceof HTMLElement?element=angular.element(dom):dom instanceof angular.element?element=dom:dom.target&&(element=angular.element(dom.target)),element.inheritedData(name)},ons.findComponent=function(selector,dom){var target=(dom?dom:document).querySelector(selector);return target?angular.element(target).data(target.nodeName.toLowerCase())||null:null},ons.compile=function(dom){if(!ons.$compile)throw new Error("ons.$compile() is not ready. Wait for initialization with ons.ready().");if(!(dom instanceof HTMLElement))throw new Error("First argument must be an instance of HTMLElement.");var scope=angular.element(dom).scope();if(!scope)throw new Error("AngularJS Scope is null. Argument DOM element must be attached in DOM document.");ons.$compile(dom)(scope)},ons._getOnsenService=function(){if(!this._onsenService)throw new Error("$onsen is not loaded, wait for ons.ready().");return this._onsenService},ons._waitDiretiveInit=function(elementName,lastReady){return function(element,callback){if(angular.element(element).data(elementName))lastReady(element,callback);else{var listen=function(){lastReady(element,callback),element.removeEventListener(elementName+":init",listen,!1)};element.addEventListener(elementName+":init",listen,!1)}}},ons.createAlertDialog=function(page,options){return options=options||{},options.link=function(element){options.parentScope?ons.$compile(angular.element(element))(options.parentScope.$new()):ons.compile(element)},ons._createAlertDialogOriginal(page,options).then(function(alertDialog){return angular.element(alertDialog).data("ons-alert-dialog")})},ons.createDialog=function(page,options){return options=options||{},options.link=function(element){options.parentScope?ons.$compile(angular.element(element))(options.parentScope.$new()):ons.compile(element)},ons._createDialogOriginal(page,options).then(function(dialog){return angular.element(dialog).data("ons-dialog")})},ons.createPopover=function(page,options){return options=options||{},options.link=function(element){options.parentScope?ons.$compile(angular.element(element))(options.parentScope.$new()):ons.compile(element)},ons._createPopoverOriginal(page,options).then(function(popover){return angular.element(popover).data("ons-popover")})},ons.resolveLoadingPlaceholder=function(page){return ons._resolveLoadingPlaceholderOriginal(page,function(element,done){ons.compile(element),angular.element(element).scope().$evalAsync(function(){setImmediate(done)})})},ons._setupLoadingPlaceHolders=function(){}}var module=angular.module("onsen",["templates-main"]);angular.module("onsen.directives",["onsen"]),initOnsenFacade(),waitOnsenUILoad(),initAngularModule()}(window.ons=window.ons||{}),function(){"use strict";var module=angular.module("onsen");module.factory("AlertDialogView",["$onsen",function($onsen){var AlertDialogView=Class.extend({init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["getDeviceBackButtonHandler","show","hide","isShown","destroy","setDisabled","isDisabled","setCancelable","isCancelable"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["preshow","postshow","prehide","posthide","cancel"],function(detail){return detail.alertDialog&&(detail.alertDialog=this),detail}.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._element.remove(),this._clearDerivingMethods(),this._clearDerivingEvents(),this._scope=this._attrs=this._element=null}});return MicroEvent.mixin(AlertDialogView),AlertDialogView}])}(),angular.module("onsen").value("AlertDialogAnimator",ons._internal.AlertDialogAnimator).value("AndroidAlertDialogAnimator",ons._internal.AndroidAlertDialogAnimator).value("IOSAlertDialogAnimator",ons._internal.IOSAlertDialogAnimator),angular.module("onsen").value("AnimationChooser",ons._internal.AnimatorFactory),function(){"use strict";var module=angular.module("onsen");module.factory("CarouselView",["$onsen",function($onsen){var CarouselView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["setSwipeable","isSwipeable","setAutoScrollRatio","getAutoScrollRatio","setActiveCarouselItemIndex","getActiveCarouselItemIndex","next","prev","setAutoScrollEnabled","isAutoScrollEnabled","setDisabled","isDisabled","setOverscrollable","isOverscrollable","refresh","first","last"]),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["refresh","postchange","overscroll"],function(detail){return detail.carousel&&(detail.carousel=this),detail}.bind(this))},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(CarouselView),CarouselView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("DialogView",["$onsen",function($onsen){var DialogView=Class.extend({init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["getDeviceBackButtonHandler","show","hide","isShown","destroy"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["preshow","postshow","prehide","posthide","cancel"],function(detail){return detail.dialog&&(detail.dialog=this),detail}.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._element.remove(),this._clearDerivingMethods(),this._clearDerivingEvents(),this._scope=this._attrs=this._element=null}});return DialogView.registerAnimator=function(name,Animator){return window.OnsDialogElement.registerAnimator(name,Animator)},MicroEvent.mixin(DialogView),DialogView}])}(),angular.module("onsen").value("DialogAnimator",ons._internal.DialogAnimator).value("IOSDialogAnimator",ons._internal.IOSDialogAnimator).value("AndroidDialogAnimator",ons._internal.AndroidDialogAnimator).value("SlideDialogAnimator",ons._internal.SlideDialogAnimator),function(){"use strict";angular.module("onsen").factory("GenericView",["$onsen",function($onsen){var GenericView=Class.extend({init:function(scope,element,attrs,options){var self=this;if(options={},this._element=element,this._scope=scope,this._attrs=attrs,options.directiveOnly){if(!options.modifierTemplate)throw new Error("options.modifierTemplate is undefined.");$onsen.addModifierMethods(this,options.modifierTemplate,element)}else $onsen.addModifierMethodsForCustomElements(this,element);$onsen.cleaner.onDestroy(scope,function(){self._events=void 0,$onsen.removeModifierMethods(self),options.onDestroy&&options.onDestroy(self),$onsen.clearComponent({scope:scope,attrs:attrs,element:element}),self=element=self._element=self._scope=scope=self._attrs=attrs=options=null})}});return GenericView.register=function(scope,element,attrs,options){var view=new GenericView(scope,element,attrs,options);if(!options.viewKey)throw new Error("options.viewKey is required.");$onsen.declareVarAttribute(attrs,view),element.data(options.viewKey,view);var destroy=options.onDestroy||angular.noop;return options.onDestroy=function(view){destroy(view),element.data(options.viewKey,null)},view},MicroEvent.mixin(GenericView),GenericView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("LazyRepeatView",["AngularLazyRepeatDelegate",function(AngularLazyRepeatDelegate){var LazyRepeatView=Class.extend({init:function(scope,element,attrs,linker){this._element=element,this._scope=scope,this._attrs=attrs,this._linker=linker;var userDelegate=this._getDelegate(),internalDelegate=new AngularLazyRepeatDelegate(element[0],userDelegate,element.scope());this._provider=new ons._internal.LazyRepeatProvider(element[0].parentNode,element[0],internalDelegate),element.remove(),this._injectReloadMethod(userDelegate,this._provider),this._scope.$watch(internalDelegate.countItems.bind(internalDelegate),this._provider._onChange.bind(this._provider)),this._scope.$on("$destroy",this._destroy.bind(this))},_injectReloadMethod:function(userDelegate,provider){var oldReload=userDelegate.reload;"function"==typeof oldReload?userDelegate.reload=function(){oldReload(),provider._onChange()}.bind(this):userDelegate.reload=function(){provider._onChange()}.bind(this)}.bind(this),_getDelegate:function(){var delegate=this._scope.$eval(this._attrs.onsLazyRepeat);return"undefined"==typeof delegate&&(delegate=eval(this._attrs.onsLazyRepeat)),delegate},_destroy:function(){this._element=this._scope=this._attrs=this._linker=null}});return LazyRepeatView}])}(),function(){"use strict";angular.module("onsen").factory("AngularLazyRepeatDelegate",["$compile",function($compile){var AngularLazyRepeatDelegate=function(){AngularLazyRepeatDelegate.prototype.init.apply(this,arguments)};return AngularLazyRepeatDelegate.prototype=Object.create(ons._internal.LazyRepeatDelegate.prototype),angular.extend(AngularLazyRepeatDelegate.prototype,{init:function(templateElement,userDelegate,parentScope){this._templateElement=templateElement.cloneNode(!0),this._userDelegate=userDelegate,this._parentScope=parentScope,this._removeLazyRepeatDirective(),this._linker=$compile(this._templateElement.cloneNode(!0))},_usingBinding:function(){if(this._userDelegate.configureItemScope)return!0;if(this._userDelegate.createItemContent)return!1;throw new Error("`lazy-repeat` delegate object is vague.")},_removeLazyRepeatDirective:function(){this._templateElement.removeAttribute("ons-lazy-repeat"),this._templateElement.removeAttribute("ons:lazy:repeat"),this._templateElement.removeAttribute("ons_lazy_repeat"),this._templateElement.removeAttribute("data-ons-lazy-repeat"),this._templateElement.removeAttribute("x-ons-lazy-repeat")},prepareItem:function(index,done){var scope=this._parentScope.$new();this._addSpecialProperties(index,scope),this._usingBinding()&&this._userDelegate.configureItemScope(index,scope),this._linker(scope,function(cloned){if(cloned[0].style.display="none",!this._usingBinding()){var contentElement=this._userDelegate.createItemContent(index,null);cloned.append(contentElement),$compile(cloned[0].firstChild)(scope)}done({element:cloned[0],scope:scope}),scope.$evalAsync(function(){cloned[0].style.display="block"})}.bind(this))},_addSpecialProperties:function(index,scope){scope.$index=index,scope.$first=0===index,scope.$last=index===this.countItems()-1,scope.$middle=!scope.$first&&!scope.$last,scope.$even=index%2===0,scope.$odd=!scope.$even},countItems:function(){return this._userDelegate.countItems()},updateItem:function(index,item){this._usingBinding()&&item.scope.$evalAsync(function(){this._userDelegate.configureItemScope(index,item.scope)}.bind(this))},destroyItem:function(index,item){this._usingBinding()?this._userDelegate.destroyItemScope instanceof Function&&this._userDelegate.destroyItemScope(index,item.scope):this._userDelegate.destroyItemContent instanceof Function&&this._userDelegate.destroyItemContent(index,item.element),item.scope.$destroy()},destroy:function(){this._userDelegate=this._templateElement=this._scope=null},calculateItemHeight:function(index){return this._userDelegate.calculateItemHeight(index)}}),AngularLazyRepeatDelegate}])}(),function(){"use strict";var module=angular.module("onsen");module.value("ModalAnimator",ons._internal.ModalAnimator),module.value("FadeModalAnimator",ons._internal.FadeModalAnimator),module.factory("ModalView",["$onsen","$parse",function($onsen,$parse){var ModalView=Class.extend({_element:void 0,_scope:void 0,init:function(scope,element,attrs){this._scope=scope,this._element=element,this._scope.$on("$destroy",this._destroy.bind(this)),element[0]._animatorFactory.setAnimationOptions($parse(attrs.animationOptions)())},getDeviceBackButtonHandler:function(){return this._element[0].getDeviceBackButtonHandler()},setDeviceBackButtonHandler:function(callback){this._element[0].setDeviceBackButtonHandler(callback)},show:function(options){return this._element[0].show(options)},hide:function(options){return this._element[0].hide(options)},toggle:function(options){return this._element[0].toggle(options)},_destroy:function(){this.emit("destroy",{page:this}),this._events=this._element=this._scope=null}});return ModalView.registerAnimator=function(name,Animator){return window.OnsModalElement.registerAnimator(name,Animator)},MicroEvent.mixin(ModalView),ModalView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("NavigatorView",["$http","$parse","$compile","$onsen","$timeout","AnimationChooser","SimpleSlideTransitionAnimator","NavigatorTransitionAnimator","LiftTransitionAnimator","NullTransitionAnimator","IOSSlideTransitionAnimator","FadeTransitionAnimator",function($http,$parse,$compile,$onsen,$timeout,AnimationChooser,SimpleSlideTransitionAnimator,NavigatorTransitionAnimator,LiftTransitionAnimator,NullTransitionAnimator,IOSSlideTransitionAnimator,FadeTransitionAnimator){var NavigatorView=Class.extend({_element:void 0,_attrs:void 0,_scope:void 0,init:function(scope,element,attrs){this._element=element||angular.element(window.document.body),this._scope=scope||this._element.scope(),this._attrs=attrs,this._previousPageScope=null,this._boundOnPrepop=this._onPrepop.bind(this),this._boundOnPostpop=this._onPostpop.bind(this),this._element.on("prepop",this._boundOnPrepop),this._element.on("postpop",this._boundOnPostpop),this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["prepush","postpush","prepop","postpop","init","show","hide","destroy"],function(detail){return detail.navigator&&(detail.navigator=this),detail}.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["insertPage","pushPage","bringPageTop","getDeviceBackButtonHandler","popPage","replacePage","resetToPage","getCurrentPage","canPopPage"])},_onPrepop:function(event){var pages=event.detail.navigator.pages;angular.element(pages[pages.length-2].element).scope().$evalAsync(),this._previousPageScope=angular.element(pages[pages.length-1].element).scope()},_onPostpop:function(event){this._previousPageScope.$destroy(),this._previoousPageScope=null},_compileAndLink:function(pageElement,callback){var link=$compile(pageElement),pageScope=this._createPageScope();link(pageScope),pageScope.$evalAsync(function(){callback(pageElement)})},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element.off("prepop",this._boundOnPrepop),this._element.off("postpop",this._boundOnPostpop),this._element=this._scope=this._attrs=null},_createPageScope:function(){return this._scope.$new()},getPages:function(){return this._element[0].pages}});return MicroEvent.mixin(NavigatorView),Object.defineProperty(NavigatorView.prototype,"pages",{get:function(){return this.getPages()},set:function(){throw new Error}}),NavigatorView}])}(),angular.module("onsen").value("NavigatorTransitionAnimator",ons._internal.NavigatorTransitionAnimator).value("FadeTransitionAnimator",ons._internal.FadeNavigatorTransitionAnimator).value("IOSSlideTransitionAnimator",ons._internal.IOSSlideNavigatorTransitionAnimator).value("LiftTransitionAnimator",ons._internal.LiftNavigatorTransitionAnimator).value("NullTransitionAnimator",ons._internal.NavigatorTransitionAnimator).value("SimpleSlideTransitionAnimator",ons._internal.SimpleSlideNavigatorTransitionAnimator),function(){"use strict";var module=angular.module("onsen");module.factory("OverlaySlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var OverlaySlidingMenuAnimator=SlidingMenuAnimator.extend({_blackMask:void 0,_isRight:!1,_element:!1,_menuPage:!1,_mainPage:!1,_width:!1,setup:function(element,mainPage,menuPage,options){options=options||{},this._width=options.width||"90%",this._isRight=!!options.isRight,this._element=element,this._mainPage=mainPage,this._menuPage=menuPage,menuPage.css("box-shadow","0px 0 10px 0px rgba(0, 0, 0, 0.2)"),menuPage.css({width:options.width,display:"none",zIndex:2}),menuPage.css("-webkit-transform","translate3d(0px, 0px, 0px)"),mainPage.css({zIndex:1}),this._isRight?menuPage.css({right:"-"+options.width,left:"auto"}):menuPage.css({right:"auto",left:"-"+options.width}),this._blackMask=angular.element("<div></div>").css({backgroundColor:"black",top:"0px",left:"0px",right:"0px",bottom:"0px",position:"absolute",display:"none",zIndex:0}),element.prepend(this._blackMask)},onResized:function(options){if(this._menuPage.css("width",options.width),this._isRight?this._menuPage.css({right:"-"+options.width,left:"auto"}):this._menuPage.css({right:"auto",left:"-"+options.width}),options.isOpened){var max=this._menuPage[0].clientWidth,menuStyle=this._generateMenuPageStyle(max);animit(this._menuPage[0]).queue(menuStyle).play()}},destroy:function(){this._blackMask&&(this._blackMask.remove(),this._blackMask=null),this._mainPage.removeAttr("style"),this._menuPage.removeAttr("style"),this._element=this._mainPage=this._menuPage=null},openMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._menuPage.css("display","block"),this._blackMask.css("display","block");var max=this._menuPage[0].clientWidth,menuStyle=this._generateMenuPageStyle(max),mainPageStyle=this._generateMainPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue(mainPageStyle,{duration:duration,timing:this.timing}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).wait(delay).queue(menuStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._blackMask.css({display:"block"});var menuPageStyle=this._generateMenuPageStyle(0),mainPageStyle=this._generateMainPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue(mainPageStyle,{duration:duration,timing:this.timing}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).wait(delay).queue(menuPageStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block"),this._blackMask.css({display:"block"});var menuPageStyle=this._generateMenuPageStyle(Math.min(options.maxDistance,options.distance)),mainPageStyle=this._generateMainPageStyle(Math.min(options.maxDistance,options.distance));delete mainPageStyle.opacity,animit(this._menuPage[0]).queue(menuPageStyle).play(),Object.keys(mainPageStyle).length>0&&animit(this._mainPage[0]).queue(mainPageStyle).play()},_generateMenuPageStyle:function(distance){var x=this._isRight?-distance:distance,transform="translate3d("+x+"px, 0, 0)";return{transform:transform,"box-shadow":0===distance?"none":"0px 0 10px 0px rgba(0, 0, 0, 0.2)"}},_generateMainPageStyle:function(distance){var max=this._menuPage[0].clientWidth,opacity=1-.1*distance/max;return{opacity:opacity}},copy:function(){return new OverlaySlidingMenuAnimator}});return OverlaySlidingMenuAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("PageView",["$onsen","$parse",function($onsen,$parse){var PageView=Class.extend({_nullElement:window.document.createElement("div"),init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._clearListener=scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["init","show","hide","destroy"]),this._userDeviceBackButtonListener=angular.noop,(this._attrs.ngDeviceBackbutton||this._attrs.onDeviceBackbutton)&&this._element[0].setDeviceBackButtonHandler(this._onDeviceBackButton.bind(this))},_onDeviceBackButton:function($event){if(this._userDeviceBackButtonListener($event),this._attrs.ngDeviceBackbutton&&$parse(this._attrs.ngDeviceBackbutton)(this._scope,{$event:$event}),this._attrs.onDeviceBackbutton){var lastEvent=window.$event;window.$event=$event,new Function(this._attrs.onDeviceBackbutton)(),window.$event=lastEvent}},setDeviceBackButtonHandler:function(callback){this._userDeviceBackButtonListener=callback},getDeviceBackButtonHandler:function(){return this._element[0].getDeviceBackButtonHandler()},_destroy:function(){this._element[0]._destroy(),this._clearDerivingEvents(),this._element=null,this._nullElement=null,this._scope=null,this._clearListener()}});return MicroEvent.mixin(PageView),PageView}])}(),function(){"use strict";angular.module("onsen").factory("PopoverView",["$onsen",function($onsen){var PopoverView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["show","hide","isShown","setCancelable","destroy"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["preshow","postshow","prehide","posthide"],function(detail){return detail.popover&&(detail.popover=this),detail}.bind(this))},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._clearDerivingEvents(),this._element.remove(),this._element=this._scope=null}});return MicroEvent.mixin(PopoverView),PopoverView}])}(),angular.module("onsen").value("PopoverAnimator",ons._internal.PopoverAnimator).value("FadePopoverAnimator",ons._internal.FadePopoverAnimator),function(){"use strict";var module=angular.module("onsen");module.factory("PullHookView",["$onsen","$parse",function($onsen,$parse){var PullHookView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["getHeight","setHeight","setThresholdHeight","getThresholdHeight","getCurrentState","getPullDistance","isDisabled","setDisabled"]),this._clearDerivingEvents=$onsen.deriveEvents(this,this._element[0],["changestate"],function(detail){return detail.pullHook&&(detail.pullHook=this),detail}.bind(this)),this.on("changestate",function(event){this._scope.$evalAsync()}.bind(this)),this._boundOnAction=this._onAction.bind(this),this._element[0].setActionCallback(this._boundOnAction),this._scope.$on("$destroy",this._destroy.bind(this))},_onAction:function(done){this._attrs.ngAction?this._scope.$eval(this._attrs.ngAction,{$done:done}):this._attrs.onAction&&eval(this._attrs.onAction)},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._clearDerivingEvents(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(PullHookView),PullHookView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("PushSlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var PushSlidingMenuAnimator=SlidingMenuAnimator.extend({_isRight:!1,_element:void 0,_menuPage:void 0,_mainPage:void 0,_width:void 0,setup:function(element,mainPage,menuPage,options){options=options||{},this._element=element,this._mainPage=mainPage,this._menuPage=menuPage,this._isRight=!!options.isRight,this._width=options.width||"90%",menuPage.css({width:options.width,display:"none"}),this._isRight?menuPage.css({right:"-"+options.width,left:"auto"}):menuPage.css({right:"auto",left:"-"+options.width})},onResized:function(options){if(this._menuPage.css("width",options.width),this._isRight?this._menuPage.css({right:"-"+options.width,left:"auto"}):this._menuPage.css({right:"auto",left:"-"+options.width}),options.isOpened){var max=this._menuPage[0].clientWidth,mainPageTransform=this._generateAbovePageTransform(max),menuPageStyle=this._generateBehindPageStyle(max);animit(this._mainPage[0]).queue({transform:mainPageTransform}).play(),animit(this._menuPage[0]).queue(menuPageStyle).play()}},destroy:function(){this._mainPage.removeAttr("style"),this._menuPage.removeAttr("style"),this._element=this._mainPage=this._menuPage=null},openMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._menuPage.css("display","block");var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay,aboveTransform=this._generateAbovePageTransform(0),behindStyle=this._generateBehindPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue({transform:"translate3d(0, 0, 0)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).queue(function(done){done()}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block");var aboveTransform=this._generateAbovePageTransform(Math.min(options.maxDistance,options.distance)),behindStyle=this._generateBehindPageStyle(Math.min(options.maxDistance,options.distance));animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()},_generateAbovePageTransform:function(distance){var x=this._isRight?-distance:distance,aboveTransform="translate3d("+x+"px, 0, 0)";return aboveTransform},_generateBehindPageStyle:function(distance){var behindX=this._isRight?-distance:distance,behindTransform="translate3d("+behindX+"px, 0, 0)";return{transform:behindTransform}},copy:function(){return new PushSlidingMenuAnimator}});return PushSlidingMenuAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("RevealSlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var RevealSlidingMenuAnimator=SlidingMenuAnimator.extend({_blackMask:void 0,_isRight:!1,_menuPage:void 0,_element:void 0,_mainPage:void 0,setup:function(element,mainPage,menuPage,options){this._element=element,this._menuPage=menuPage,this._mainPage=mainPage,this._isRight=!!options.isRight,this._width=options.width||"90%",mainPage.css({boxShadow:"0px 0 10px 0px rgba(0, 0, 0, 0.2)"}),menuPage.css({width:options.width,opacity:.9,display:"none"}),this._isRight?menuPage.css({right:"0px",left:"auto"}):menuPage.css({right:"auto",left:"0px"}),this._blackMask=angular.element("<div></div>").css({backgroundColor:"black",top:"0px",left:"0px",right:"0px",bottom:"0px",position:"absolute",display:"none"}),element.prepend(this._blackMask),animit(mainPage[0]).queue({transform:"translate3d(0, 0, 0)"}).play()},onResized:function(options){if(this._width=options.width,this._menuPage.css("width",this._width),options.isOpened){var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()}},destroy:function(){this._blackMask&&(this._blackMask.remove(),this._blackMask=null),this._mainPage&&this._mainPage.attr("style",""),this._menuPage&&this._menuPage.attr("style",""),this._mainPage=this._menuPage=this._element=void 0},openMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._menuPage.css("display","block"),this._blackMask.css("display","block");var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this.duration,delay=instant===!0?0:this.delay;this._blackMask.css("display","block");var aboveTransform=this._generateAbovePageTransform(0),behindStyle=this._generateBehindPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).wait(delay).queue({transform:aboveTransform},{duration:duration,timing:this.timing}).queue({transform:"translate3d(0, 0, 0)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).wait(delay).queue(behindStyle,{duration:duration,timing:this.timing}).queue(function(done){done()}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block"),this._blackMask.css("display","block");var aboveTransform=this._generateAbovePageTransform(Math.min(options.maxDistance,options.distance)),behindStyle=this._generateBehindPageStyle(Math.min(options.maxDistance,options.distance));delete behindStyle.opacity,animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()},_generateAbovePageTransform:function(distance){var x=this._isRight?-distance:distance,aboveTransform="translate3d("+x+"px, 0, 0)";return aboveTransform},_generateBehindPageStyle:function(distance){var max=this._menuPage[0].getBoundingClientRect().width,behindDistance=(distance-max)/max*10;behindDistance=isNaN(behindDistance)?0:Math.max(Math.min(behindDistance,0),-10); var behindX=this._isRight?-behindDistance:behindDistance,behindTransform="translate3d("+behindX+"%, 0, 0)",opacity=1+behindDistance/100;return{transform:behindTransform,opacity:opacity}},copy:function(){return new RevealSlidingMenuAnimator}});return RevealSlidingMenuAnimator}])}(),function(){"use strict";var module=angular.module("onsen"),SlidingMenuViewModel=Class.extend({_distance:0,_maxDistance:void 0,init:function(options){if(!angular.isNumber(options.maxDistance))throw new Error("options.maxDistance must be number");this.setMaxDistance(options.maxDistance)},setMaxDistance:function(maxDistance){if(0>=maxDistance)throw new Error("maxDistance must be greater then zero.");this.isOpened()&&(this._distance=maxDistance),this._maxDistance=maxDistance},shouldOpen:function(){return!this.isOpened()&&this._distance>=this._maxDistance/2},shouldClose:function(){return!this.isClosed()&&this._distance<this._maxDistance/2},openOrClose:function(options){this.shouldOpen()?this.open(options):this.shouldClose()&&this.close(options)},close:function(options){var callback=options.callback||function(){};this.isClosed()?callback():(this._distance=0,this.emit("close",options))},open:function(options){var callback=options.callback||function(){};this.isOpened()?callback():(this._distance=this._maxDistance,this.emit("open",options))},isClosed:function(){return 0===this._distance},isOpened:function(){return this._distance===this._maxDistance},getX:function(){return this._distance},getMaxDistance:function(){return this._maxDistance},translate:function(x){this._distance=Math.max(1,Math.min(this._maxDistance-1,x));var options={distance:this._distance,maxDistance:this._maxDistance};this.emit("translate",options)},toggle:function(){this.isClosed()?this.open():this.close()}});MicroEvent.mixin(SlidingMenuViewModel),module.factory("SlidingMenuView",["$onsen","$compile","$parse","AnimationChooser","SlidingMenuAnimator","RevealSlidingMenuAnimator","PushSlidingMenuAnimator","OverlaySlidingMenuAnimator",function($onsen,$compile,$parse,AnimationChooser,SlidingMenuAnimator,RevealSlidingMenuAnimator,PushSlidingMenuAnimator,OverlaySlidingMenuAnimator){var SlidingMenuView=Class.extend({_scope:void 0,_attrs:void 0,_element:void 0,_menuPage:void 0,_mainPage:void 0,_doorLock:void 0,_isRightMenu:!1,init:function(scope,element,attrs){this._scope=scope,this._attrs=attrs,this._element=element,this._menuPage=angular.element(element[0].querySelector(".onsen-sliding-menu__menu")),this._mainPage=angular.element(element[0].querySelector(".onsen-sliding-menu__main")),this._doorLock=new DoorLock,this._isRightMenu="right"===attrs.side,this._mainPageGestureDetector=new ons.GestureDetector(this._mainPage[0]),this._boundOnTap=this._onTap.bind(this);var maxDistance=this._normalizeMaxSlideDistanceAttr();this._logic=new SlidingMenuViewModel({maxDistance:Math.max(maxDistance,1)}),this._logic.on("translate",this._translate.bind(this)),this._logic.on("open",function(options){this._open(options)}.bind(this)),this._logic.on("close",function(options){this._close(options)}.bind(this)),attrs.$observe("maxSlideDistance",this._onMaxSlideDistanceChanged.bind(this)),attrs.$observe("swipeable",this._onSwipeableChanged.bind(this)),this._boundOnWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._boundOnWindowResize),this._boundHandleEvent=this._handleEvent.bind(this),this._bindEvents(),attrs.mainPage&&this.setMainPage(attrs.mainPage),attrs.menuPage&&this.setMenuPage(attrs.menuPage),this._deviceBackButtonHandler=ons._deviceBackButtonDispatcher.createHandler(this._element[0],this._onDeviceBackButton.bind(this));var unlock=this._doorLock.lock();window.setTimeout(function(){var maxDistance=this._normalizeMaxSlideDistanceAttr();this._logic.setMaxDistance(maxDistance),this._menuPage.css({opacity:1});var animationChooser=new AnimationChooser({animators:SlidingMenuView._animatorDict,baseClass:SlidingMenuAnimator,baseClassName:"SlidingMenuAnimator",defaultAnimation:attrs.type,defaultAnimationOptions:$parse(attrs.animationOptions)()});this._animator=animationChooser.newAnimator(),this._animator.setup(this._element,this._mainPage,this._menuPage,{isRight:this._isRightMenu,width:this._attrs.maxSlideDistance||"90%"}),unlock()}.bind(this),400),scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["init","show","hide","destroy"]),attrs.swipeable||this.setSwipeable(!0)},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler},_onDeviceBackButton:function(event){this.isMenuOpened()?this.closeMenu():event.callParentHandler()},_onTap:function(){this.isMenuOpened()&&this.closeMenu()},_refreshMenuPageWidth:function(){var width="maxSlideDistance"in this._attrs?this._attrs.maxSlideDistance:"90%";this._animator&&this._animator.onResized({isOpened:this._logic.isOpened(),width:width})},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._deviceBackButtonHandler.destroy(),window.removeEventListener("resize",this._boundOnWindowResize),this._mainPageGestureDetector.off("tap",this._boundOnTap),this._element=this._scope=this._attrs=null},_onSwipeableChanged:function(swipeable){swipeable=""===swipeable||void 0===swipeable||"true"==swipeable,this.setSwipeable(swipeable)},setSwipeable:function(enabled){enabled?this._activateGestureDetector():this._deactivateGestureDetector()},_onWindowResize:function(){this._recalculateMAX(),this._refreshMenuPageWidth()},_onMaxSlideDistanceChanged:function(){this._recalculateMAX(),this._refreshMenuPageWidth()},_normalizeMaxSlideDistanceAttr:function(){var maxDistance=this._attrs.maxSlideDistance;if("maxSlideDistance"in this._attrs){if("string"!=typeof maxDistance)throw new Error("invalid state");-1!==maxDistance.indexOf("px",maxDistance.length-2)?maxDistance=parseInt(maxDistance.replace("px",""),10):maxDistance.indexOf("%",maxDistance.length-1)>0&&(maxDistance=maxDistance.replace("%",""),maxDistance=parseFloat(maxDistance)/100*this._mainPage[0].clientWidth)}else maxDistance=.9*this._mainPage[0].clientWidth;return maxDistance},_recalculateMAX:function(){var maxDistance=this._normalizeMaxSlideDistanceAttr();maxDistance&&this._logic.setMaxDistance(parseInt(maxDistance,10))},_activateGestureDetector:function(){this._gestureDetector.on("touch dragleft dragright swipeleft swiperight release",this._boundHandleEvent)},_deactivateGestureDetector:function(){this._gestureDetector.off("touch dragleft dragright swipeleft swiperight release",this._boundHandleEvent)},_bindEvents:function(){this._gestureDetector=new ons.GestureDetector(this._element[0],{dragMinDistance:1})},_appendMainPage:function(pageUrl,templateHTML){var pageScope=this._scope.$new(),pageContent=angular.element(templateHTML),link=$compile(pageContent);this._mainPage.append(pageContent),this._currentPageElement&&(this._currentPageElement.remove(),this._currentPageScope.$destroy()),link(pageScope),this._currentPageElement=pageContent,this._currentPageScope=pageScope,this._currentPageUrl=pageUrl,this._currentPageElement[0]._show()},_appendMenuPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=angular.element(templateHTML),link=$compile(pageContent);this._menuPage.append(pageContent),this._currentMenuPageScope&&(this._currentMenuPageScope.$destroy(),this._currentMenuPageElement.remove()),link(pageScope),this._currentMenuPageElement=pageContent,this._currentMenuPageScope=pageScope},setMenuPage:function(page,options){if(!page)throw new Error("cannot set undefined page");options=options||{},options.callback=options.callback||function(){};var self=this;$onsen.getPageHTMLAsync(page).then(function(html){self._appendMenuPage(angular.element(html)),options.closeMenu&&self.close(),options.callback()},function(){throw new Error("Page is not found: "+page)})},setMainPage:function(pageUrl,options){options=options||{},options.callback=options.callback||function(){};var done=function(){options.closeMenu&&this.close(),options.callback()}.bind(this);if(this.currentPageUrl===pageUrl)return void done();if(!pageUrl)throw new Error("cannot set undefined page");var self=this;$onsen.getPageHTMLAsync(pageUrl).then(function(html){self._appendMainPage(pageUrl,html),done()},function(){throw new Error("Page is not found: "+page)})},_handleEvent:function(event){if(!this._doorLock.isLocked())switch(this._isInsideIgnoredElement(event.target)&&event.gesture.stopDetect(),event.type){case"dragleft":case"dragright":if(this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;event.gesture.preventDefault();var deltaX=event.gesture.deltaX,deltaDistance=this._isRightMenu?-deltaX:deltaX,startEvent=event.gesture.startEvent;if("isOpened"in startEvent||(startEvent.isOpened=this._logic.isOpened()),0>deltaDistance&&this._logic.isClosed())break;if(deltaDistance>0&&this._logic.isOpened())break;var distance=startEvent.isOpened?deltaDistance+this._logic.getMaxDistance():deltaDistance;this._logic.translate(distance);break;case"swipeleft":if(event.gesture.preventDefault(),this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;this._isRightMenu?this.open():this.close(),event.gesture.stopDetect();break;case"swiperight":if(event.gesture.preventDefault(),this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;this._isRightMenu?this.close():this.open(),event.gesture.stopDetect();break;case"release":this._lastDistance=null,this._logic.shouldOpen()?this.open():this._logic.shouldClose()&&this.close()}},_isInsideIgnoredElement:function(element){do{if(element.getAttribute&&element.getAttribute("sliding-menu-ignore"))return!0;element=element.parentNode}while(element);return!1},_isInsideSwipeTargetArea:function(event){var x=event.gesture.center.pageX;"_swipeTargetWidth"in event.gesture.startEvent||(event.gesture.startEvent._swipeTargetWidth=this._getSwipeTargetWidth());var targetWidth=event.gesture.startEvent._swipeTargetWidth;return this._isRightMenu?this._mainPage[0].clientWidth-x<targetWidth:targetWidth>x},_getSwipeTargetWidth:function(){var targetWidth=this._attrs.swipeTargetWidth;"string"==typeof targetWidth&&(targetWidth=targetWidth.replace("px",""));var width=parseInt(targetWidth,10);return 0>width||!targetWidth?this._mainPage[0].clientWidth:width},closeMenu:function(){return this.close.apply(this,arguments)},close:function(options){options=options||{},options="function"==typeof options?{callback:options}:options,this._logic.isClosed()||(this.emit("preclose",{slidingMenu:this}),this._doorLock.waitUnlock(function(){this._logic.close(options)}.bind(this)))},_close:function(options){var callback=options.callback||function(){},unlock=this._doorLock.lock(),instant="none"==options.animation;this._animator.closeMenu(function(){unlock(),this._mainPage.children().css("pointer-events",""),this._mainPageGestureDetector.off("tap",this._boundOnTap),this.emit("postclose",{slidingMenu:this}),callback()}.bind(this),instant)},openMenu:function(){return this.open.apply(this,arguments)},open:function(options){options=options||{},options="function"==typeof options?{callback:options}:options,this.emit("preopen",{slidingMenu:this}),this._doorLock.waitUnlock(function(){this._logic.open(options)}.bind(this))},_open:function(options){var callback=options.callback||function(){},unlock=this._doorLock.lock(),instant="none"==options.animation;this._animator.openMenu(function(){unlock(),this._mainPage.children().css("pointer-events","none"),this._mainPageGestureDetector.on("tap",this._boundOnTap),this.emit("postopen",{slidingMenu:this}),callback()}.bind(this),instant)},toggle:function(options){this._logic.isClosed()?this.open(options):this.close(options)},toggleMenu:function(){return this.toggle.apply(this,arguments)},isMenuOpened:function(){return this._logic.isOpened()},_translate:function(event){this._animator.translateMenu(event)}});return SlidingMenuView._animatorDict={"default":RevealSlidingMenuAnimator,overlay:OverlaySlidingMenuAnimator,reveal:RevealSlidingMenuAnimator,push:PushSlidingMenuAnimator},SlidingMenuView.registerAnimator=function(name,Animator){if(!(Animator.prototype instanceof SlidingMenuAnimator))throw new Error('"Animator" param must inherit SlidingMenuAnimator');this._animatorDict[name]=Animator},MicroEvent.mixin(SlidingMenuView),SlidingMenuView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("SlidingMenuAnimator",function(){return Class.extend({delay:0,duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)",init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration,this.delay=void 0!==options.delay?options.delay:this.delay},setup:function(element,mainPage,menuPage,options){},onResized:function(options){},openMenu:function(callback){},closeClose:function(callback){},destroy:function(){},translateMenu:function(mainPage,menuPage,options){},copy:function(){throw new Error("Override copy method.")}})})}(),function(){"use strict";var module=angular.module("onsen");module.factory("SplitView",["$compile","RevealSlidingMenuAnimator","$onsen","$onsGlobal",function($compile,RevealSlidingMenuAnimator,$onsen,$onsGlobal){function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}var SPLIT_MODE=0,COLLAPSE_MODE=1,MAIN_PAGE_RATIO=.9,SplitView=Class.extend({init:function(scope,element,attrs){element.addClass("onsen-sliding-menu"),this._element=element,this._scope=scope,this._attrs=attrs,this._mainPage=angular.element(element[0].querySelector(".onsen-split-view__main")),this._secondaryPage=angular.element(element[0].querySelector(".onsen-split-view__secondary")),this._max=this._mainPage[0].clientWidth*MAIN_PAGE_RATIO,this._mode=SPLIT_MODE,this._doorLock=new DoorLock,this._doSplit=!1,this._doCollapse=!1,$onsGlobal.orientation.on("change",this._onResize.bind(this)),this._animator=new RevealSlidingMenuAnimator,this._element.css("display","none"),attrs.mainPage&&this.setMainPage(attrs.mainPage),attrs.secondaryPage&&this.setSecondaryPage(attrs.secondaryPage);var unlock=this._doorLock.lock();this._considerChangingCollapse(),this._setSize(),setTimeout(function(){this._element.css("display","block"),unlock()}.bind(this),1e3/60*2),scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["init","show","hide","destroy"])},_appendSecondPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=$compile(templateHTML)(pageScope);this._secondaryPage.append(pageContent),this._currentSecondaryPageElement&&(this._currentSecondaryPageElement.remove(),this._currentSecondaryPageScope.$destroy()),this._currentSecondaryPageElement=pageContent,this._currentSecondaryPageScope=pageScope},_appendMainPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=$compile(templateHTML)(pageScope);this._mainPage.append(pageContent),this._currentPage&&this._currentPageScope.$destroy(),this._currentPage=pageContent,this._currentPageScope=pageScope,this._currentPage[0]._show()},setSecondaryPage:function(page){if(!page)throw new Error("cannot set undefined page");$onsen.getPageHTMLAsync(page).then(function(html){this._appendSecondPage(angular.element(html.trim()))}.bind(this),function(){throw new Error("Page is not found: "+page)})},setMainPage:function(page){if(!page)throw new Error("cannot set undefined page");$onsen.getPageHTMLAsync(page).then(function(html){this._appendMainPage(angular.element(html.trim()))}.bind(this),function(){throw new Error("Page is not found: "+page)})},_onResize:function(){var lastMode=this._mode;this._considerChangingCollapse(),lastMode===COLLAPSE_MODE&&this._mode===COLLAPSE_MODE&&this._animator.onResized({isOpened:!1,width:"90%"}),this._max=this._mainPage[0].clientWidth*MAIN_PAGE_RATIO},_considerChangingCollapse:function(){var should=this._shouldCollapse();should&&this._mode!==COLLAPSE_MODE?(this._fireUpdateEvent(),this._doSplit?this._activateSplitMode():this._activateCollapseMode()):should||this._mode!==COLLAPSE_MODE||(this._fireUpdateEvent(),this._doCollapse?this._activateCollapseMode():this._activateSplitMode()),this._doCollapse=this._doSplit=!1},update:function(){this._fireUpdateEvent();var should=this._shouldCollapse();this._doSplit?this._activateSplitMode():this._doCollapse?this._activateCollapseMode():should?this._activateCollapseMode():should||this._activateSplitMode(),this._doSplit=this._doCollapse=!1},_getOrientation:function(){return $onsGlobal.orientation.isPortrait()?"portrait":"landscape"},getCurrentMode:function(){return this._mode===COLLAPSE_MODE?"collapse":"split"},_shouldCollapse:function(){var c="portrait";if("string"==typeof this._attrs.collapse&&(c=this._attrs.collapse.trim()),"portrait"==c)return $onsGlobal.orientation.isPortrait();if("landscape"==c)return $onsGlobal.orientation.isLandscape();if("width"==c.substr(0,5)){var num=c.split(" ")[1];num.indexOf("px")>=0&&(num=num.substr(0,num.length-2));var width=window.innerWidth;return isNumber(num)&&num>width}var mq=window.matchMedia(c);return mq.matches},_setSize:function(){if(this._mode===SPLIT_MODE){this._attrs.mainPageWidth||(this._attrs.mainPageWidth="70");var secondarySize=100-this._attrs.mainPageWidth.replace("%","");this._secondaryPage.css({width:secondarySize+"%",opacity:1}),this._mainPage.css({width:this._attrs.mainPageWidth+"%"}),this._mainPage.css("left",secondarySize+"%")}},_fireEvent:function(name){this.emit(name,{splitView:this,width:window.innerWidth,orientation:this._getOrientation()})},_fireUpdateEvent:function(){var that=this;this.emit("update",{splitView:this,shouldCollapse:this._shouldCollapse(),currentMode:this.getCurrentMode(),split:function(){that._doSplit=!0,that._doCollapse=!1},collapse:function(){that._doSplit=!1,that._doCollapse=!0},width:window.innerWidth,orientation:this._getOrientation()})},_activateCollapseMode:function(){this._mode!==COLLAPSE_MODE&&(this._fireEvent("precollapse"),this._secondaryPage.attr("style",""),this._mainPage.attr("style",""),this._mode=COLLAPSE_MODE,this._animator.setup(this._element,this._mainPage,this._secondaryPage,{isRight:!1,width:"90%"}),this._fireEvent("postcollapse"))},_activateSplitMode:function(){this._mode!==SPLIT_MODE&&(this._fireEvent("presplit"),this._animator.destroy(),this._secondaryPage.attr("style",""),this._mainPage.attr("style",""),this._mode=SPLIT_MODE,this._setSize(),this._fireEvent("postsplit"))},_destroy:function(){this.emit("destroy"),this._clearDerivingEvents(),this._element=null,this._scope=null}});return MicroEvent.mixin(SplitView),SplitView}])}(),function(){"use strict";angular.module("onsen").factory("SplitterContent",["$onsen","$compile",function($onsen,$compile){var SplitterContent=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["load"]),scope.$on("$destroy",this._destroy.bind(this))},_link:function(fragment,done){var link=$compile(fragment),pageScope=this._createPageScope();link(pageScope),pageScope.$evalAsync(function(){done(fragment)})},_createPageScope:function(){return this._scope.$new()},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(SplitterContent),Object.defineProperty(SplitterContent.prototype,"page",{get:function(){return this._element[0].page},set:function(){throw new Error}}),SplitterContent}])}(),function(){"use strict";angular.module("onsen").factory("SplitterSide",["$onsen","$compile",function($onsen,$compile){var SplitterSide=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["isSwipeable","getCurrentMode","isOpened","open","close","toggle","load"]),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["modechange","preopen","preclose","postopen","postclose"],function(detail){return detail.side&&(detail.side=this),detail}.bind(this)),scope.$on("$destroy",this._destroy.bind(this))},_link:function(fragment,done){var link=$compile(fragment),pageScope=this._createPageScope();link(pageScope),pageScope.$evalAsync(function(){done(fragment)})},_createPageScope:function(){return this._scope.$new()},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._clearDerivingEvents(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(SplitterSide),Object.defineProperty(SplitterSide.prototype,"page",{get:function(){return this._element[0].page},set:function(){throw new Error}}),SplitterSide}])}(),function(){"use strict";angular.module("onsen").factory("Splitter",["$onsen",function($onsen){var Splitter=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._clearDerivingMethods=$onsen.deriveMethods(this,this._element[0],["getDeviceBackButtonHandler","openRight","openLeft","closeRight","closeLeft","toggleRight","toggleLeft","rightIsOpened","leftIsOpened"]),scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(Splitter),Splitter}])}(),function(){"use strict";angular.module("onsen").factory("SwitchView",["$parse","$onsen",function($parse,$onsen){var SwitchView=Class.extend({init:function(element,scope,attrs){this._element=element,this._checkbox=angular.element(element[0].querySelector("input[type=checkbox]")),this._scope=scope,this._checkbox.on("change",function(){this.emit("change",{"switch":this,value:this._checkbox[0].checked,isInteractive:!0})}.bind(this)),this._prepareNgModel(element,scope,attrs),this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["isChecked","setChecked","getCheckboxElement"])},_prepareNgModel:function(element,scope,attrs){if(attrs.ngModel){var set=$parse(attrs.ngModel).assign;scope.$parent.$watch(attrs.ngModel,function(value){this.setChecked(!!value)}.bind(this)),this._checkbox.on("change",function(e){set(scope.$parent,this.isChecked()),attrs.ngChange&&scope.$eval(attrs.ngChange),scope.$parent.$evalAsync()}.bind(this))}},_destroy:function(){this.emit("destroy"),this._clearDerivingMethods(),this._element=this._checkbox=this._scope=null}});return MicroEvent.mixin(SwitchView),SwitchView}])}(),function(){"use strict";var module=angular.module("onsen");module.value("TabbarNoneAnimator",ons._internal.TabbarNoneAnimator),module.value("TabbarFadeAnimator",ons._internal.TabbarFadeAnimator),module.value("TabbarSlideAnimator",ons._internal.TabbarSlideAnimator),module.factory("TabbarView",["$onsen","$compile","$parse",function($onsen,$compile,$parse){var TabbarView=Class.extend({init:function(scope,element,attrs){if("ons-tabbar"!==element[0].nodeName.toLowerCase())throw new Error('"element" parameter must be a "ons-tabbar" element.');this._scope=scope,this._element=element,this._attrs=attrs,this._lastPageElement=null,this._lastPageScope=null,this._scope.$on("$destroy",this._destroy.bind(this)),this._clearDerivingEvents=$onsen.deriveEvents(this,element[0],["reactive","postchange","prechange","init","show","hide","destroy"]),this._clearDerivingMethods=$onsen.deriveMethods(this,element[0],["setActiveTab","setTabbarVisibility","getActiveTabIndex","loadPage"]),this._boundOnPrechange=this._onPrechange.bind(this),this._boundOnPostchange=this._onPostchange.bind(this),this._element.on("prechange",this._boundOnPrechange),this._element.on("postchange",this._boundOnPostchange)},_compileAndLink:function(pageElement,callback){var link=$compile(pageElement),pageScope=this._scope.$new();link(pageScope),pageScope.$evalAsync(function(){callback(pageElement)})},_onPrechange:function(event){this._lastPageElement=this._element[0]._getCurrentPageElement(),this._lastPageScope=angular.element(this._lastPageElement).scope()},_onPostchange:function(event){this._lastPageElement&&!this._lastPageElement.parentNode&&this._lastPageScope&&this._lastPageScope.$destroy()},_destroy:function(){this.emit("destroy"),element.off(this._boundOnPrechange),element.off(this._boundOnPostchange),this._clearDerivingEvents(),this._clearDerivingMethods(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(TabbarView),TabbarView.registerAnimator=function(name,Animator){return window.OnsTabbarElement.registerAnimator(name,Animator)},TabbarView}])}(),function(){"use strict";angular.module("onsen").directive("onsAlertDialog",["$onsen","AlertDialogView",function($onsen,AlertDialogView){return{restrict:"E",replace:!1,scope:!0,transclude:!1,compile:function(element,attrs){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var alertDialog=new AlertDialogView(scope,element,attrs);$onsen.declareVarAttribute(attrs,alertDialog),$onsen.registerEventHandlers(alertDialog,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethodsForCustomElements(alertDialog,element),element.data("ons-alert-dialog",alertDialog),scope.$on("$destroy",function(){alertDialog._events=void 0,$onsen.removeModifierMethods(alertDialog),element.data("ons-alert-dialog",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsBackButton",["$onsen","$compile","GenericView","ComponentCleaner",function($onsen,$compile,GenericView,ComponentCleaner){return{restrict:"E",replace:!1,compile:function(element,attrs){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs,controller,transclude){CustomElements.upgrade(element[0]);var backButton=GenericView.register(scope,element,attrs,{viewKey:"ons-back-button"});scope.$on("$destroy",function(){backButton._events=void 0,$onsen.removeModifierMethods(backButton),element=null}),ComponentCleaner.onDestroy(scope,function(){ComponentCleaner.destroyScope(scope),ComponentCleaner.destroyAttributes(attrs),element=scope=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsBottomToolbar",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]),GenericView.register(scope,element,attrs,{viewKey:"ons-bottomToolbar"});var inline="undefined"!=typeof attrs.inline,pageView=element.inheritedData("ons-page");pageView&&!inline&&pageView._element[0]._registerBottomToolbar(element[0])},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsButton",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){CustomElements.upgrade(element[0]);var button=GenericView.register(scope,element,attrs,{viewKey:"ons-button"});button.isDisabled=function(){return this._element[0].hasAttribute("disabled")},button.setDisabled=function(disabled){disabled?this._element[0].setAttribute("disabled",""):this._element[0].removeAttribute("disabled")},$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsCarousel",["$onsen","CarouselView",function($onsen,CarouselView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){return CustomElements.upgrade(element[0]),function(scope,element,attrs){CustomElements.upgrade(element[0]);var carousel=new CarouselView(scope,element,attrs);element.data("ons-carousel",carousel),$onsen.registerEventHandlers(carousel,"postchange refresh overscroll destroy"),$onsen.declareVarAttribute(attrs,carousel),scope.$on("$destroy",function(){carousel._events=void 0,element.data("ons-carousel",void 0),element=null}),element[0].hasAttribute("auto-refresh")&&scope.$watch(function(){return element[0].childNodes.length},function(){setImmediate(function(){carousel.refresh()})}),setImmediate(function(){carousel.refresh()}),$onsen.fireComponentEvent(element[0],"init")}}}}]),module.directive("onsCarouselItem",function(){return{restrict:"E",compile:function(element,attrs){return CustomElements.upgrade(element[0]),function(scope,element,attrs){CustomElements.upgrade(element[0])}}}})}(),function(){"use strict";angular.module("onsen").directive("onsDialog",["$onsen","DialogView",function($onsen,DialogView){return{restrict:"E",scope:!0,compile:function(element,attrs){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var dialog=new DialogView(scope,element,attrs);$onsen.declareVarAttribute(attrs,dialog),$onsen.registerEventHandlers(dialog,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethodsForCustomElements(dialog,element),element.data("ons-dialog",dialog),scope.$on("$destroy",function(){dialog._events=void 0,$onsen.removeModifierMethods(dialog),element.data("ons-dialog",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsDummyForInit",["$rootScope",function($rootScope){var isReady=!1;return{restrict:"E",replace:!1,link:{post:function(scope,element){isReady||(isReady=!0,$rootScope.$broadcast("$ons-ready")),element.remove()}}}}])}(),function(){"use strict";var EVENTS="drag dragleft dragright dragup dragdown hold release swipe swipeleft swiperight swipeup swipedown tap doubletap touch transform pinch pinchin pinchout rotate".split(/ +/);angular.module("onsen").directive("onsGestureDetector",["$onsen",function($onsen){function titlize(str){return str.charAt(0).toUpperCase()+str.slice(1)}var scopeDef=EVENTS.reduce(function(dict,name){return dict["ng"+titlize(name)]="&",dict},{});return{restrict:"E",scope:scopeDef,replace:!1,transclude:!0,compile:function(element,attrs){return function(scope,element,attrs,_,transclude){transclude(scope.$parent,function(cloned){element.append(cloned)});var gestureDetector,handler=function(event){var attr="ng"+titlize(event.type);attr in scopeDef&&scope[attr]({$event:event})};setImmediate(function(){gestureDetector=element[0]._gestureDetector,gestureDetector.on(EVENTS.join(" "),handler)}),$onsen.cleaner.onDestroy(scope,function(){gestureDetector.off(EVENTS.join(" "),handler),$onsen.clearComponent({scope:scope,element:element,attrs:attrs}),gestureDetector.element=scope=element=attrs=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsIfOrientation",["$onsen","$onsGlobal",function($onsen,$onsGlobal){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:function(element){return element.css("display","none"),function(scope,element,attrs){function update(){var userOrientation=(""+attrs.onsIfOrientation).toLowerCase(),orientation=getLandscapeOrPortrait();("portrait"===userOrientation||"landscape"===userOrientation)&&(userOrientation===orientation?element.css("display",""):element.css("display","none"))}function getLandscapeOrPortrait(){return $onsGlobal.orientation.isPortrait()?"portrait":"landscape"}element.addClass("ons-if-orientation-inner"),attrs.$observe("onsIfOrientation",update),$onsGlobal.orientation.on("change",update),update(),$onsen.cleaner.onDestroy(scope,function(){$onsGlobal.orientation.off("change",update),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsIfPlatform",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:function(element){function getPlatformString(){if(navigator.userAgent.match(/Android/i))return"android";if(navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/RIM Tablet OS/i)||navigator.userAgent.match(/BB10/i))return"blackberry"; if(navigator.userAgent.match(/iPhone|iPad|iPod/i))return"ios";if(navigator.userAgent.match(/Windows Phone|IEMobile|WPDesktop/i))return"wp";var isOpera=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0;if(isOpera)return"opera";var isFirefox="undefined"!=typeof InstallTrigger;if(isFirefox)return"firefox";var isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0;if(isSafari)return"safari";var isChrome=!!window.chrome&&!isOpera;if(isChrome)return"chrome";var isIE=!!document.documentMode;return isIE?"ie":"unknown"}element.addClass("ons-if-platform-inner"),element.css("display","none");var platform=getPlatformString();return function(scope,element,attrs){function update(){var userPlatforms=attrs.onsIfPlatform.toLowerCase().trim().split(/\s+/);userPlatforms.indexOf(platform.toLowerCase())>=0?element.css("display","block"):element.css("display","none")}attrs.$observe("onsIfPlatform",function(userPlatform){userPlatform&&update()}),update(),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}}}])}(),function(){"use strict";var module=angular.module("onsen"),compileFunction=function(show,$onsen){return function(element){return function(scope,element,attrs){var dispShow=show?"block":"none",dispHide=show?"none":"block",onShow=function(){element.css("display",dispShow)},onHide=function(){element.css("display",dispHide)},onInit=function(e){e.visible?onShow():onHide()};ons.softwareKeyboard.on("show",onShow),ons.softwareKeyboard.on("hide",onHide),ons.softwareKeyboard.on("init",onInit),ons.softwareKeyboard._visible?onShow():onHide(),$onsen.cleaner.onDestroy(scope,function(){ons.softwareKeyboard.off("show",onShow),ons.softwareKeyboard.off("hide",onHide),ons.softwareKeyboard.off("init",onInit),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}};module.directive("onsKeyboardActive",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:compileFunction(!0,$onsen)}}]),module.directive("onsKeyboardInactive",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:compileFunction(!1,$onsen)}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsLazyRepeat",["$onsen","LazyRepeatView",function($onsen,LazyRepeatView){return{restrict:"A",replace:!1,priority:1e3,terminal:!0,compile:function(element,attrs){return function(scope,element,attrs){var lazyRepeat=new LazyRepeatView(scope,element,attrs);scope.$on("$destroy",function(){scope=element=attrs=lazyRepeat=null})}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsList",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){CustomElements.upgrade(element[0]),GenericView.register(scope,element,attrs,{viewKey:"ons-list"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";angular.module("onsen").directive("onsListHeader",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){CustomElements.upgrade(element[0]),GenericView.register(scope,element,attrs,{viewKey:"ons-listHeader"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";angular.module("onsen").directive("onsListItem",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){CustomElements.upgrade(element[0]),GenericView.register(scope,element,attrs,{viewKey:"ons-list-item"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";angular.module("onsen").directive("onsLoadingPlaceholder",function(){return{restrict:"A",link:function(scope,element,attrs){CustomElements.upgrade(element[0]),attrs.onsLoadingPlaceholder&&ons._resolveLoadingPlaceholder(element[0],attrs.onsLoadingPlaceholder,function(contentElement,done){CustomElements.upgrade(contentElement),ons.compile(contentElement),scope.$evalAsync(function(){setImmediate(done)})})}}})}(),function(){"use strict";angular.module("onsen").directive("onsMaterialInput",["$parse",function($parse){return{restrict:"E",replace:!1,scope:!0,link:function(scope,element,attrs){if(CustomElements.upgrade(element[0]),attrs.ngModel){var set=$parse(attrs.ngModel).assign;scope.$parent.$watch(attrs.ngModel,function(value){element[0].value=value}),element[0]._input.addEventListener("input",function(){set(scope.$parent,element[0].value),attrs.ngChange&&scope.$eval(attrs.ngChange),scope.$parent.$evalAsync()}.bind(this))}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsModal",["$onsen","ModalView",function($onsen,ModalView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,link:{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var modal=new ModalView(scope,element,attrs);$onsen.addModifierMethodsForCustomElements(modal,element),$onsen.declareVarAttribute(attrs,modal),element.data("ons-modal",modal),element[0]._ensureNodePosition(),scope.$on("$destroy",function(){$onsen.removeModifierMethods(modal),element.data("ons-modal",void 0),modal=element=scope=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var lastReady=window.OnsNavigatorElement.rewritables.ready;window.OnsNavigatorElement.rewritables.ready=ons._waitDiretiveInit("ons-navigator",lastReady);var lastLink=window.OnsNavigatorElement.rewritables.link;window.OnsNavigatorElement.rewritables.link=function(navigatorElement,target,callback){var view=angular.element(navigatorElement).data("ons-navigator");view._compileAndLink(target,function(target){lastLink(navigatorElement,target,callback)})},angular.module("onsen").directive("onsNavigator",["NavigatorView","$onsen",function(NavigatorView,$onsen){return{restrict:"E",transclude:!1,scope:!0,compile:function(element){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs,controller){CustomElements.upgrade(element[0]);var navigator=new NavigatorView(scope,element,attrs);$onsen.declareVarAttribute(attrs,navigator),$onsen.registerEventHandlers(navigator,"prepush prepop postpush postpop init show hide destroy"),element.data("ons-navigator",navigator),scope.$on("$destroy",function(){navigator._events=void 0,element.data("ons-navigator",void 0),element=null})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsPage",["$onsen","PageView",function($onsen,PageView){function firePageInitEvent(element){var i=0,f=function(){if(!(i++<15))throw new Error('Fail to fire "pageinit" event. Attach "ons-page" element to the document after initialization.');isAttached(element)?(element._tryToFillStatusBar(),$onsen.fireComponentEvent(element,"init"),fireActualPageInitEvent(element)):i>10?setTimeout(f,1e3/60):setImmediate(f)};f()}function fireActualPageInitEvent(element){var event=document.createEvent("HTMLEvents");event.initEvent("pageinit",!0,!0),element.dispatchEvent(event)}function isAttached(element){return document.documentElement===element?!0:element.parentNode?isAttached(element.parentNode):!1}return{restrict:"E",transclude:!1,scope:!1,compile:function(element,attrs){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var page=new PageView(scope,element,attrs);$onsen.declareVarAttribute(attrs,page),$onsen.registerEventHandlers(page,"init show hide destroy"),element.data("ons-page",page),$onsen.addModifierMethodsForCustomElements(page,element),$onsen.cleaner.onDestroy(scope,function(){page._events=void 0,$onsen.removeModifierMethods(page),element.data("ons-page",void 0),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),scope=element=attrs=null})},post:function(scope,element,attrs){firePageInitEvent(element[0])}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsPopover",["$onsen","PopoverView",function($onsen,PopoverView){return{restrict:"E",replace:!1,scope:!0,compile:function(element,attrs){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var popover=new PopoverView(scope,element,attrs);$onsen.declareVarAttribute(attrs,popover),$onsen.registerEventHandlers(popover,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethodsForCustomElements(popover,element),element.data("ons-popover",popover),scope.$on("$destroy",function(){popover._events=void 0,$onsen.removeModifierMethods(popover),element.data("ons-popover",void 0),element=null}),$onsen.isAndroid()&&setImmediate(function(){popover.addModifier("android")})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsPullHook",["$onsen","PullHookView",function($onsen,PullHookView){return{restrict:"E",replace:!1,scope:!0,compile:function(element,attrs){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var pullHook=new PullHookView(scope,element,attrs);$onsen.declareVarAttribute(attrs,pullHook),$onsen.registerEventHandlers(pullHook,"changestate destroy"),element.data("ons-pull-hook",pullHook),scope.$on("$destroy",function(){pullHook._events=void 0,element.data("ons-pull-hook",void 0),scope=element=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsRipple",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",link:function(scope,element,attrs){CustomElements.upgrade(element[0]),GenericView.register(scope,element,attrs,{viewKey:"ons-ripple"}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsScope",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,link:function(scope,element){element.data("_scope",scope),scope.$on("$destroy",function(){element.data("_scope",void 0)})}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsSlidingMenu",["$compile","SlidingMenuView","$onsen",function($compile,SlidingMenuView,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!0,compile:function(element,attrs){var main=element[0].querySelector(".main"),menu=element[0].querySelector(".menu");if(main)var mainHtml=angular.element(main).remove().html().trim();if(menu)var menuHtml=angular.element(menu).remove().html().trim();return function(scope,element,attrs){element.append(angular.element("<div></div>").addClass("onsen-sliding-menu__menu ons-sliding-menu-inner")),element.append(angular.element("<div></div>").addClass("onsen-sliding-menu__main ons-sliding-menu-inner"));var slidingMenu=new SlidingMenuView(scope,element,attrs);$onsen.registerEventHandlers(slidingMenu,"preopen preclose postopen postclose init show hide destroy"),mainHtml&&!attrs.mainPage&&slidingMenu._appendMainPage(null,mainHtml),menuHtml&&!attrs.menuPage&&slidingMenu._appendMenuPage(menuHtml),$onsen.declareVarAttribute(attrs,slidingMenu),element.data("ons-sliding-menu",slidingMenu),scope.$on("$destroy",function(){slidingMenu._events=void 0,element.data("ons-sliding-menu",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsSplitView",["$compile","SplitView","$onsen",function($compile,SplitView,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!0,compile:function(element,attrs){var mainPage=element[0].querySelector(".main-page"),secondaryPage=element[0].querySelector(".secondary-page");if(mainPage)var mainHtml=angular.element(mainPage).remove().html().trim();if(secondaryPage)var secondaryHtml=angular.element(secondaryPage).remove().html().trim();return function(scope,element,attrs){element.append(angular.element("<div></div>").addClass("onsen-split-view__secondary full-screen ons-split-view-inner")),element.append(angular.element("<div></div>").addClass("onsen-split-view__main full-screen ons-split-view-inner"));var splitView=new SplitView(scope,element,attrs);mainHtml&&!attrs.mainPage&&splitView._appendMainPage(mainHtml),secondaryHtml&&!attrs.secondaryPage&&splitView._appendSecondPage(secondaryHtml),$onsen.declareVarAttribute(attrs,splitView),$onsen.registerEventHandlers(splitView,"update presplit precollapse postsplit postcollapse init show hide destroy"),element.data("ons-split-view",splitView),scope.$on("$destroy",function(){splitView._events=void 0,element.data("ons-split-view",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsSplitter",["$compile","Splitter","$onsen",function($compile,Splitter,$onsen){return{restrict:"E",scope:!0,compile:function(element,attrs){return CustomElements.upgrade(element[0]),function(scope,element,attrs){CustomElements.upgrade(element[0]);var splitter=new Splitter(scope,element,attrs);$onsen.declareVarAttribute(attrs,splitter),$onsen.registerEventHandlers(splitter,"destroy"),element.data("ons-splitter",splitter),scope.$on("$destroy",function(){splitter._events=void 0,element.data("ons-splitter",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var lastReady=window.OnsSplitterContentElement.rewritables.ready;window.OnsSplitterContentElement.rewritables.ready=ons._waitDiretiveInit("ons-splitter-content",lastReady);var lastLink=window.OnsSplitterContentElement.rewritables.link;window.OnsSplitterContentElement.rewritables.link=function(element,target,callback){var view=angular.element(element).data("ons-splitter-content");lastLink(element,target,function(target){view._link(target,callback)})},angular.module("onsen").directive("onsSplitterContent",["$compile","SplitterContent","$onsen",function($compile,SplitterContent,$onsen){return{restrict:"E",compile:function(element,attrs){return CustomElements.upgrade(element[0]),function(scope,element,attrs){CustomElements.upgrade(element[0]);var view=new SplitterContent(scope,element,attrs);$onsen.declareVarAttribute(attrs,view),$onsen.registerEventHandlers(view,"destroy"),element.data("ons-splitter-content",view),scope.$on("$destroy",function(){view._events=void 0,element.data("ons-splitter-content",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var lastReady=window.OnsSplitterSideElement.rewritables.ready;window.OnsSplitterSideElement.rewritables.ready=ons._waitDiretiveInit("ons-splitter-side",lastReady);var lastLink=window.OnsSplitterSideElement.rewritables.link;window.OnsSplitterSideElement.rewritables.link=function(element,target,callback){var view=angular.element(element).data("ons-splitter-side");lastLink(element,target,function(target){view._link(target,callback)})},angular.module("onsen").directive("onsSplitterSide",["$compile","SplitterSide","$onsen",function($compile,SplitterSide,$onsen){return{restrict:"E",compile:function(element,attrs){return CustomElements.upgrade(element[0]),function(scope,element,attrs){CustomElements.upgrade(element[0]);var view=new SplitterSide(scope,element,attrs);$onsen.declareVarAttribute(attrs,view),$onsen.registerEventHandlers(view,"destroy"),element.data("ons-splitter-side",view),scope.$on("$destroy",function(){view._events=void 0,element.data("ons-splitter-side",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";angular.module("onsen").directive("onsSwitch",["$onsen","SwitchView",function($onsen,SwitchView){return{restrict:"E",replace:!1,scope:!0,link:function(scope,element,attrs){if(CustomElements.upgrade(element[0]),attrs.ngController)throw new Error("This element can't accept ng-controller directive.");var switchView=new SwitchView(element,scope,attrs);$onsen.addModifierMethodsForCustomElements(switchView,element),$onsen.declareVarAttribute(attrs,switchView),element.data("ons-switch",switchView),$onsen.cleaner.onDestroy(scope,function(){switchView._events=void 0,$onsen.removeModifierMethods(switchView),element.data("ons-switch",void 0),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),checkbox=element=attrs=scope=null}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";function tab($onsen){return{restrict:"E",link:function(scope,element,attrs){CustomElements.upgrade(element[0]),$onsen.fireComponentEvent(element[0],"init")}}}angular.module("onsen").directive("onsTab",tab).directive("onsTabbarItem",tab),tab.$inject=["$onsen"]}(),function(){"use strict";var lastReady=window.OnsTabbarElement.rewritables.ready;window.OnsTabbarElement.rewritables.ready=ons._waitDiretiveInit("ons-tabbar",lastReady);var lastLink=window.OnsTabbarElement.rewritables.link;window.OnsTabbarElement.rewritables.link=function(tabbarElement,target,callback){var view=angular.element(tabbarElement).data("ons-tabbar");view._compileAndLink(target,function(target){lastLink(tabbarElement,target,callback)})},angular.module("onsen").directive("onsTabbar",["$onsen","$compile","$parse","TabbarView",function($onsen,$compile,$parse,TabbarView){return{restrict:"E",replace:!1,scope:!0,link:function(scope,element,attrs,controller){CustomElements.upgrade(element[0]),scope.$watch(attrs.hideTabs,function(hide){"string"==typeof hide&&(hide="true"===hide),element[0].setTabbarVisibility(!hide)});var tabbarView=new TabbarView(scope,element,attrs);$onsen.addModifierMethodsForCustomElements(tabbarView,element),$onsen.registerEventHandlers(tabbarView,"reactive prechange postchange init show hide destroy"),element.data("ons-tabbar",tabbarView),$onsen.declareVarAttribute(attrs,tabbarView),scope.$on("$destroy",function(){tabbarView._events=void 0,$onsen.removeModifierMethods(tabbarView),element.data("ons-tabbar",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";angular.module("onsen").directive("onsTemplate",["$templateCache",function($templateCache){return{restrict:"E",terminal:!0,compile:function(element){CustomElements.upgrade(element[0]);var content=element[0].template||element.html();$templateCache.put(element.attr("id"),content)}}}])}(),function(){"use strict";angular.module("onsen").directive("onsToolbar",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",scope:!1,transclude:!1,compile:function(element){return CustomElements.upgrade(element[0]),{pre:function(scope,element,attrs){"ons-toolbar"===element[0].nodeName&&(CustomElements.upgrade(element[0]),GenericView.register(scope,element,attrs,{viewKey:"ons-toolbar"}),element[0]._ensureNodePosition())},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsToolbarButton",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",scope:!1,link:{pre:function(scope,element,attrs){CustomElements.upgrade(element[0]);var toolbarButton=new GenericView(scope,element,attrs);element.data("ons-toolbar-button",toolbarButton),$onsen.declareVarAttribute(attrs,toolbarButton),$onsen.addModifierMethodsForCustomElements(toolbarButton,element),$onsen.cleaner.onDestroy(scope,function(){toolbarButton._events=void 0,$onsen.removeModifierMethods(toolbarButton),element.data("ons-toolbar-button",void 0),element=null,$onsen.clearComponent({scope:scope,attrs:attrs,element:element}),scope=element=attrs=null})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen"),ComponentCleaner={decomposeNode:function(element){for(var children=element.remove().children(),i=0;i<children.length;i++)ComponentCleaner.decomposeNode(angular.element(children[i]))},destroyAttributes:function(attrs){attrs.$$element=null,attrs.$$observers=null},destroyElement:function(element){element.remove()},destroyScope:function(scope){scope.$$listeners={},scope.$$watchers=null,scope=null},onDestroy:function(scope,fn){var clear=scope.$on("$destroy",function(){clear(),fn.apply(null,arguments)})}};module.factory("ComponentCleaner",function(){return ComponentCleaner}),function(){var ngEventDirectives={};"click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" ").forEach(function(name){function directiveNormalize(name){return name.replace(/-([a-z])/g,function(matches){return matches[1].toUpperCase()})}var directiveName=directiveNormalize("ng-"+name);ngEventDirectives[directiveName]=["$parse",function($parse){return{compile:function($element,attr){var fn=$parse(attr[directiveName]);return function(scope,element,attr){var listener=function(event){scope.$apply(function(){fn(scope,{$event:event})})};element.on(name,listener),ComponentCleaner.onDestroy(scope,function(){element.off(name,listener),element=null,ComponentCleaner.destroyScope(scope),scope=null,ComponentCleaner.destroyAttributes(attr),attr=null})}}}}]}),module.config(["$provide",function($provide){var shift=function($delegate){return $delegate.shift(),$delegate};Object.keys(ngEventDirectives).forEach(function(directiveName){$provide.decorator(directiveName+"Directive",["$delegate",shift])})}]),Object.keys(ngEventDirectives).forEach(function(directiveName){module.directive(directiveName,ngEventDirectives[directiveName])})}()}(),function(){"use strict";var module=angular.module("onsen");module.factory("$onsen",["$rootScope","$window","$cacheFactory","$document","$templateCache","$http","$q","$onsGlobal","ComponentCleaner",function($rootScope,$window,$cacheFactory,$document,$templateCache,$http,$q,$onsGlobal,ComponentCleaner){function createOnsenService(){return{DIRECTIVE_TEMPLATE_URL:"templates",cleaner:ComponentCleaner,DeviceBackButtonHandler:$onsGlobal._deviceBackButtonDispatcher,_defaultDeviceBackButtonHandler:$onsGlobal._defaultDeviceBackButtonHandler,getDefaultDeviceBackButtonHandler:function(){return this._defaultDeviceBackButtonHandler},deriveMethods:function(view,element,methodNames){return methodNames.forEach(function(methodName){view[methodName]=function(){return element[methodName].apply(element,arguments)}}),function(){methodNames.forEach(function(methodName){view[methodName]=null}),view=element=null}},deriveEvents:function(view,element,eventNames,map){map=map||function(detail){return detail},eventNames=[].concat(eventNames);var listeners=[];return eventNames.forEach(function(eventName){var listener=function(event){view.emit(eventName,map(Object.create(event.detail)))};listeners.push(listener),element.addEventListener(eventName,listener,!1)}),function(){eventNames.forEach(function(eventName,index){element.removeEventListener(eventName,listeners[index],!1)}),view=element=listeners=map=null}},isEnabledAutoStatusBarFill:function(){return!!$onsGlobal._config.autoStatusBarFill},shouldFillStatusBar:function(element){return $onsGlobal.shouldFillStatusBar(element)},clearComponent:function(params){params.scope&&ComponentCleaner.destroyScope(params.scope),params.attrs&&ComponentCleaner.destroyAttributes(params.attrs),params.element&&ComponentCleaner.destroyElement(params.element),params.elements&&params.elements.forEach(function(element){ComponentCleaner.destroyElement(element)})},findElementeObject:function(element,name){return element.inheritedData(name)},getPageHTMLAsync:function(page){var cache=$templateCache.get(page);if(cache){var deferred=$q.defer(),html="string"==typeof cache?cache:cache[1];return deferred.resolve(this.normalizePageHTML(html)),deferred.promise}return $http({url:page,method:"GET"}).then(function(response){var html=response.data;return this.normalizePageHTML(html)}.bind(this))},normalizePageHTML:function(html){return html=(""+html).trim(),html.match(/^<ons-page/)||(html="<ons-page _muted>"+html+"</ons-page>"),html},generateModifierTemplater:function(attrs,modifiers){var attrModifiers=attrs&&"string"==typeof attrs.modifier?attrs.modifier.trim().split(/ +/):[];return modifiers=angular.isArray(modifiers)?attrModifiers.concat(modifiers):attrModifiers,function(template){return modifiers.map(function(modifier){return template.replace("*",modifier)}).join(" ")}},addModifierMethodsForCustomElements:function(view,element){var methods={hasModifier:function(needle){var tokens=ModifierUtil.split(element.attr("modifier"));return needle="string"==typeof needle?needle.trim():"",ModifierUtil.split(needle).some(function(needle){return-1!=tokens.indexOf(needle)})},removeModifier:function(needle){needle="string"==typeof needle?needle.trim():"";var modifier=ModifierUtil.split(element.attr("modifier")).filter(function(token){return token!==needle}).join(" ");element.attr("modifier",modifier)},addModifier:function(modifier){element.attr("modifier",element.attr("modifier")+" "+modifier)},setModifier:function(modifier){element.attr("modifier",modifier)},toggleModifier:function(modifier){this.hasModifier(modifier)?this.removeModifier(modifier):this.addModifier(modifier)}};for(var method in methods)methods.hasOwnProperty(method)&&(view[method]=methods[method])},addModifierMethods:function(view,template,element){var _tr=function(modifier){return template.replace("*",modifier)},fns={hasModifier:function(modifier){return element.hasClass(_tr(modifier))},removeModifier:function(modifier){element.removeClass(_tr(modifier))},addModifier:function(modifier){element.addClass(_tr(modifier))},setModifier:function(modifier){for(var classes=element.attr("class").split(/\s+/),patt=template.replace("*","."),i=0;i<classes.length;i++){var cls=classes[i];cls.match(patt)&&element.removeClass(cls)}element.addClass(_tr(modifier))},toggleModifier:function(modifier){var cls=_tr(modifier);element.hasClass(cls)?element.removeClass(cls):element.addClass(cls)}},append=function(oldFn,newFn){return"undefined"!=typeof oldFn?function(){return oldFn.apply(null,arguments)||newFn.apply(null,arguments)}:newFn};view.hasModifier=append(view.hasModifier,fns.hasModifier),view.removeModifier=append(view.removeModifier,fns.removeModifier),view.addModifier=append(view.addModifier,fns.addModifier),view.setModifier=append(view.setModifier,fns.setModifier),view.toggleModifier=append(view.toggleModifier,fns.toggleModifier)},removeModifierMethods:function(view){view.hasModifier=view.removeModifier=view.addModifier=view.setModifier=view.toggleModifier=void 0},declareVarAttribute:function(attrs,object){if("string"==typeof attrs["var"]){var varName=attrs["var"];this._defineVar(varName,object)}},_registerEventHandler:function(component,eventName){var capitalizedEventName=eventName.charAt(0).toUpperCase()+eventName.slice(1);component.on(eventName,function(event){$onsen.fireComponentEvent(component._element[0],eventName,event);var handler=component._attrs["ons"+capitalizedEventName];handler&&(component._scope.$eval(handler,{$event:event}),component._scope.$evalAsync())})},registerEventHandlers:function(component,eventNames){eventNames=eventNames.trim().split(/\s+/);for(var i=0,l=eventNames.length;l>i;i++){var eventName=eventNames[i];this._registerEventHandler(component,eventName)}},isAndroid:function(){return!!window.navigator.userAgent.match(/android/i)},isIOS:function(){return!!window.navigator.userAgent.match(/(ipad|iphone|ipod touch)/i)},isWebView:function(){return window.ons.isWebView()},isIOS7above:function(){var ua=window.navigator.userAgent,match=ua.match(/(iPad|iPhone|iPod touch);.*CPU.*OS (\d+)_(\d+)/i),result=match?parseFloat(match[2]+"."+match[3])>=7:!1;return function(){return result}}(),fireComponentEvent:function(dom,eventName,data){data=data||{};var event=document.createEvent("HTMLEvents");for(var key in data)data.hasOwnProperty(key)&&(event[key]=data[key]);event.component=dom?angular.element(dom).data(dom.nodeName.toLowerCase())||null:null,event.initEvent(dom.nodeName.toLowerCase()+":"+eventName,!0,!0),dom.dispatchEvent(event)},_defineVar:function(name,object){function set(container,names,object){for(var name,i=0;i<names.length-1;i++)name=names[i],(void 0===container[name]||null===container[name])&&(container[name]={}),container=container[name];if(container[names[names.length-1]]=object,container[names[names.length-1]]!==object)throw new Error('Cannot set var="'+object._attrs["var"]+'" because it will overwrite a read-only variable.')}var names=name.split(/\./);ons.componentBase&&set(ons.componentBase,names,object);for(var element=object._element[0];element.parentNode;){if(element.hasAttribute("ons-scope"))return set(angular.element(element).data("_scope"),names,object),void(element=null);element=element.parentNode}element=null,set($rootScope,names,object)}}}var $onsen=createOnsenService(),ModifierUtil=$onsGlobal._internal.ModifierUtil;return $onsen}])}(),window.jQuery&&angular.element===window.jQuery&&console.warn("Onsen UI require jqLite. Load jQuery after loading AngularJS to fix this error. jQuery may break Onsen UI behavior."),ons.notification.alert=function(options){var originalCompile=options.compile||function(element){return element};return options.compile=function(element){ons.compile(originalCompile(element))},ons.notification._alertOriginal(options)},ons.notification.confirm=function(options){var originalCompile=options.compile||function(element){return element};return options.compile=function(element){ons.compile(originalCompile(element))},ons.notification._confirmOriginal(options)},ons.notification.prompt=function(options){var originalCompile=options.compile||function(element){return element};return options.compile=function(element){ons.compile(originalCompile(element))},ons.notification._promptOriginal(options)},function(){"use strict";angular.module("onsen").run(["$templateCache",function($templateCache){for(var templates=window.document.querySelectorAll('script[type="text/ons-template"]'),i=0;i<templates.length;i++){var template=angular.element(templates[i]),id=template.attr("id");"string"==typeof id&&$templateCache.put(id,template.text())}}])}();
src/svg-icons/device/gps-fixed.js
barakmitz/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceGpsFixed = (props) => ( <SvgIcon {...props}> <path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/> </SvgIcon> ); DeviceGpsFixed = pure(DeviceGpsFixed); DeviceGpsFixed.displayName = 'DeviceGpsFixed'; DeviceGpsFixed.muiName = 'SvgIcon'; export default DeviceGpsFixed;
TransferPants prototype_files/wixappsCore.min.js
FanyaYoung/TransferPants-Wireframes
define("wixappsCore/core/proxyFactory",["lodash","react"],function(a,b){"use strict";function e(a,b){b.displayName=a+"Proxy",c[a]=b}function f(e){a.has(c,e)||(e="View");var f=d[e];if(f)return f;var g=c[e];if(!g)throw"no such proxy definition for name: "+e;return f=b.createClass(g),d[e]=f,f}function g(a){delete d[a]}function h(a,b){if(!c.hasOwnProperty(a))return void console.error("Trying to extend component ["+a+"] but the component is not defined");var d=c[a];d.mixins=[b].concat(d.mixins||[])}function i(b){return a.has(c,b)}var c={},d={},j=function(a){return{displayName:a,render:function(){return b.DOM.div(null,a)}}},k=["Label","ClippedParagraph","ClippedParagraph2","Date","DateEdit","TimeEdit","InlineText","InlineTextInput","TextInput","ErasableTextInput","NumberInput","NumericStepper","CheckBox","CheckBoxViewProxy","RichTextEditor","RichTextEditorInline","Price","EnumSelector","Image","Video","VideoSelector","VideoThumb","ImageSelector","ImageInput","VerticalList","FlowList","MultiColumn","VerticalListEditor","DraggableListItem","Box","VBox","HBox","Field","FieldBox","TextField","DataEditField","Stack","Css","InlineSpacer","HorizontalLine","VerticalLine","Switch","SwitchBox","OptionalArea","SuperFlow","Button","Button2","Table","Deck","TabMenu","Icon","StringArrayInput","Toggle","MusicPlayer","AudioInput","InlineSvg","Link","LinkSelector","OptionsList","SelectOptionsList","OptionsListInput","ComboBox","RadioGroup","CheckBoxGroup","TextArea","Area","Container","ZoomLink","AppLink","ZoomLayout","FixedRatioLayout","GoogleMap","LocationSelector","TagInput","DragAndDropVList","List2","PaginatedList","UnstyledLabel","TooltipIcon","Help","IFrame","ImageButton","TPAGallery","MediaRichTextEditorInline","MediaLabel","MediaThumb","Gallery","GridGallery","SliderGallery","ColumnGallery","PaginatedColumnGallery"];return a.forEach(k,function(a){e(a,j(a))}),{getProxyClass:f,register:e,invalidate:g,extend:h,isValidProxyName:i}}),define("wixappsCore/core/ViewContextMap",["lodash"],function(a){"use strict";function d(b){return a.isString(b)?a.compact(b.split(/[\.\[\]]/)):b}function e(c){return a.initial(c.split(b)).join(b)}function f(a,c,d){return a?c&&this.contextMap[c]?c:a+b+String(d.index++):"0"}function g(b,c,d){for(var f=b;f;){if(a.has(this.contextMap[f][c],d))return this.contextMap[f][c];f=e(f)}}function h(){this.contextMap={}}function i(a,b,c){for(;a.length>1;)b=b[a.shift()];b[a.shift()]=c}var b="_",c=".";return h.prototype={resolvePath:function(b,c){var f=a.flattenDeep(a.map(d(c),d)),g=b,h=[];if(a.forEach(f,function(a){if("parent"===a){if(g=e(g),!g)throw"Error:: no parent context."}else"this"!==a&&h.push(a)}),!this.contextMap[g])return null;if(this.contextMap[g].scopePath.length&&a.every(this.contextMap[g].scopePath,a.isArray)&&h.length&&a.isNumber(h[0])){var i=h.shift();return this.contextMap[g].scopePath[i].concat(h)}return this.contextMap[g].scopePath.concat(h)},newContextForDataItem:function(b,c,d,e,g,h){var i=f.call(this,b,h,this.contextMap[b]);return this.contextMap[i]&&a.isEqual(this.contextMap[i].scopePath,c)||(this.contextMap[i]={vars:d||{},events:e||{},functionLibrary:g||{},scopePath:c,index:0}),i},newContextForDataPath:function(b,d,e,f,g,h){var i=this.contextMap[b],j=a.isArray(d)?d:d.split(c);j=a.flattenDeep(a.map(j,function(b){return a.isString(b)?b.split(c):b})),j=a.without(j,"this");var k=i.scopePath.concat(j);return this.newContextForDataItem(b,k,e,f,g,h)},getVar:function(a,b){b=b.replace(/^\$/,"");var c=g.call(this,a,"vars",b);return c&&c[b]},setVar:function(b,c,d){var e=c.replace(/^\$/,"").split("."),f=a.first(e),h=g.call(this,b,"vars",f);h&&i(e,h,d)},overrideContextVars:function(b,c){if(!this.hasContext(b))throw"Context does not exist";a.assign(this.contextMap[b].vars,c)},getEvent:function(a,b){var c=g.call(this,a,"events",b);return c&&c[b]},getExpressionsFunctions:function(b){for(var c=b,d={};c;)a.defaults(d,this.contextMap[c].functionLibrary),c=e(c);return d},resetContext:function(){this.contextMap={}},hasContext:function(b){return a.has(this.contextMap,b)}},h}),define("wixappsCore/util/styleMapping",["lodash"],function(a){"use strict";function c(a){return b[a]}function d(c){return a.invert(b)[c]}var b={Title:"font_0",Menu:"font_1","Page title":"font_2","Heading XL":"font_3","Heading L":"font_4","Heading M":"font_5","Heading S":"font_6","Body L":"font_7","Body M":"font_8","Body S":"font_9","Body XS":"font_10"};return{styleToFontClass:c,fontClassToStyle:d}}),define("wixappsCore/core/expressions/functionLibrary",["lodash","wixappsCore/util/styleMapping","experiment!sv_blogVideoThumbnail","experiment!sv_blogCustomizeTagCloud"],function(a,b,c,d){"use strict";function f(){var b={},c=function(b,d,e){a.forEach(d,function(a,d){"function"==typeof a?b[e+d]=a:"object"==typeof a&&c(b,a,d+".")})};return c(b,e,""),b}function g(a){this.siteData=a}var e={and:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]===!1)return!1;return!0},or:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]===!0)return!0;return!1},"if":function(a,b,c){return a?b:c},eq:function(a,b){return a===b},ne:function(a,b){return a!==b},not:function(a){return!a},"!":function(a){return!a},gt:function(a,b){return a>b},gte:function(a,b){return a>=b},lt:function(a,b){return b>a},lte:function(a,b){return b>=a},toString:function(a){return a.toString?a.toString():""+a},toJson:function(a){return JSON.stringify(a)},mod:function(a,b){return a%b},add:function(){for(var a=0,b=0;b<arguments.length;b++)a+=arguments[b];return a},mult:function(){for(var a=1,b=0;b<arguments.length;b++)a*=arguments[b];return a},sub:function(a,b){return a-b},div:function(a,b){return a/b},match:function(a,b,c){return a===b?c:void 0},"true?":function(a,b){return Boolean(a)===!0?b:void 0},"false?":function(a,b){return Boolean(a)===!1?b:void 0},"else":function(a,b){return void 0===a?b:a},map:function(){for(var a=1;a<arguments.length-1;a+=2)if(arguments[0]===arguments[a])return arguments[a+1];return arguments.length%2===0?arguments[arguments.length-1]:arguments[0]},Math:{floor:function(a){return Math.floor(a)},round:function(a){return Math.round(a)}},Array:{length:function(a){return a.length},isEmpty:function(a){return null===a||0===a.length},slice:function(a,b,c){return a.slice(b,c)},join:function(a,b){return a.join(b)},filter:function(a,b,c){return a.filter(function(a){return c.contains(a[b])})},itemAt:function(a,b){return a[b]}},RichText:{isEmpty:function(a){return"<div></div>"===a.text}},String:{length:function(a){return String(a).length},isEmpty:function(a){return null===String(a)||0===String(a).length},charAt:function(a,b){return String(a).charAt(b)},charCodeAt:function(a,b){return String(a).charCodeAt(a,b)},concat:function(){return a.reduce(arguments,function(a,b){return a.concat(String(b))},"")},indexOf:function(a,b){return String(a).indexOf(b)},lastIndexOf:function(a,b){return String(a).lastIndexOf(b)},match:function(a,b){return String(a).match(new RegExp(b))},replace:function(a,b,c){return String(a).replace(b,c)},search:function(a,b){return String(a).search(new RegExp(b))},slice:function(a,b,c){return String(a).slice(b,c)},split:function(a,b){return String(a).split(b)},substr:function(a,b,c){return String(a).substr(b,c)},substring:function(a,b,c){return String(a).substring(b,c)},toLowerCase:function(a){return String(a).toLowerCase()},toUpperCase:function(a){return String(a).toUpperCase()},contains:function(a,b){return String(a).contains(b)},trim:function(a){return String(a).trim()},toInt:function(a){return parseInt(a,10)},toFloat:function(a){return parseFloat(a)}},Date:{createDate:function(a){return a?new Date(a):new Date},getBefore:function(a,b,c,d){var e=d?new Date(d):new Date;return e.setDate(e.getDate()-a),e.setMonth(e.getMonth()-b),e.setFullYear(e.getFullYear()-c),e},getAfter:function(a,b,c,d){var e=d?new Date(d):new Date;return e.setDate(e.getDate()-a),e.setMonth(e.getMonth()-b),e.setFullYear(e.getFullYear()-c),e}},Theme:{getColor:function(b){var c=this.siteData.getColor(b);return"#"!==c[0]?!a.includes(c,"rgb")&&a.includes(c,",")?"rgba("+c+")":"#"+c:c}},Styles:{fontToTextStyle:function(a){return b.fontClassToStyle("font_"+a)},calcFontSize:function(a){return 3*a+9}},Mobile:{zoom:function(){return this.siteData.isMobileView()?1/this.siteData.mobile.getZoom():1}},experiment:function(a){return{sv_blogVideoThumbnail:c,sv_blogCustomizeTagCloud:d}[a]}};return g.prototype=f(),g}),define("wixappsCore/core/viewsRenderer",["react","lodash","wixappsCore/core/proxyFactory","wixappsCore/core/ViewContextMap","wixappsCore/core/expressions/functionLibrary"],function(a,b,c,d,e){"use strict";function f(a){return!b.isEqual(this.rootDataItemRef,this.getRootDataItemRef())||this.isChanged&&this.isChanged(a)}return{componentWillMount:function(){this.viewContextMap=new d(this),this.functionLibrary=new e(this.props.siteData)},getDataAspect:function(){return this.props.siteAPI.getSiteAspect("wixappsDataAspect")},getAppService:function(){return this.props.siteData.getClientSpecMapEntry(this.props.compData.appInnerID)},getPackageName:function(a){var b=this.getAppService(a||this.props.siteData);return b&&(b.packageName||b.type)},getAppDescriptor:function(){var a=this.getDataAspect(),b=this.getPackageName();return a.getDescriptor(b)},getFormatName:function(){return this.props.siteData.isMobileView()?"Mobile":""},getNormalizedDataPath:function(a,b){return null===a?b:this.viewContextMap.resolvePath(a,b)},getDataByPath:function(a,b){if(null===a)return this.getDataByFullPath(b);var c=this.getPackageName(),d=this.getDataAspect(),e=this.getNormalizedDataPath(a,b);return d.getDataByPath(c,e)},getDataByFullPath:function(a){function e(a){return b.flattenDeep(b.map(a,function(a){return b.isString(a)?a.split("."):a}))}var c=this.getPackageName(),d=this.getDataAspect(),f=[];return b.every(a,b.isArray)?f=b.map(a,function(a){var c=e(a);return b.without(c,"this")}):(f=e(a),f=b.without(f,"this")),d.getDataByPath(c,f)},setDataByPath:function(a,b,c){var d=this.getPackageName(),e=this.getDataAspect(),f=this.getNormalizedDataPath(a,b);return e.setDataByPath(d,f,c)},setVar:function(a,b,c,d){this.viewContextMap.setVar(a,b,c),d||(this.registerReLayout(),this.forceUpdate())},getCompExtraData:function(){var a=this.getDataAspect();return a.getExtraDataByCompId(this.getPackageName(),this.props.compData.id)},componentWillUpdate:function(a){"content"===this.state.$displayMode&&f.call(this,a)&&this.viewContextMap.resetContext()},renderView:function(d){var e=this.getPackageName(),f={viewProps:{getPartData:this.getPartData,getPartDefinition:this.getPartDefinition,resolveImageData:this.resolveImageData,getNormalizedDataPath:this.getNormalizedDataPath,getDataByPath:this.getDataByPath,setDataByPath:this.setDataByPath,getDataByFullPath:this.getDataByFullPath,getViewDef:this.getViewDef,getLocalizationBundle:this.getLocalizationBundle,classSet:this.classSet,setVar:this.setVar,siteAPI:this.props.siteAPI,siteData:this.props.siteData,pageData:this.props.pageData,compProp:this.props.compProp,loadedStyles:this.props.loadedStyles,compId:this.props.id,packageName:e},functionLibrary:this.functionLibrary,viewContextMap:this.viewContextMap,viewName:this.getViewName(),formatName:this.props.formatName||this.getFormatName(),parentId:this.props.id,ref:"rootProxy",parentContextPath:null},g={viewName:f.viewName,partDirection:this.props.compProp.direction||"ltr"};this.props.style&&this.props.style.width&&(g.compWidth=this.props.style.width),this.logic&&(f.logic=this.logic,this.logic.getViewVars&&(g=b.defaults(this.logic.getViewVars(this.getCompExtraData()),g))),this.rootDataItemRef=this.getRootDataItemRef(),f.contextProps={path:this.rootDataItemRef,vars:{view:g,proxy:{}},events:{},functionLibrary:{}},f.proxyLayout={direction:g.partDirection},d&&(f.proxyLayout.height="100%");var h=c.getProxyClass("View");return a.createElement(h,f)}}}),define("wixappsCore/core/viewsCustomizer",["lodash"],function(a){"use strict";function b(a,b){var d=[];return"vars"===b.fieldId?d.push(a.vars):c(a,b,0,d),d}function c(b,d,e,f){var g=b.id||b.data||e;("*"===d.fieldId||d.fieldId===g)&&f.push(b),b.comp&&b.comp.items&&a.forEach(b.comp.items,function(a,b){c(a,d,b,f)}),b.comp&&b.comp.templates&&a.forEach(b.comp.templates,function(a){c(a,d,0,f)}),b.comp&&b.comp.cases&&a.forEach(b.comp.cases,function(b){a.isArray(b)?a.forEach(b,function(a){c(a,d,0,f)}):c(b,d,0,f)}),b.comp&&b.comp.columns&&"Table"===b.comp.name&&a.forEach(b.comp.columns,function(b){a.forEach(["item","header","footer"],function(a){void 0!==b[a]&&c(b[a],d,0,f)})})}function d(a,b){return!("*"!==b.forType&&a.forType!==b.forType||"*"!==b.view&&a.name!==b.view||"*"!==b.format&&(a.format||"")!==(b.format||""))}function e(b){var c=a.rest(arguments),e=this;return a.forEach(c,function(c){a.forEach(c,function(a){d(b,a)&&e.applyCustomization(b,a)})}),b}function f(c,d){var e=c.format||"",f=d.format||"";if("*"===f||f===e){var g=b(c,d);a.forEach(g,function(b){if(a.isPlainObject(b))for(var c=b,e=d.key.split("."),f=0;f<e.length;f++){var g=e[f];if(f===e.length-1){var h=d.value;/^\s*(\+|-)?\d+\s*$/.test(d.value)&&(h=parseInt(h,10)),void 0===h?delete c[g]:c[g]=h}else c[g]||(c[g]={}),c=c[g]}})}}return{customizeView:e,applyCustomization:f}}),define("wixappsCore/core/logicFactory",["lodash"],function(a){"use strict";function c(a,c){b[a]=c}function d(a){return b[a]}function e(c,d){return b.hasOwnProperty(c)?void a.assign(b[c].prototype,d):void console.error("Trying to extend logic for partId: ["+c+"] but the partId is not defined")}var b={};return{register:c,getLogicClass:d,extend:e}}),define("wixappsCore/util/viewsUtils",["lodash"],function(a){"use strict";function b(c,d){c.id=c.id||c.data||"def_"+d;var e=d+1;return c.comp&&c.comp.items&&a.forEach(c.comp.items,function(a){e=b(a,e)}),c.comp&&c.comp.templates&&a.forEach(c.comp.templates,function(a){e=b(a,e)}),c.comp&&c.comp.cases&&a.forEach(c.comp.cases,function(c){a.isArray(c)?a.forEach(c,function(a){e=b(a,e)}):e=b(c,e)}),c.comp&&c.comp.columns&&"Table"===c.comp.name&&a.forEach(c.comp.columns,function(c){a.forEach(["item","header","footer"],function(a){void 0!==c[a]&&(e=b(c[a],e))})}),e}function c(b,d){d(b);var e=["items","cases","templates"];a.forEach(e,function(e){b.comp&&b.comp[e]&&a.forEach(b.comp[e],function(b){a.isArray(b)?a.forEach(b,function(a){c(a,d)}):c(b,d)})})}function d(b,c,d){return a.compact([b,c,d]).join("|")}function e(b){if(a.isString(b)){var c=/[^\|]+\|([^\|]+).*/,d=b.match(c);return d?d[1]:null}}return{fillViewDefMissingIDs:function(a){b(a,0)},sanitizeCompId:function(a){return a.replace(/[\$:]/g,"")},traverseViews:c,getViewId:d,getViewNameFromId:e}}),define("wixappsCore/core/styleMap",[],function(){"use strict";return{Area:{"default":{skin:"wysiwyg.viewer.skins.area.AppleArea",style:"c1"},ecomCouponBox:{skin:"wysiwyg.viewer.skins.apps.DefaultBoxSkin",style:"ecom_cbx1"},ecomCartHeader:{skin:"wysiwyg.viewer.skins.apps.DefaultBoxSkin",style:"ecom_ch1"},ecomEmptyCartBG:{skin:"wysiwyg.viewer.skins.apps.DefaultBoxSkin",style:"ecom_ecbg1"}},Button:{"default":{skin:"wysiwyg.viewer.skins.button.BasicButton",style:"b3"},ecomViewCart:{skin:"wysiwyg.viewer.skins.button.BasicButton",style:"ecom_vc1"},ecomCheckout:{skin:"wysiwyg.viewer.skins.button.DisabledLayerButton",style:"ecom_co1"},ecomAddToCart:{skin:"wysiwyg.viewer.skins.button.BasicButton",style:"ecom_atc1"},ecomRemoveFromCart:{skin:"wysiwyg.viewer.skins.button.FixedFontButton",style:"ecom_rfc1"},ecomApplyCoupon:{skin:"wysiwyg.viewer.skins.button.ApplyButtonEcom",style:"ecom_apl1"},ecomAddProduct:{skin:"wysiwyg.viewer.skins.button.AddProductButton",style:"ecom_ap1"}},Button2:{"default":{skin:"wysiwyg.viewer.skins.button.BasicButton",style:"b3"},ecomViewCart:{skin:"wysiwyg.viewer.skins.button.BasicButton",style:"ecom_vc1"},ecomCheckout:{skin:"wysiwyg.viewer.skins.button.DisabledLayerButton",style:"ecom_co1"},ecomAddToCart:{skin:"wysiwyg.viewer.skins.button.BasicButton",style:"ecom_atc1"},ecomRemoveFromCart:{skin:"wysiwyg.viewer.skins.button.FixedFontButton",style:"ecom_rfc1"},ecomApplyCoupon:{skin:"wysiwyg.viewer.skins.button.ApplyButtonEcom",style:"ecom_apl1"},ecomAddProduct:{skin:"wysiwyg.viewer.skins.button.AddProductButton",style:"ecom_ap1"},ecomFeedbackContinueShopping:{skin:"wysiwyg.viewer.skins.button.EcomFeedbackContinueShopping",style:"ecom_fmcs1"},ecomFeedbackContinueShopping2:{skin:"wysiwyg.viewer.skins.button.EcomFeedbackContinueShopping2",style:"ecom_fmcs2"},ecomFeedbackCheckout:{skin:"wysiwyg.viewer.skins.button.EcomFeedbackCheckoutButton",style:"ecom_fmc1"}},ComboBox:{"default":{skin:"wysiwyg.viewer.skins.input.ComboBoxInputSkinNoValidation",style:"wa_cb1"},ecomComboBox:{skin:"wixapps.integration.skins.ecommerce.inputs.ComboBoxInputSkin",style:""},ecomShippingComboBox:{skin:"wysiwyg.viewer.skins.appinputs.EcomComboBoxInputSkin",style:"ecom_scb1"},wixAppsGui:{skin:"wixapps.integration.skins.inputs.ComboBoxInputSkin",style:""}},TextArea:{"default":{skin:"wysiwyg.viewer.skins.input.TextAreaInputSkin",style:"wa_tai1"},ecomTextArea:{skin:"wixapps.integration.skins.ecommerce.inputs.TextAreaInputSkin",style:""}},TextInput:{"default":{skin:"wysiwyg.viewer.skins.appinputs.AppsTextInputSkin",style:"wa_ti1"},ecomTextInput:{skin:"wysiwyg.viewer.skins.appinputs.EcomTextInputSkin",style:"ecom_ti1"}},ErasableTextInput:{"default":{skin:"wysiwyg.viewer.skins.appinputs.EcomErasableTextInputSkin",style:"ecom_eti1"}},Gallery:{"default":{skin:"wysiwyg.viewer.skins.paginatedgrid.PaginatedGridDefaultSkin",style:"pagg1"},productGallery:{skin:"wysiwyg.viewer.skins.paginatedgrid.PaginatedGridSimple",style:"pgg_cg0"},contentGallery:{skin:"wysiwyg.viewer.skins.paginatedgrid.PaginatedGridNoDetail",style:"pgg_cg1"},minipostGallery:{skin:"wysiwyg.viewer.skins.paginatedgrid.wixapps.PaginatedGridNoDetail",style:"pgg_cg2"},hoverGallery:{skin:"wysiwyg.viewer.skins.paginatedgrid.PaginatedGridNoBG",style:"pgg_cg3"},blogGallery:{skin:"wysiwyg.viewer.skins.paginatedgrid.PaginatedGridNoDetail",style:"pgg_cg4"}},Video:{"default":{skin:"wysiwyg.viewer.skins.video.VideoDefault",style:"v2"},mediaLabel:{skin:"wysiwyg.viewer.skins.VideoSkin"}},Container:{"default":{skin:"wysiwyg.viewer.skins.area.AppleArea",style:"c1"},ecomCouponBox:{skin:"wysiwyg.viewer.skins.apps.DefaultBoxSkin",style:"ecom_cbx1"},ecomCartHeader:{skin:"wysiwyg.viewer.skins.apps.DefaultBoxSkin",style:"ecom_ch1"},ecomEmptyCartBG:{skin:"wysiwyg.viewer.skins.apps.DefaultBoxSkin",style:"ecom_ecbg1"}},Image:{"default":{skin:"wysiwyg.viewer.skins.photo.NoSkinPhoto",style:"wp1"}},VideoThumb:{"default":{skin:"wysiwyg.viewer.skins.photo.NoSkinPhoto",style:"wp1"}},HorizontalLine:{"default":{skin:"wysiwyg.viewer.skins.FiveGridLineSkin",style:"hl1"}},VerticalLine:{"default":{skin:"wysiwyg.viewer.skins.VerticalLineSkin",style:"vl1"}},Table:{"default":{skin:"wysiwyg.viewer.skins.table.TableComponentDefaultSkin",style:"tblc1"}},VerticalList:{"default":{skin:"skins.core.InlineSkin",style:"vr1"},ecomOptionsList:{skin:"skins.core.InlineSkin"}},List2:{"default":{skin:"skins.core.InlineSkin"}},PaginatedList:{"default":{skin:"skins.core.InlineSkin"}},FlowList:{"default":{skin:"skins.core.InlineSkin"}},Date:{"default":{skin:"wysiwyg.viewer.skins.WRichTextClickableSkin"}},MediaLabel:{"default":{skin:"wysiwyg.viewer.skins.WRichTextClickableSkin"}},Label:{"default":{skin:"wysiwyg.viewer.skins.WRichTextClickableSkin"}},InlineText:{"default":{skin:"skins.core.VerySimpleSkin"}},ClippedParagraph:{"default":{skin:"wysiwyg.viewer.skins.WRichTextClickableSkin"}},ClippedParagraph2:{"default":{skin:"wysiwyg.viewer.skins.WRichTextClickableSkin"}},Icon:{"default":{skin:"wixapps.integration.skins.IconSkin"}},ImageButton:{"default":{skin:"wixapps.integration.skins.ImageButtonSkin"}},Toggle:{"default":{skin:"wixapps.integration.skins.ToggleSkin"}},SliderGallery:{"default":{skin:"wysiwyg.viewer.skins.galleryselectableslider.SelectableSliderGalleryDefaultSkin"}},NumericStepper:{"default":{skin:"wysiwyg.common.components.numericstepper.viewer.skins.NumericStepperSimpleSkin",style:"nums1"}}}}),define("wixappsCore/core/styleData",["wixappsCore/core/styleMap"],function(a){"use strict";function b(b){return a[b]&&a[b]["default"]&&a[b]["default"].skin}function c(b,c,d,e,f){if(f&&e&&b[e])return{skin:f,styleId:e};if(f)return{skin:f};var g=a[c][d]||a[c]["default"];return e=e||g.style,e&&b[e]?{styleId:e,skin:b[e].skin}:{styleId:g.style,skin:g.skin}}return{getDefaultSkinName:b,getSkinAndStyle:c}}),define("wixappsCore/core/styleCollector",["lodash","core","skins","wixappsCore/util/viewsUtils","wixappsCore/core/styleData","wixappsCore/core/styleMap"],function(a,b,c,d,e,f){"use strict";function h(b,c,d,e){var i,f=b&&d[b]&&g[d[b].skin],h=c&&g[c];i=f?b:h?c:"",i&&!e[i]&&(e[i]="s"+a.size(e))}function i(b,c,f){function g(b){var d=a.get(b,"comp.style"),g=a.get(b,"comp.skin")||b.comp&&e.getDefaultSkinName(b.comp.name);h(d,g,c,f)}d.traverseViews(b,g)}function j(b,c){a.forEach(f,function(d){a.forEach(d,function(a){h(a.style,a.skin,b,c)})})}var g=c.skins;return{collectViewStyles:i,addStyleIfNeeded:h,addDefaultStyles:j}}),define("wixappsCore/core/wixappsDataHandler",["lodash"],function(a){"use strict";function b(a,b){return a?(a.wixapps=a.wixapps||{},a.wixapps[b]=a.wixapps[b]||{},a.wixapps[b]):null}function c(a,c){var d=b(a,c);return d.descriptor?d.descriptor:null}function d(b){return a.get(b,"categories",null)}function e(a){var c=b(a,"blog");return d(c)}function f(b,c){var f,d=e(b);return d&&(f=a.find(d.categoryById,{name:c})),f||null}function g(a,c,d){var e=b(a,c);return e[d]?e[d]:null}function h(a,c,d,e){var f=b(a,c);f[d]=e}function i(a,c,d){var e=b(a,c);delete e[d]}function j(a,c,d){var e=b(a,c);return e[d+"_extraData"]||null}function k(c,d,e){if(!a.isArray(e)||0===e.length)return[];if(a.every(e,a.isArray))return a.map(e,function(a){return k(c,d,a)});var f=a.clone(e),g=b(c,d);if(!g.items)return null;for(var h=g.items;f.length;){var i=f.shift();h=h[i]}return h}function l(c,d,e,f){for(var g=a.clone(e),h=b(c,d),i=h.items;g.length>1;){var j=g.shift();i=i[j]}i[g.shift()]=f}function m(a){return["wixapps",a]}function n(b,c,d,e){var f=o(c,d,e);a.merge(f,b)}function o(a,c,d){var e=b(a,c);return e.metadata=e.metadata||{},e.metadata[d]=e.metadata[d]||{},e.metadata[d]}function p(a,c,d){var e=b(a,c);e.metadata&&e.metadata[d]&&(e.metadata[d]={})}function q(a,c){var d=b(a,c);return d.metadata=d.metadata||{},d.metadata[c+"_metadata"]=d.metadata[c+"_metadata"]||{},d.metadata[c+"_metadata"]}function r(b,c,d){var e=q(c,d);a.merge(e,b)}return{getDescriptor:c,getDataByCompId:g,setDataForCompId:h,clearDataForCompId:i,getExtraDataByCompId:j,getDataByPath:k,setDataByPath:l,getPackageData:b,getSiteDataDestination:m,setCompMetadata:n,getCompMetadata:o,getPackageMetadata:q,setPackageMetadata:r,clearCompMetadata:p,getBlogCategoriesFromPackageData:d,getBlogCategories:e,getBlogCategoryByName:f}}),define("wixappsCore/core/wixappsLogger",["lodash","utils"],function(a,b){"use strict";function i(b,d,e){try{var f=a.defaults({},d,g);c.reportBI(b,f,e)}catch(h){}}function j(b,d,e){try{var f=a.defaults({},d,h);c.reportBI(b,f,e)}catch(g){}}var c=b.logger,d={LISTS_EVENT_SOURCE:60,Type:{ERROR:10,USER_ACTION:40},Category:{EDITOR:1,VIEWER:2,CORE:3,SERVER:4},issue:{GENERAL:0,PROXY:1,APP_LOGIC:2,DATA_SERVICE:3,DATA_ITEMS:4,CORE_WIRING:5,DATA_EDITING:6,APP_BUILDER:7,APP_REPO_SERVICE:8},Severity:{RECOVERABLE:10,WARNING:20,ERROR:30,FATAL:40}},e={GENERIC_ERROR:{errorCode:-2e4,desc:"WixApps unspecified error"},APP_PART2_FAILED_TO_LOAD:{errorCode:-20011,desc:"Failed to load app part",issue:d.issue.APP_BUILDER},DATA_SELECTOR_CONTAINS_NULL:{errorCode:-20013,desc:"A data selector returned from the server with a null id key.",issue:d.issue.APP_BUILDER},MISSING_PERMALINK:{errorCode:-22041,desc:"Site data is missing the permalink data item"},REQUEST_FAILED:{errorCode:-1,desc:"Unspecified error occurred, possibly a connection problem"}};c.register("wixapps","error",e);var f={APP_BUILDER_PART_LOADED:{eventId:103,desc:"App builder - part loaded in published",params:{c2:"appPartName",g2:"userId"}},APP_PART2_FAILED_TO_LOAD_DATA_SELECTOR:{eventId:135,desc:"Failed to load data selector",params:{c1:"dataSelector"}},APP_PART2_FAILED_TO_LOAD_PART_DEFINITION:{eventId:136,desc:"Failed to load app part definition"},VIEW_DEFINITION_NOT_FOUND:{eventId:137,desc:"Failed to load view definition"},TAG_SELECTED_IN_VIEWER:{eventId:305,desc:"User selected a tag in the viewer."}};c.register("wixapps","event",f);var g={desc:e.GENERIC_ERROR.desc,errorCode:e.GENERIC_ERROR.errorCode,type:d.Type.ERROR,issue:d.issue.GENERAL,severity:d.Severity.ERROR,category:d.Category.VIEWER,src:d.LISTS_EVENT_SOURCE},h={type:d.Type.USER_ACTION,adapter:"lists",category:d.Category.VIEWER,src:d.LISTS_EVENT_SOURCE};return{events:f,errors:e,reportError:i,reportEvent:j}}),define("wixappsCore/core/expressions/expressionLexer",["lodash"],function(a){"use strict";function c(a){if(a.length){var b=d(a)||e(a)||f(a);return b?[b].concat(this.parseExpression(a.slice(b.length))):this.parseExpression(a.slice(1))}return[]}function d(c){var d=["'",'"'],e=function(a,c){if(a.length){if(b=a.charAt(0),"\\"===b&&a.length>1)return b+a.charAt(1)+e(a.slice(2),c);if(b!==c)return b+e(a.slice(1),c)}return""};return b=c.charAt(0),a.includes(d,b)?'"'+e(c.slice(1),b)+'"':void 0}function e(a){var b=/[\w\*\/\-\%\+\$]/,c=/[\w\*\/\-\%\+\.\$\[\]\?_]/,d=function(a){var b=a.charAt(0);return a.length&&b.match(c)?b+d(a.slice(1)):""},e=a.charAt(0);return e.match(b)?e+d(a.slice(1)):void 0}function f(a){return b=a.charAt(0),"("===b||")"===b?b:void 0}var b;return{parseExpression:c}}),define("wixappsCore/core/expressions/expressionParser",["wixappsCore/core/expressions/expressionLexer"],function(a){"use strict";function d(d){var g=a.parseExpression(d),h="("===g[0]?c:b,i=e(g,h);return f(i)}function e(a,b){if(a.length){var c=g(a,b)||i(a,b)||k(a,b);if(c)return[c.node].concat(e(c.next,b))}return[]}function f(a){function b(a){return"function"===a.type}if(a.length>0&&a.every(b)){var c=a.slice(1).reduce(function(a,b){return{type:b.type,content:b.content,params:[a].concat(f(b.params))}},a[0]);return[c]}return a}function g(a,b){var d=b===c?0:1,f=b===c?1:0;if("("===a[d]&&"string"==typeof a[f]){var g=h(a);return{next:a.slice(g.length+3),node:{type:"function",content:a[f],params:e(g,b)}}}}function h(a){var b=function(a,c){if(!(a.length&&c>0))return[];var d=a[0],e=a.slice(1);switch(d){case"(":return[d].concat(b(e,c+1));case")":return[d].concat(b(e,c-1));default:return[d].concat(b(e,c))}};return b(a.slice(2),1).slice(0,-1)}function i(a){var b,c=a[0];return"true"===c?b=!0:"false"===c?b=!1:'"'===c.charAt(0)&&'"'===c.charAt(c.length-1)||"'"===c.charAt(0)&&"'"===c.charAt(c.length-1)?b=j(c.slice(1,c.length-1)):isNaN(parseFloat(c,10))?isNaN(parseInt(c,10))||(b=parseInt(c,10)):b=parseFloat(c,10),void 0!==b?{next:a.slice(1),node:{type:"primitive",content:b}}:void 0}function j(a){return a=a.replace(/\\/g,"")}function k(a){return{next:a.slice(1),node:{type:"ref",content:a[0]}}}var b=0,c=1;return{parseExpressionSource:d}}),define("wixappsCore/core/expressions/expression",["wixappsCore/core/expressions/expressionParser","lodash"],function(a,b){"use strict";function c(a){return"object"==typeof a&&b.has(a,"$expr")}function d(b,c,d){var e=a.parseExpressionSource(c)[0];return g(b,e,c,d)}function e(a,c,d,e){var f=b.map(c.params,function(b){return g(a,b,d,e)}),h=e[c.content];if(!h)throw new Error("Expression: "+d+" | Cannot resolve function "+c.content+"()");return h.apply(e,f)}function f(a,b,c){var d=a(b.content);if(void 0===d)throw new Error("Expression: "+c+" | Cannot resolve symbol "+b.content);return d}function g(a,b,c,d){switch(b.type){case"primitive":return h(b.content);case"ref":return f(a,b,c,d);case"function":return e(a,b,c,d)}}function h(a){return b.isString(a)?/^\s*(\+|-)?\d+\s*$/.test(a)?parseInt(a,10):"true"===a?!0:"false"===a?!1:"null"===a?null:a:a}return{isExpression:c,evaluate:d,convertStringToPrimitive:h}}),define("wixappsCore/core/styleTranslator",["lodash"],function(a){"use strict";function g(a){return{WebkitBoxOrient:a,WebkitFlexDirection:b[a]||a,msFlexDirection:b[a]||a,flexDirection:b[a]||a}}function h(a,b){var c=1===String(a).split(" ").length;return"none"===a||"0"===a||0===a||""===a?"none":c&&"vertical"===b?a+" 1 auto":a}function i(a,b){var c=h(a,b);return{minWidth:0,WebkitFlex:c,msFlex:c,flex:c}}function k(a){return a.replace(/-([a-z])/gi,function(a,b){return b.toUpperCase()})}function l(b,c){return a.transform(b,function(b,d,e){var f=j[e];f?a.merge(b,f(d,c)):(b[k(e)]=d,b[k(e)]=d)},{})}var b={horizontal:"row",vertical:"column"},c={start:"flex-start",end:"flex-end"},d=a.invert(c),e={top:"start",middle:"center",bottom:"end",left:"start",right:"end"},f={start:"flex-start",end:"flex-end"},j={"flex-direction":g,"box-orient":g,"box-flex":i,flex:i,"align-items":function(a){return{WebkitAlignItems:c[a]||a,msFlexAlign:d[a]||a,"align-items":c[a]||a,"align-self":c[a]||a}},"box-align":function(a){return a=e[a]||a,{WebkitBoxAlign:c[a]||a,WebkitAlignItems:c[a]||a,MozBoxAlign:c[a]||a,msFlexAlign:a,alignItems:c[a]||a,boxAlign:c[a]||a}},"justify-content":function(a){return{justifyContent:f[a]||a,WebkitJustifyContent:f[a]||a,MozJustifyContent:f[a]||a,msFlexPack:a,msJustifyContent:f[a]||a}},"box-shadow":function(a){return{WebkitBoxShadow:a,MozBoxShadow:a,boxShadow:a}},"border-radius":function(a){return{WebkitBorderRadius:a,MozBorderRadius:a,borderRadius:a}}};return{translate:l}}),define("wixappsCore/util/spacersCalculator",["lodash"],function(a){"use strict";function c(c,d,e,f){e=e||"vertical",f=f||"ltr";var g={before:parseInt(d.spacerBefore||d.spacer,10),after:parseInt(d.spacerAfter||d.spacer,10)};return g.before&&(d[c+b[f][e].before]=g.before),g.after&&(d[c+b[f][e].after]=g.after),a.omit(d,["spacer","spacerBefore","spacerAfter"])}var b={rtl:{vertical:{before:"Top",after:"Bottom"},horizontal:{before:"Right",after:"Left"}},ltr:{vertical:{before:"Top",after:"Bottom"},horizontal:{before:"Left",after:"Right"}}};return{translateStaticSpacers:c.bind(null,"margin"),translateStaticSpacersXax:c.bind(null,"padding")}}),define("wixappsCore/core/wixappsConfiguration",[],function(){"use strict";var a=!1;return{shouldApplyAutomationAttributes:function(){return a},applyAutomationAttributes:function(){a=!0}}}),define("wixappsCore/core/wixappsPlugins",["lodash","wixappsCore/core/wixappsConfiguration"],function(a,b){"use strict";return{getAdditionalDomAttributes:function(c){var d={};return b.shouldApplyAutomationAttributes()&&(d=a.merge(d,{"data-vcview":c.props.viewName,"data-vcfield":c.getViewDefProp("id"),"data-vctype":c.props.forType,"data-proxy":c.constructor.displayName,"data-field-name":c.getViewDefProp("data")})),d}}}),define("wixappsCore/proxies/mixins/baseProxy",["lodash","core","react","wixappsCore/util/viewsUtils","wixappsCore/core/proxyFactory","wixappsCore/core/styleData","wixappsCore/core/expressions/expression","wixappsCore/core/styleTranslator","wixappsCore/util/spacersCalculator","utils","wixappsCore/core/wixappsPlugins"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";function l(){return this.getCompProp("hidden")?null:this.renderProxy()}function m(a){var b=a.parentContextPath,c=a.contextProps;c&&(b=this.createContext(a.parentContextPath,c.path,c.vars,c.events,c.functionLibrary)),this.contextPath=b}function n(a){var b=this.getCompProp("cssClass")||"";return this.props.className&&(b+=" "+this.props.className),this.getProxyCustomCssClass&&(b+=" "+this.getProxyCustomCssClass()),b+=" "+z(a),b=b.trim()}function o(a){var b=this.getCompProp("hoverVar");this.props.viewProps.setVar(this.contextPath,b,a)}function p(){var b={},c=this.getCompProp("hoverVar");c&&(b.onMouseEnter=o.bind(this,!0),b.onMouseLeave=o.bind(this,!1));var d=this.getCompProp("events");return a.transform(d,function(a,b,c){switch(j.stringUtils.startsWith(c,"dom:")&&(c="on"+c[4].toUpperCase()+c.substring(5),a[c]=this.handleViewEvent),c){case"click":a.onClick=this.handleViewEvent}},b,this)}function q(b){return a.isPlainObject(b)&&a.has(b,"_iid")}function r(b){return a.isPlainObject(b)&&b._type&&j.stringUtils.startsWith(b._type,"wix:Ref"); }function s(a){return[a.collectionId,a.itemId]}function t(b){var c=this.props.viewContextMap.getExpressionsFunctions(b);return a.assign(this.props.functionLibrary,c)}function u(b,c){a.isUndefined(b)&&(b=this.contextPath);var d,e=c.split("."),f=e.shift();if("$"===a.first(f))if(d=this.props.viewContextMap.getVar(b,f),g.isExpression(d))d=g.evaluate(u.bind(this,b),d.$expr,t.call(this,b));else for(;e.length;)d=d[e.shift()];else d=this.getDataByPath(c);return g.convertStringToPrimitive(d)}function v(a){return j.stringUtils.startsWith(a,"$")}function w(b){b=b||this.props;var c=this.getViewDefProp("value",b.viewDef);if(!a.isUndefined(c))return c;var d=b.viewDef&&b.viewDef.data||"this";return g.isExpression(d)?g.evaluate(u.bind(this,this.contextPath),d.$expr,t.call(this,this.contextPath)):v(d)?this.getVar(d):this.getDataByPath(d,!0)}function x(b,c){return d.sanitizeCompId(a.compact([this.props.viewProps.compId,this.props.viewId,this.contextPath,b&&b.id,c]).join("_"))}function y(b,c){var d=a.isArray(b)?a.map:a.mapValues;return d(b,function(b){var d=b;return g.isExpression(b)?d=g.evaluate(u.bind(this,c),b.$expr,t.call(this,c)):(a.isArray(b)||a.isPlainObject(b))&&(d=y.call(this,b,c)),g.convertStringToPrimitive(d)},this)}function z(a){return a&&a.display&&"box"===a.display?(delete a.display,"flex_display"):""}function A(b,c){var d={layout:b,componentType:c};if(this.useSkinInsteadOfStyles)return d.skin=this.getCompProp("skin")||f.getDefaultSkinName(this.getCompProp("name")),d;var e=f.getSkinAndStyle(this.props.viewProps.siteData.getAllTheme(),this.getCompProp("name"),this.getCompProp("styleNS"),this.getCompProp("style"),this.getCompProp("skin"));return a.assign(e,d)}function B(b){return a.pick(b,function(a,b){return 0===b.indexOf("data-")})}function C(b,c){if(c[""]=a.merge({},c[""],p.call(this),k.getAdditionalDomAttributes(this)),!b)return c;a.assign(c[""],B(this.props));var d=b(c);return a.forEach(d,function(a){a&&a.style&&(a.style=h.translate(a.style,this.props.orientation))},this),d}return{statics:{getPropDefs:function(b){if(a.includes(["compProp","viewProp"],b)){var c={};return a.forOwn(this,function(a,d){a.type===b&&(c[d]=a)}),c}},hidden:{type:"compProp",defaultValue:!1},style:{type:"compProp",defaultValue:null},layout:{type:"viewProp",defaultValue:{}}},getDataByPath:function(a,b){var c=this.props.viewProps.getDataByPath(this.contextPath,a);return b&&r(c)?this.props.viewProps.getDataByFullPath(s(c)):c},getVar:function(a){return this.props.viewContextMap.getVar(this.contextPath,a)},setVar:function(a,b,c){this.props.viewProps.setVar(this.contextPath,a,b,c)},getContextEvent:function(a){return this.props.viewContextMap.getEvent(this.contextPath,a)},getChildProxyProps:function(a,b,c){var d=null;b&&(d={path:b,vars:c.vars||{},events:c.events||{},functionLibrary:c.functionLibrary||{}});var e={ref:"child",viewName:this.props.viewName,forType:this.props.forType,formatName:this.props.formatName,orientation:this.props.orientation,viewDef:a,parentId:this.props.parentId,viewId:this.props.viewId,logicEvents:this.props.logicEvents,logic:this.props.logic,functionLibrary:this.props.functionLibrary,parentContextPath:this.contextPath,contextProps:d,viewContextMap:this.props.viewContextMap,viewProps:this.props.viewProps,id:x.call(this,a,"child")};return e},getChildCompProps:function(c,d){var e={id:x.call(this,this.props.viewDef,this.props.key),ref:"component"};if(!c)return e.style=this.getProxyStyle(),e.className=n.call(this,e.style),a.assign(e,p.call(this),k.getAdditionalDomAttributes(this),B(this.props));var f=this.getProxyStyle(),g=A.call(this,f,c),h=b.componentPropsBuilder.getCompProps(g,this.props.viewProps.siteAPI,this.props.pageId,this.props.viewProps.loadedStyles);delete h.style.position;var i=a.merge(h.style,f);return h.className=n.call(this,i),a.assign(h,e,{transformSkinProperties:C.bind(this,d),style:i,compProp:this.props.compProp})},getViewDefProp:function(a,b,c){b=b||this.props.viewDef||{},c=c||this.contextPath;var d=b[a],e=d;if(g.isExpression(d))e=g.evaluate(u.bind(this,c),d.$expr,t.call(this,c));else if("layout"===a||"css"===a||"stylesheet"===a)return y.call(this,d,c);return g.convertStringToPrimitive(e)},getCompProp:function(a,b,c){c=c||this.contextPath;var d=this.getViewDefProp("comp",b,c);if(d)return this.getViewDefProp(a,d,c)},getStyleDef:function(b,c){if(b)return a.merge({},this.getCompProp("css",b,c),this.getViewDefProp("layout",b,c));var d={};return this.getCustomStyle&&(d=this.getCustomStyle()),a.merge(d,this.getCompProp("css"),this.getViewDefProp("layout"),this.props.proxyLayout)},getProxyStyle:function(){var a=this.getStyleDef(),b=this.props.orientation||"vertical",c=this.props.viewProps.compProp&&this.props.viewProps.compProp.direction;return a.boxSizing="border-box",a=i.translateStaticSpacers(a,b,c),a=h.translate(a,this.props.orientation)},handleViewEvent:function(b,c){var d=this.getCompProp("events"),e=this.props.logic,f=d&&(d[b.type]||d["dom:"+b.type]);if(f){var h=a.isString(f)?f:f.event;h&&a.forEach(h.split(";"),function(d){var h=d.trim().match(/^set:([^=]+)=(.+)$/);if(h){var i=g.evaluate(u.bind(this,this.contextPath),h[2].trim(),t.call(this,this.contextPath)),j=h[1].trim();return void(v(j)?this.props.viewProps.setVar(this.contextPath,j,i):this.props.viewProps.setDataByPath(this.contextPath,j,i))}var k=this.getContextEvent(d);if(a.isFunction(k))return void k(b,c);if(!e)throw"Error:: Missing logic - cannot handle event ["+d+"]";if(!a.isFunction(e[d]))throw"Error:: Logic missing implementation for event ["+d+"]";f.params&&(b.params=y.call(this,f.params,this.contextPath));var l=this.getViewDefProp("data")||"this";b.dataPath=this.props.viewProps.getNormalizedDataPath(this.contextPath,l),e[d](b,c)},this)}},createContext:function(b,c,d,e,f){var g=a.merge({},d.view,d.proxy,this.getViewDefProp("vars")),h=this.props.viewProps.getDataByPath(b,c);if(null===b||q(h)){var i=this.props.viewProps.getNormalizedDataPath(b,c);return this.props.viewContextMap.newContextForDataItem(b,i,g,e,f)}return r(h)?this.props.viewContextMap.newContextForDataItem(b,s(h),g,e,f):this.props.viewContextMap.newContextForDataPath(b,c,g,e,f)},getInitialState:function(){return m.call(this,this.props),this.proxyData=w.call(this),{}},componentWillUpdate:function(a){this.props.viewContextMap.hasContext(this.contextPath)||m.call(this,a);var b=a.contextProps;b&&b.vars&&b.vars.proxy&&this.props.viewContextMap.overrideContextVars(this.contextPath,b.vars.proxy),this.proxyData=w.call(this,a)},render:function(){if(this.props.viewProps.siteData.isDebugMode())return l.call(this);try{return l.call(this)}catch(a){return console.error("Cannot render proxy "+this.constructor.displayName+" with id: "+this.props.id,a),null}}}}),define("wixappsCore/proxies/mixins/inputProxy",["utils","wixappsCore/proxies/mixins/baseProxy"],function(a,b){"use strict";function c(b){return a.stringUtils.startsWith(b,"$")}return{mixins:[b],setData:function(a,b){var d=this.getViewDefProp("data")||"this";b&&(d+="."+b);var e=c(d)?this.props.viewProps.setVar:this.props.viewProps.setDataByPath;e(this.contextPath,d,a)}}}),define("wixappsCore/core/linksConverter",["lodash","utils"],function(a,b){"use strict";function f(a){return{type:"AnchorLink",anchorName:a.anchorName,anchorDataId:a.anchorDataId,pageId:a.pageId}}function g(a){return{type:"DocumentLink",docId:a.docId,name:a.docName}}function h(a){return{type:"ExternalLink",url:a.protocol?a.protocol+"://"+a.address:a.address,target:a.target}}function i(a){return{type:"PageLink",pageId:"#"+a.pageId}}function j(a){return{type:"EmailLink",recipient:a.email,subject:a.subject}}function k(a){var e=a.href;if("WEBSITE"===a.linkType||d.test(e)){var f={address:e};return h(f)}if(b.stringUtils.startsWith(e,c))return i({pageId:e.substr(1)});if(b.stringUtils.startsWith(e,"mailto:")){var g=e.split("?"),k="";if(g.length>1){var l=b.urlUtils.parseUrlParams(g[1]);k=l.subject||""}var m={subject:k,email:g[0].substr(7)};return j(m)}}function l(b){if(!b)return null;var c=e[b._type];return c&&a.assign(c(b),{id:b.linkId})}var c="#!",d=/(:\/\/)|(^\/\/)/,e={"wix:Link":k,"wix:PageLink":i,"wix:ExternalLink":h,"wix:MailLink":j,"wix:DocLink":g,"wix:AnchorLink":f};return l}),define("wixappsCore/core/typesConverter",["lodash","utils","wixappsCore/core/linksConverter"],function(a,b,c){"use strict";return{richText:function(b){return{type:"StyledText",text:a.isString(b)?b:b.text}},image:function(a,b,c,d){return a=b(a,c,d),{type:"Image",uri:a.src,title:a.title,width:parseInt(a.width,10),height:parseInt(a.height,10)}},videoThumb:function(a,b,c){var d={src:a.imageSrc,title:"",width:480,height:360};return this.image(d,b,c)},table:function(b){return{type:"Table",columnsStyle:a.map(b,function(a,b){if(!a.item)throw"missing definition for item in column "+b;return a.item.styleData})}},video:function(a){return{type:"Video",videoId:a.videoId,videoType:a.videoType}},linkableButton:function(b){var c=b&&(b.linkId||b.pageId),d=a.isString(b)?b:b&&b.label;return{type:"LinkableButton",label:a.unescape(d),link:c?"#"+c:""}},selectableList:function(b,c){var d={type:"SelectableList",items:a.map(b.items,function(c){return{type:"SelectOption",value:c.value,text:a.isFunction(c.getText)?c.getText(b.selectedValue):c.text,enabled:c.enabled!==!1,description:c.description}}),selected:b.selectedValue};return a.isString(c)&&d.items.unshift({type:"SelectOption",value:-1,text:c,enabled:!0}),d},text:function(b){return{type:"Text",text:a.unescape(b)}},icon:function(a,b,c,d){return a=b(a,c,d),{type:"Icon",url:a.src,width:a.width,height:a.height,title:a.title}},link:c,imageList:function(b,c,d){return{type:"ImageList",items:a.map(b.items,function(b){return a.merge(this.image(b,c,d),{description:b.description||"",link:this.link(b.link)})},this)}}}}),define("wixappsCore/util/videoThumbDataHandler",["lodash"],function(a){"use strict";function d(a){return"http://img.youtube.com/vi/"+a+"/0.jpg"}function e(a){return"http://vimeo.com/api/v2/video/"+a+".json"}function f(a){return a.item.imageSrc=d(a.item.videoId),null}function g(a){if(a.item.imageSrc)return null;var b=e(a.item.videoId);return{force:!0,destination:a.path,url:b,dataType:"jsonp",transformFunc:i,error:function(){h(a)}}}function h(a){a.item.imageSrc=c}function i(b,c){var d=b[0],e=a.isArray(c)?j(c,d.id):c;return e.imageSrc=d.thumbnail_large,c}function j(b,c){return a.find(b,{videoId:c+""})}function k(a){return a.item.videoType?b[a.item.videoType].prepareVideoThumbUrl(a):h(a)}function l(b,d){return c||(c=d.santaBase+"/static/images/video/not-found.png"),a.compact(a.map(b,k))}var b={YOUTUBE:{prepareVideoThumbUrl:f},VIMEO:{prepareVideoThumbUrl:g}},c="";return{handleVideoThumbUrls:l}}),define("wixappsCore/proxies/mixins/baseCompositeProxy",["react","lodash","wixappsCore/proxies/mixins/baseProxy","wixappsCore/core/proxyFactory","wixappsCore/core/styleTranslator"],function(a,b,c,d,e){"use strict";function h(a){return b.includes(g,a)}function i(a,b){var c=this.getStyleDef(a,b);c.boxSizing="border-box";var d=this.getCompProp("size",a);if("*"===d)c["box-flex"]=1;else{var g=this.getCompProp("name",a);c[f[g]]=d}return e.translate(c,b.orientation)}function j(b,c){return this.getCompProp("hidden",b)?null:(c.style=i.call(this,b,c),a.DOM.div(c))}var f={HSpacer:"width",VSpacer:"min-height"},g=["HSpacer","VSpacer"];return{mixins:[c],renderChildProxy:function(b,c,e,f){f=f||this.getChildProxyProps(b),c=String(c||"0"),f.key=c,f.ref=c,f.refInParent=c,f.proxyLayout=e,this.getChildrenOrientation&&(f.orientation=this.getChildrenOrientation());var g=this.getCompProp("name",b);if(h(g))return j.call(this,b,f);var i=d.getProxyClass(g);return a.createElement(i,f)}}}),define("wixappsCore/util/localizer",["lodash","utils"],function(a,b){"use strict";function e(b,c){return a.has(c,b)?c[b]:"["+b+"] - not found"}var c="@",d={macroPattern:new RegExp("^"+c+"[0-9a-zA-Z_\\-\\.]*"+c+"$"),thingyPattern:new RegExp(c,"g")};return{getLocalizationBundleForPackage:function(a,c,d){var e=b.wixUserApi.getLanguage(d.requestModel.cookie,d.currentUrl).toLowerCase(),f=a.getDescriptor(c);return f&&(f.lang[e]||f.lang.en)},localize:function(a,b){for(var c,f,g;null!==(c=d.macroPattern.exec(a));)c=c[0],f=c.replace(d.thingyPattern,""),g=e(f,b),a=a.replace(c,g);return a}}}),define("wixappsCore/util/wixappsUrlParser",["lodash","utils","wixappsCore/core/wixappsDataHandler","wixappsCore/core/wixappsLogger"],function(a,b,c,d){"use strict";var e={"79f391eb-7dfc-4adf-be6e-64434c4838d9":{parse:function(a,b){var c=b.split("/"),d={};d.filter={},"Featured"===c[0]&&(d.filter.featured=!0,c.shift());for(var e=0;e<c.length;e+=2)switch(c[e]){case"Type":d.filter._type=c[e+1];break;case"Tag":var f=decodeURIComponent(c[e+1]);f&&-1!==f.indexOf("-")?d.filter.tags={$in:[f,f.replace(/-/g," ")]}:d.filter.tags=f;break;case"Category":var g=decodeURIComponent(c[e+1]);d.categoryNames=JSON.stringify([g]);break;case"Page":d.page=c[e+1];break;case"Sort":d.sort=c[e+1];break;case"Date":var h=c[e+1];d.filter["date.iso"]={$regex:"^"+h}}return d}}};return{getAppPageParams:function(b,c){var d=c?a.assign(b.currentPageInfo,c):b.currentPageInfo,f=b.getDataByQuery(d.pageId);if("AppPage"===f.type&&e[f.appPageId]){var g=d.pageAdditionalData||"";return e[f.appPageId].parse(b,g)}return null},getPageSubItemId:function(a,b){var c=b||a.currentPageInfo;if(!c.pageAdditionalData)return null;var d=a.getDataByQuery(c.pageId),e=c.pageItemId&&a.getDataByQuery(c.pageItemId);if("AppPage"===d.type||e&&"PermaLink"===e.type){var f=c.pageAdditionalData.match(/(.+?)($|\/.*$)/i);return f[1]}return null},getAppPartZoomAdditionalDataPart:function(a,b){var c=encodeURIComponent(b.toLowerCase().replace(/[\s|\/]+/gi,"-"));return a+"/"+c},getAppPartZoomUrl:function(a,c,e,f){var g=a.getDataByQuery(c);if(!g)return d.reportError(a,d.errors.MISSING_PERMALINK),a.currentUrl.full;var h={title:g.mutableSeoTitle,pageItemId:c,pageAdditionalData:this.getAppPartZoomAdditionalDataPart(e,f)};return b.wixUrlParser.getUrl(a,h)},getAppPageUrl:function(a,c,d,e){var f={pageId:c,title:e,pageAdditionalData:d};return b.wixUrlParser.getUrl(a,f)}}}),define("wixappsCore/util/socialShareHandler",["lodash","utils"],function(a,b){"use strict";function i(a,b){var c=a.split("#"),d=a.indexOf("?")>-1?"&":"?";return c[0]+=d+b,c.join("#")}function j(a,b){var c=a,d=c.split("#!");return d.length>1&&(d[1]=decodeURIComponent(d[1]),c=d.join("#!")),b&&(c=c.replace("#!","/#!")),encodeURIComponent(c)}function k(b){return b?encodeURIComponent(a.unescape(b)):""}function l(a){return a?(a=a.replace(/#/g,encodeURIComponent("#"))," "+a):""}function m(a,c){var d=a||"";return a&&0!==a.indexOf("http")&&(d=b.imageUrl.getImageAbsoluteUrl(c,a)),d=encodeURIComponent(d)}function n(a){var b=c;return b+=j(a.url)}function o(a,b){var c=d;return c+=j(a.url),c+="&Title="+k(a.title),c+="&ImageURL="+m(a.imageUrl,b)}function p(a,b){var c=e;return c+=j(a.url),c+="&media="+m(a.imageUrl,b),c+="&description="+k(a.title)}function q(a){var b=f;return b+=j(a.url),b+="&text="+k(a.title)+l(a.hashTags)+encodeURIComponent("\n")}function r(a){var b=g;return b+=j(a.url),b+="&t="+k(a.title)}function s(a){var b=h;return b+=k(a.title),b+=" - "+j(a.url)}function t(a,b){var c="";switch(a.service){case"google":c=n(a,b);break;case"fancy":c=o(a,b);break;case"pinterest":c=p(a,b);break;case"twitter":c=q(a,b);break;case"facebook":c=r(a,b);break;case"whatsapp":c=s(a,b)}return c}function u(a,b){var c=t(a,b.getSiteData());a.addDeepLinkParam&&(c=i(c,"deeplink_referrer=socialB_"+a.service)),b.openPopup(c,"wixapps_share","width=635,height=346,scrollbars=no,status=no,toolbar=no,menubar=no,location=no")}var c="https://plus.google.com/share?url=",d="http://www.fancy.com/fancyit/fancy?ItemURL=",e="http://pinterest.com/pin/create/button/?url=",f="https://twitter.com/intent/tweet?url=",g="http://www.facebook.com/sharer.php?u=",h="whatsapp://send?text=";return{handleShareRequest:u}}),define("wixappsCore/util/typeNameResolver",["lodash"],function(a){"use strict";function b(b){if(a.isUndefined(b))return"undefined";if(a.isNull(b))return"null";if(b._type)return b._type;if(a.isString(b))return"String";if(a.isNumber(b))return"Number";if(a.isBoolean(b))return"Boolean";if(a.isArray(b))return"Array";if(a.isPlainObject(b))return"wix:Object";throw"Error:: Unable to resolve typeName for dataItem [ "+JSON.stringify(b)+" ]"}return{getDataItemTypeName:b}}),define("wixappsCore/proxies/mixins/boxProxy",["react","lodash","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c){"use strict";function f(a,b){return{id:b,comp:{name:a,size:"*"}}}function g(a,b,c,g){b=b||"vertical";var h=a.layout||{};if("*"===h[e[c]]||"*"===h[e.both]){var i=d[b],j=a.id+"_spacer_"+c,k=f(i,j),l="spacer_"+c+"_"+g;return this.renderChildProxy(k,l)}return null}function h(a,b,c){return g.call(this,a,b,"before",c)}function i(a,b,c){return g.call(this,a,b,"after",c)}function j(a){return!("none"===a||"0"===a||0===a||""===a||null===a||b.isUndefined(a))}function k(a){return b.some(a,function(a){var b=this.getStyleDef(a);return"*"===b[e.before]||"*"===b[e.after]||"*"===b[e.both]||j(b["box-flex"])||j(b.flex)||a.comp&&"*"===a.comp.size?!0:void 0},this)}function l(a,b,c){if("rtl"===b&&"horizontal"===c){var d={start:"end",end:"start"};a=d[a]||a}return a}var d={vertical:"VSpacer",horizontal:"HSpacer"},e={both:"spacer",before:"spacerBefore",after:"spacerAfter"};return{mixins:[c],getCustomStyle:function(){var a=this.getCompProp("items"),b=k.call(this,a),c=this.getCompProp("pack"),d=this.getCompProp("box-align"),e=this.getChildrenOrientation(),f="horizontal"===e,g=b||c||d||f,h={position:"relative",display:g?"box":"block","box-orient":e};return d&&(h["box-align"]=d),c&&(h["justify-content"]=l(c,this.getVar("partDirection"),e)),h},renderProxy:function(){var a=this.getCompProp("items"),c=this.getChildrenOrientation(),d=b.map(a,function(a,d){var e=h.call(this,a,c,d),f=this.renderChildProxy(a,d),g=i.call(this,a,c,d);return b.compact([e,f,g])},this);d=b.flattenDeep(d);var e=this.getComponentName&&this.getComponentName(),f=this.getChildCompProps(e,this.transformSkinProperties);"vertical"===c&&(f.className=f.className||"",f.className+=" flex_vbox"),this.getCustomProps&&(f=b.assign(f,this.getCustomProps()));var g=this.getReactClass();return g(f,d)}}}),define("wixappsCore/proxies/mixins/zoomProxy",["lodash","react","wixappsCore/proxies/mixins/boxProxy"],function(a,b,c){"use strict";var d=b.createClass({displayName:"AnchorInPositionAbsoluteWithSiblings",onClick:function(a){a.target=this.refs.a.getDOMNode()},render:function(){var c=a.omit(this.props,"style","href");return c.onClick=this.onClick,c.style=a.merge({},this.props.style,{cursor:"pointer"}),b.DOM.div(c,b.DOM.a({ref:"a",href:this.props.href,"data-page-item-context":c.pathToItems,target:c.target,style:{position:"absolute",top:0,right:0,left:0,bottom:0}}),c.children)}}),e=b.createFactory(d);return{mixins:[c],getChildrenOrientation:function(){return this.getCompProp("orientation")||"vertical"},getReactClass:function(){return e}}}),define("wixappsCore/proxies/zoomLinkProxy",["react","lodash","wixappsCore/proxies/mixins/zoomProxy","wixappsCore/util/wixappsUrlParser"],function(a,b,c,d){"use strict";return{mixins:[c],getCustomProps:function(){var a=this.props.viewProps.siteAPI.getSiteAspect("wixappsDataAspect"),c=a.getDescriptor(this.props.viewProps.packageName),e=this.props.viewProps.getPartDefinition(),f=b.find(c.parts,{id:e.zoomPartName[0]}),g=this.props.viewProps.getPartData(),h=f.zoomParams.urlIdPrefix+g.appInnerID,i={};return i.href=d.getAppPartZoomUrl(this.props.viewProps.siteData,h,this.proxyData._iid||this.proxyData.id,this.proxyData.title),i.pathToItems=this.props.viewProps.getNormalizedDataPath(this.contextPath,this.getCompProp("listExpression")).join("."),i}}}),define("wixappsCore/proxies/appLinkProxy",["lodash","utils","wixappsCore/proxies/mixins/zoomProxy","wixappsCore/util/wixappsUrlParser"],function(a,b,c,d){"use strict";function e(b){if(!b)return{};var c=a.filter(b.split("/"),function(a,b){return b%2===0}),d=a.filter(b.split("/"),function(a,b){return b%2===1});return a.zipObject(c,d)}function f(b){return a.reduce(b,function(a,b,c){return a+"/"+c+"/"+b},"").substring(1)}function g(a){return a.pageUriSEO||a.title}function i(b,c){return"samePage"===b?this.props.viewProps.siteData.getDataByQuery(this.props.viewProps.siteData.currentPageInfo.pageId):a.find(c,function(a){return a.appPageId&&a.appPageId===b})}var h={appPageLink:function(b,c,e){var f=a.unescape(e.title).replace(/(?![a-z0-9])(?!\s)[\x00-\x7F]/gi,"").replace(/\s+/g,"-");return{href:d.getAppPageUrl(b,c.id,e._iid,f)}},date:function(a,b,c){var e="Date/"+c.value;return{href:d.getAppPageUrl(a,b.id,e,g(b))}},tag:function(a,b,c){var e="Tag/"+(c.key||c).replace(/\s+/g,"-");return{href:d.getAppPageUrl(a,b.id,e,g(b))}},category:function(a,b,c){var e=c,f="Category/"+[e.name];return{href:d.getAppPageUrl(a,b.id,f,g(b))}},prevPage:function(a,b){var c=a.currentPageInfo.pageAdditionalData||"",h=e(c);return h.Page&&Number(h.Page)&&(h.Page=Number(h.Page)-1),0===Number(h.Page)&&delete h.Page,{href:d.getAppPageUrl(a,b.id,f(h),g(b))}},nextPage:function(a,b){var c=a.currentPageInfo.pageAdditionalData||"",h=e(c);return h.Page&&Number(h.Page)?h.Page=Number(h.Page)+1:h.Page=1,{href:d.getAppPageUrl(a,b.id,f(h),g(b))}}};return{mixins:[c],getCustomProps:function(){var a=this.getCompProp("linkType")||"appPageLink",b=this.props.viewProps.siteData.getPagesDataItems(),c=this.getCompProp("pageId"),d=i.call(this,c,b);return d&&a&&h[a]?h[a](this.props.viewProps.siteData,d,this.proxyData):{}}}}),define("wixappsCore/core/layoutBasedHelper",["lodash"],function(a){"use strict";function b(b,c){var d=a.has(b,"width");return d=d||"vertical"===c,d=d||"horizontal"===c&&(a.has(b,"flex")||a.has(b,"box-flex"))}function c(b,c){var d=a.has(b,"height");return d=d||"horizontal"===c,d=d||"vertical"===c&&(a.has(b,"flex")||a.has(b,"box-flex"))}return{isLayoutBasedWidth:b,isLayoutBasedHeight:c}}),define("wixappsCore/proxies/areaProxy",["lodash","react","core","wixappsCore/proxies/mixins/boxProxy","wixappsCore/core/layoutBasedHelper"],function(a,b,c,d,e){"use strict";var f=c.compFactory,g={display:"inherit","flex-direction":"inherit"};return{mixins:[d],getChildrenOrientation:function(){return this.getCompProp("orientation")||"vertical"},getComponentName:function(){return"wixapps.integration.components.Area"},getReactClass:function(){return f.getCompClass(this.getComponentName())},transformSkinProperties:function(b){var c=this.getStyleDef();return e.isLayoutBasedHeight(c,this.props.orientation)&&(b.bg=b.bg||{},b.bg.style=a.merge({},b.bg.style,{height:"100%"})),b.inlineContent.style=a.merge({},b.inlineContent.style,g,{position:"relative",width:"100%"}),b}}}),define("wixappsCore/proxies/mixins/siteButtonProxy",["lodash","core","wixappsCore/proxies/mixins/baseProxy","wixappsCore/core/typesConverter","wixappsCore/util/localizer"],function(a,b,c,d,e){"use strict";var f=b.compFactory,g="wysiwyg.viewer.components.SiteButton";return{mixins:[c],statics:{componentType:g},getCustomStyle:function(){var b={position:"relative"};return this.getAdditionalButtonStyle&&(b=a.merge(b,this.getAdditionalButtonStyle())),b},renderProxy:function(){var b=this.getChildCompProps(g,this.transformSkinProperties),c=d.linkableButton(this.proxyData),h=this.getCompProp("label");a.isUndefined(h)&&(h=c.label),c.label=h.toString()?e.localize(h,this.props.viewProps.getLocalizationBundle()):this.getDefaultLabel(),b.compData=c;var i=this.proxyData;return i&&i.pageId&&(b.getDataByQuery=function(){return d.link(i)}),b.compProp={align:this.getCompProp("align")||"center",margin:this.getCompProp("margin")||0},f.getCompClass(g)(b)}}}),define("wixappsCore/proxies/buttonProxy",["wixappsCore/proxies/mixins/siteButtonProxy","lodash"],function(a,b){"use strict";return{mixins:[a],transformSkinProperties:function(a){var c={"data-proxy-name":"Button",onClick:this.handleViewEvent};return a[""]=b.merge({},a[""],c),a},getAdditionalButtonStyle:function(){var a={},b=this.getCompProp("label")||this.proxyData;return""===b&&(a.display="none"),a},getDefaultLabel:function(){return"Submit"}}}),define("wixappsCore/proxies/button2Proxy",["wixappsCore/proxies/mixins/siteButtonProxy","lodash"],function(a,b){"use strict";return{mixins:[a],transformSkinProperties:function(a){var c=this.getProxyStyle(),d=c.height||this.getCompProp("height")||30,e={onClick:this.handleViewEvent,"data-proxy-name":"Button2",style:{height:d,maxWidth:c.width}};a[""]=b.merge({},a[""],e);var f={overflow:"hidden"};return a.link.style=b.merge({},a.link.style,f),a},getDefaultLabel:function(){return""}}}),define("wixappsCore/util/richTextDefaultStyles",[],function(){"use strict";function a(a){var b="#"===a.charAt(0),c={name:b?"style":"class",value:b?"color:"+a+";":a};return{name:"span",attributes:[c]}}function b(a){var b="#"===a.charAt(0),c={name:b?"style":"class",value:b?"background-color:"+a+";":a};return{name:"span",attributes:[c]}}function c(){return{name:"strong"}}function d(){return{name:"em"}}function e(){return{name:"strike"}}function f(){return{name:"u"}}function g(a){return{name:"span",attributes:[{name:"style",value:"font-size:"+a+"px;"}]}}return{color:a,backgroundColor:b,bold:c,italic:d,lineThrough:e,underline:f,fontSize:g}}),define("wixappsCore/proxies/mixins/textProxy",["lodash","utils","wixappsCore/proxies/mixins/baseProxy","wixappsCore/util/richTextDefaultStyles","wixappsCore/util/styleMapping","wixappsCore/core/typesConverter","wixappsCore/util/localizer","fonts","reactDOM"],function(a,b,c,d,e,f,g,h,i){"use strict";function j(a){return a.replace(/<a\b[^>]*>(.*?)<\/a>/gi,"$1")}function k(b){var c=a.map(b,function(a){return a.value.indexOf('"')>-1?a.name+"='"+a.value+"'":a.name+'="'+a.value+'"'}).join(" ");return c.length?" "+c:c}function l(b){return a.map(b,function(a){return"<"+a.name+k(a.attributes)+">"}).join("")}function m(b){return a.map(b,function(a){return"</"+a.name+">"}).reverse().join("")}function n(b){return a(b).groupBy("name").map(function(b,c){var d=a(b).pluck("attributes").flattenDeep().compact().groupBy("name").map(function(b,c){return{name:c,value:a.pluck(b,"value").join(" ")}}).value();return{name:c,attributes:d}}).value()}function o(b,c){var e=a.reduce(c,function(a,b){return a[b.name]=b.value,a},{});e["class"]=this.getStyle(this.getCompProp("style")||"Body M"),this.getCompProp("singleLine")&&(e["class"]+=" singleLine");var f=this.getCompProp("line-height");f&&(e.style=e.style||"",/line-height:/.test(e.style)||(e.style="line-height:"+f+"em;"+e.style));var g=this.getCompProp("fontFamily");g&&(e.style=e.style||"",/font-family:/.test(e.style)||(e.style="font-family:"+h.fontUtils.getFontFamilyWithFallbacks(g)+";"+e.style));var i=[{name:b||"p",attributes:a.reduce(e,function(a,b,c){return a.push({name:c,value:b}),a},[])}];return a.forEach(["color","backgroundColor","bold","italic","lineThrough","underline","fontSize"],function(a){var b=this.getCompProp(a);b&&i.push(d[a](b))},this),n(i)}function p(b){return"wix:RichText"===b._type&&a.get(b,"version",0)<2}function q(b,c){return"wix:RichText"===b._type&&"2.0"===c&&a.get(b,"version",0)>=2}function r(a){var c=[],d=[];return b.htmlParser(a,{start:function(a,b,e){var f=[{name:e||0!==c.length?a:"hatul",attributes:b}];e||c.push(m(f)),d.push(l(f))},end:function(){d.push(c.pop())},chars:function(a){0===c.length?(d.push("<hatul>"),d.push(a),d.push("</hatul>")):d.push(a)}}),d.join("")}var s=new RegExp(a.escape("<br/?>"),"gi");return{mixins:[c],statics:{prefix:{type:"compProp",defaultValue:""},postfix:{type:"compProp",defaultValue:""},disableLinks:{type:"compProp",defaultValue:!1},lineThrough:{type:"compProp",defaultValue:!1},underline:{type:"compProp",defaultValue:!1},singleLine:{type:"compProp",defaultValue:!1},color:{type:"compProp",defaultValue:null},backgroundColor:{type:"compProp",defaultValue:null},noWrap:{type:"compProp",defaultValue:!1},bold:{type:"compProp",defaultValue:!1},italic:{type:"compProp",defaultValue:!1},lineHeight:{type:"compProp",defaultValue:null},fontFamily:{type:"compProp",defaultValue:null},fontSize:{type:"compProp",defaultValue:null},showTooltip:{type:"compProp",defaultValue:!1}},useSkinInsteadOfStyles:!0,getInitialState:function(){return{showToolTip:!1}},componentDidMount:function(){var a=i.findDOMNode(this),b=this.getCompProp("singleLine")&&this.getCompProp("showTooltip")&&a.scrollWidth>a.offsetWidth;b!==this.state.showToolTip&&this.setState({showToolTip:b})},createFormattedText:function(b,c){if("wix:RichText"===b._type||"wix:MediaRichText"===b._type){var d=this.props.viewProps.getPartDefinition().version;return this.getDataWithDefaultStyle(b.text,c,p(b),q(b,d))}"string"!=typeof b&&(b="");var e=b.replace(s,a.unescape),f=a.compact(["<hatul>",this.getCompProp("prefix"),e,this.getCompProp("postfix"),"</hatul>"]).join("");return this.getDataWithDefaultStyle(f,c,!1,!1)},getDataWithDefaultStyle:function(a,c,d,e){var f=this.getCompProp("disableLinks")?j(a):a,h=d?r(f):f,i=this.getCompProp("singleLine"),k=!1,n=this,p=[],q=[],s=this.props.viewProps.getLocalizationBundle(),t=!1;return b.htmlParser(h,{start:function(a,b,d){if(!k&&(!i||"img"!==a&&"br"!==a)){var g,f=0===p.length;g="hatul"===a?!f&&e?[{name:"span",attributes:[]}]:o.call(n,c,b):[{name:a,attributes:b}],d||p.push(m(g)),q.push(l(g))}},end:function(){k||(q.push(p.pop()),0===p.length&&i&&(t?k=!0:q=[]))},chars:function(a){if(!(k||0===p.length&&/^\s+$/.test(a))){var b=g.localize(a,s);t=t||!/^(&nbsp;)+$/.test(b),q.push(b)}}}),q.join("")},getLinkDataByQuery:function(b){var c=a.find(this.proxyData.links,{linkId:b});return c?f.link(c):null},getDataByQuery:function(a){return this.getLinkDataByQuery(a)},getRichTextChildCompProps:function(a,b,c){var d=this.getChildCompProps(a,b);return d.getDataByQuery=c||this.getDataByQuery,d.style=d.style||{},d.style.whiteSpace=this.getCompProp("noWrap")?"nowrap":"normal",this.state.showToolTip&&(d.title=(this.getCompProp("prefix")||""+this.proxyData+this.getCompProp("postfix")||"").replace(/\s+/gim," ").replace(/^\s*/,"").replace(/\s*$/,"")),d},getStyle:function(a){return e.styleToFontClass(a)}}}),define("wixappsCore/util/textClipper",["lodash","utils"],function(a,b){"use strict";function e(b){return a.reduce(d,function(a,b){return a.replace(b,"*")},b).length}function f(a,b){for(var c=new RegExp("("+d.join("|")+")"),e="",f=0;b>f&&a.length>0;){var g=c.exec(a),h=g?g.index:a.length,i=a.substr(0,h);i=i.substr(0,b-f),f+=i.length,b>f&&g&&(i+=g[0],f+=1),a=a.substr(i.length),e+=i}return e}function g(a){return a.replace(new RegExp("(\\s|&nbsp;)+$"),"")}function h(a,b){var d=[],h=[],i=!1,j=0;return c(a,{start:function(a,b,c,e){i||(d.push(e),c||h.push("</"+a+">"))},chars:function(a){if(!i){var c=e(a);if(b>=j+c)j+=c,d.push(a);else{i=!0;var k=f(a,b-j);for(d.push(g(k)),d.push("...");h.length>0;)d.push(h.pop())}}},end:function(){i||d.push(h.pop())}}),d.join("")}var c=b.htmlParser,d=["&nbsp;","&lt;","&gt;","&amp;","&cent;","&pound;","&yen;","&euro;","&copy;","&reg;"];return{clipText:h}}),define("wixappsCore/proxies/clippedParagraphProxy",["lodash","core","wixappsCore/proxies/mixins/textProxy","wixappsCore/core/typesConverter","wixappsCore/util/textClipper","fonts"],function(a,b,c,d,e,f){"use strict";function h(b){var c=parseFloat(b);return isNaN(c)&&a.includes(["normal","initial","inherit"],b)&&(c=1.2),c}function i(a){var b=this.getCompProp("minLines")||this.getCompProp("singleLine")&&1;if(!b)return 0;var c=f.fontUtils.getFontClassName(a),d=this.props.viewProps.siteData.getFont(c),e=f.fontUtils.parseFontStr(d),g=1.25;return this.getCompProp("line-height")&&(g=h(this.getCompProp("line-height"))),parseInt(e.size,10)*g*b}var g=b.compFactory;return{mixins:[c],renderProxy:function(){var a=this.proxyData,b=this.createFormattedText(a),c=i.call(this,b),f=function(a){return a[""].style=a[""].style||{},a[""].style.overflow="hidden",c&&(a[""].style["min-height"]=c),a},h="wysiwyg.viewer.components.WRichText",j=this.getRichTextChildCompProps(h,f),k=this.getCompProp("max-chars")||150;return b=e.clipText(b,k),j.compData=d.richText(b),g.getCompClass(h)(j)}}}),define("wixappsCore/proxies/comboBoxProxy",["lodash","core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/inputProxy","wixappsCore/util/localizer"],function(a,b,c,d,e){ "use strict";var f=b.compFactory;return{mixins:[d],renderProxy:function(){var b=this.proxyData,d=this,g="wysiwyg.viewer.components.inputs.ComboBoxInput",h=this.getChildCompProps(g),i=this.getCompProp("hasPrompt")&&!a.some(b.items,{value:b.selectedValue})?this.getCompProp("promptText"):null;return h.compData=c.selectableList(b,i),a.forEach(h.compData.items,function(a){a.text=e.localize(a.text,this.props.viewProps.getLocalizationBundle()),a.description=e.localize(a.description,this.props.viewProps.getLocalizationBundle())},this),h.onSelectionChange=function(a,c){a.payload.listData=b;var e=a.payload.value||b.items[0].value;d.setData(e,"selectedValue"),d.handleViewEvent(a,c)},h.errorMessage=!b.valid,f.getCompClass(g)(h)}}}),define("wixappsCore/proxies/cssProxy",["lodash","react","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c){"use strict";return{mixins:[c],renderProxy:function(){var c=this.getCompProp("items"),d=a.map(c,function(a,b){return this.renderChildProxy(a,b)},this),e=this.getChildCompProps();return b.DOM.div(e,d)}}}),define("wixappsCore/proxies/dateProxy",["core","wixappsCore/proxies/mixins/textProxy","wixappsCore/core/typesConverter"],function(a,b,c){"use strict";var d=a.compFactory,e="wysiwyg.viewer.components.WRichText",f=function(){var a=/d{1,5}|m{1,5}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[\-+]\d{4})?)\b/g,c=/[^-+\dA-Z]/g,d=function(a,b){for(a=String(a),b=b||2;a.length<b;)a="0"+a;return a};return function(e,g,h){var i=f;if(1!==arguments.length||"[object String]"!==Object.prototype.toString.call(e)||/\d/.test(e)||(g=e,e=void 0),e=e?new Date(e):new Date,isNaN(e))throw"invalid date";g=String(i.masks[g]||g||i.masks["default"]),"UTC:"===g.slice(0,4)&&(g=g.slice(4),h=!0);var j=h?"getUTC":"get",k=e[j+"Date"](),l=e[j+"Day"](),m=e[j+"Month"](),n=e[j+"FullYear"](),o=e[j+"Hours"](),p=e[j+"Minutes"](),q=e[j+"Seconds"](),r=e[j+"Milliseconds"](),s=h?0:e.getTimezoneOffset(),t={d:k,dd:d(k),ddd:i.i18n.dayNames[l],dddd:i.i18n.dayNames[l+7],ddddd:i.i18n.dayNames[l].toUpperCase(),m:m+1,mm:d(m+1),mmm:i.i18n.monthNames[m],mmmm:i.i18n.monthNames[m+12],mmmmm:i.i18n.monthNames[m].toUpperCase(),yy:String(n).slice(2),yyyy:n,h:o%12||12,hh:d(o%12||12),H:o,HH:d(o),M:p,MM:d(p),s:q,ss:d(q),l:d(r,3),L:d(r>99?Math.round(r/10):r),t:12>o?"a":"p",tt:12>o?"am":"pm",T:12>o?"A":"P",TT:12>o?"AM":"PM",Z:h?"UTC":(String(e).match(b)||[""]).pop().replace(c,""),o:(s>0?"-":"+")+d(100*Math.floor(Math.abs(s)/60)+Math.abs(s)%60,4),S:["th","st","nd","rd"][k%10>3?0:(k%100-k%10!==10)*k%10]};return g.replace(a,function(a){return a in t?t[a]:a.slice(1,a.length-1)})}}();return f.masks={"default":"mmmm dd, yyyy",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",eUshortDate:"d/m/yy",eUshortDate2:"d.m.yy"},f.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},{mixins:[b],statics:{componentType:e,format:{type:"compProp",defaultValue:"mmmm dd, yyyy"}},getFormattedDateString:function(a){var b=this.getCompProp("format")||this.constructor.format.defaultValue,c=a.iso||a,d=new Date(c);return d.getTime()>=0?f(d,b):""},renderProxy:function(){var a=this.proxyData,b=this.createFormattedText(this.getFormattedDateString(a)),f=this.getRichTextChildCompProps(e);return f.compData=c.richText(b),d.getCompClass(e)(f)}}}),define("wixappsCore/proxies/erasableTextInputProxy",["core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/inputProxy"],function(a,b,c){"use strict";var d=a.compFactory;return{mixins:[c],renderProxy:function(){var a=this.proxyData,c="wixapps.integration.components.inputs.ErasableTextInput",e=this.getChildCompProps(c);e.compData=b.text(a),e.compProp={label:this.getCompProp("label"),placeholder:this.getCompProp("placeholder")},e.message=this.getCompProp("message"),e.isValid=this.getCompProp("isValid");var f=this;return e.onChange=function(a,b){f.setData(a.target.value),a.type="inputChanged",f.handleViewEvent(a,b)},e.onErase=function(){f.setData("")},d.getCompClass(c)(e)}}}),define("wixappsCore/proxies/fixedRatioProxy",["react","wixappsCore/proxies/mixins/baseCompositeProxy","wixappsCore/proxies/mixins/boxProxy","lodash"],function(a,b,c,d){"use strict";function e(a,b){var c=function(b){return a[b]&&!(d.isString(a[b])&&"%"===a[b].slice(-1))},e={};if(c("width"))e.width=parseInt(a.width,10),e.height=Math.floor(e.width/b);else if(c("height"))e.height=parseInt(a.height,10),e.width=Math.floor(e.height*b);else{if(!c("box-flex"))throw new Error("FixedRatioProxy's child proxy does not receive legal layout properties");e.position="absolute",e.height="100%",e.width="100%",e.top="0px",e.left="0px"}return e}function f(b,c){var d={1:"data:image/gif;base64,R0lGODlhAQABAIAAAP7//wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",1.77:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAYAAAA7KqwyAAAAE0lEQVR42mP4TyFgGDVg1AAgAAC2ij3fb7PW1wAAAABJRU5ErkJggg=="},e={position:"relative",top:"0px",bottom:"0px",left:"0px",right:"0px",visibility:"hidden"};if("vertical"===b?e["min-width"]="100%":e["min-height"]="100%",!d[c])throw"This ratio is not supported by the current map: "+c;return a.DOM.img({src:d[c],style:e})}function g(a){var b={vertical:{width:"100%","min-width":"100%",position:"relative"},horizontal:{height:"100%","min-height":"100%",position:"relative"}};return b[a]}return{mixins:[b],renderProxy:function(){var b=this.getCompProp("items"),c=parseFloat(this.getCompProp("aspectRatio"));if(1!==b.length)throw new Error("FixedRatioProxy can only contain one child");if(!c)throw new Error("FixedRatioProxy did not receive any aspect ratio");var h=b[0],i=this.getStyleDef(h);if(h.layout&&!h.layout["box-flex"])return d.merge(i,e(i,c)),this.renderChildProxy(h,0,i);var j=f(this.props.orientation,c),k=g(this.props.orientation);return a.DOM.div({style:d.merge(k,i)},j,this.renderChildProxy(h,0,e(i,c)))}}}),define("wixappsCore/proxies/mixins/templateBasedChildrenProxy",["lodash"],function(a){"use strict";function b(b,c){return c?"first"===b&&a.has(c,"first")?c.first:"last"===b&&a.has(c,"last")?c.last:c.item:{}}function c(a,b){return 0===a?"first":a===b-1?"last":"middle"}return{getChildTemplateDefinition:function(a,d){var e=this.getCompProp("templates"),f=c(a,d);return b(f,e)}}}),define("wixappsCore/proxies/galleryProxy",["lodash","react","core","wixappsCore/core/proxyFactory","wixappsCore/proxies/mixins/templateBasedChildrenProxy","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c,d,e,f){"use strict";function h(a){return a[""]["data-proxy-name"]="GalleryProxy",a[""]["data-total-columns"]=this.getCompProp("columns"),a[""]["data-total-rows"]=this.getCompProp("rows"),a[""]["data-gap"]=this.getCompProp("gap"),a.itemsContainer.style.width=isNaN(a.itemsContainer.style.width)?"100%":a.itemsContainer.style.width,a.itemsContainer.style.height=isNaN(a.itemsContainer.style.height)?"100%":a.itemsContainer.style.height,a}function i(b,c){if(!a.isEqual(b.compData,c.compData))return!1;var d=["numCols","maxRows","margin"];return a.isEqual(a.pick(b.compProp,d),a.pick(c.compProp,d))}var g=c.compFactory;return{mixins:[f,e],createGalleryItem:function(b,c,d,e,f,g,h){var i=this.getCompProp("columns"),j=this.getCompProp("rows"),k=this.getCompProp("gap")||0,l={position:"absolute",width:"calc((100% - "+(i-1)*k+"px) / "+i+")",height:"calc((100% - "+(j-1)*k+"px) / "+j+")"};g&&(l=a.merge(l,g));var m={getComponentScopedClass:function(a){var b={};return b[a]=!0,h(b)}},n=this.getChildTemplateDefinition(d,f),o=this.getViewDefProp("data")||"this",p=a.indexOf(this.proxyData,c),q=this.getItemRef(b,e,d),r=this.getChildProxyProps(n,[o,p],{functionLibrary:m}),s={className:h({galleryDisplayer:!0}),"data-index":d};return r=a.assign(r,s),this.renderChildProxy(n,q,l,r)},getItemRef:function(a,b,c){return a+b+"#"+c},registerComponentReLayout:function(){this.refs.component.registerReLayout()},renderProxy:function(){var a="wysiwyg.viewer.components.PaginatedGridGallery",b=this.getChildCompProps(a,h.bind(this));b.createGalleryItem=this.createGalleryItem,b.onAnimationCompleteCallback=this.registerComponentReLayout,b.getItemRef=this.getItemRef,b.compData={items:this.proxyData},b.compProp={transition:this.getCompProp("transition"),autoplayInterval:this.getCompProp("autoplayInterval"),transDuration:this.getCompProp("transDuration")||1,numCols:this.getCompProp("columns"),maxRows:this.getCompProp("rows"),margin:this.getCompProp("gap"),autoplay:this.getCompProp("autoplay"),expandEnabled:this.getCompProp("expandEnabled"),showAutoplay:this.getCompProp("showAutoplay"),showNavigation:this.getCompProp("showNavigation")!==!1,showCounter:this.getCompProp("showCounter")!==!1},b.style.position="relative",b.key=this.getViewDefProp("id")+"_"+this.getCompProp("rows")+"_"+this.getCompProp("columns");var c=this.props.viewProps.siteData.measureMap;return c&&c.height[b.id]&&this.refs.component&&i(b,this.refs.component.props)&&(b.style.width=c.width[b.id],b.style.height=c.height[b.id]),g.getCompClass(a)(b)}}}),define("wixappsCore/proxies/hBoxProxy",["react","wixappsCore/proxies/mixins/boxProxy"],function(a,b){"use strict";return{mixins:[b],getChildrenOrientation:function(){return"horizontal"},getReactClass:function(){return a.DOM.div}}}),define("wixappsCore/proxies/horizontalLineProxy",["core","wixappsCore/proxies/mixins/baseProxy","lodash"],function(a,b,c){"use strict";function f(a){return a[""]=c.merge({},a[""],{style:{position:"relative"}}),a}var d=a.compFactory,e="wysiwyg.viewer.components.FiveGridLine";return{mixins:[b],statics:{componentType:e},renderProxy:function(){var a=this.getChildCompProps(e,f);return d.getCompClass(e)(a)}}}),define("wixappsCore/proxies/iconProxy",["core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseProxy"],function(a,b,c){"use strict";var d=a.compFactory;return{mixins:[c],renderProxy:function(){var a=this.proxyData,c="wixapps.integration.components.Icon",e=this.getChildCompProps(c);return e.compData=b.icon(a,this.props.viewProps.resolveImageData,this.props.viewProps.siteData.serviceTopology,this.props.viewProps.packageName),d.getCompClass(c)(e)}}}),define("wixappsCore/proxies/imageButtonProxy",["core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseProxy"],function(a,b,c){"use strict";var d=a.compFactory;return{mixins:[c],renderProxy:function(){var a=this.proxyData,c="wixapps.integration.components.ImageButton",e=this.getChildCompProps(c);return e.compData=b.icon(a,this.props.viewProps.resolveImageData,this.props.viewProps.siteData.serviceTopology,this.props.viewProps.packageName),e.compProp={isSprite:this.getCompProp("isSprite"),spriteDirection:this.getCompProp("spriteDirection"),startPositionX:this.getCompProp("startPositionX"),startPositionY:this.getCompProp("startPositionY")},d.getCompClass(c)(e)}}}),define("wixappsCore/proxies/mixins/baseImageProxy",["lodash","core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseProxy","react"],function(a,b,c,d,e){"use strict";function i(b,c){var d=a.pick(c,["width","height"]);return"fitWidth"===b&&a.isNumber(c.width)?d:"fitHeight"===b&&a.isNumber(c.height)?d:a.isNumber(c.height)&&a.isNumber(c.width)?d:{width:16,height:16}}var f=b.compFactory,g={fitWidth:"fitWidthStrict",fitHeight:"fitHeightStrict"},h="wysiwyg.viewer.components.WPhoto";return{mixins:[d],statics:{componentType:h},getCustomStyle:function(){return{position:"relative"}},renderProxy:function(){var a=this.getCompProp("imageMode")||"fill",b=this.getCompData(),c=this.getChildCompProps(h);c.compData=b;var d=g[a]||a;c.compProp={displayMode:d},this.getCompProp("showZoom")&&(c.compProp.onClickBehavior="zoomAndPanMode");var j={"data-proxy-name":"Image","data-width":b.width,"data-height":b.height,"data-uri":b.uri,"data-display-mode":d,id:c.id+"_container",style:c.style,ref:"container"};return c.style=i(d,c.style),e.DOM.div(j,f.getCompClass(h)(c))}}}),define("wixappsCore/proxies/imageProxy",["wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseImageProxy"],function(a,b){"use strict";return{mixins:[b],getCompData:function(){return a.image(this.proxyData,this.props.viewProps.resolveImageData,this.props.viewProps.siteData.serviceTopology,this.props.viewProps.packageName)}}}),define("wixappsCore/proxies/inlineSpacerProxy",["react","wixappsCore/proxies/mixins/baseProxy"],function(a,b){"use strict";return{mixins:[b],getCustomStyle:function(){var a=this.getCompProp("size");return{wordSpacing:a,display:"inline"}},renderProxy:function(){var b=this.getChildCompProps();return a.DOM.div(b," ")}}}),define("wixappsCore/proxies/inlineTextProxy",["core","wixappsCore/proxies/mixins/textProxy","wixappsCore/core/typesConverter","react"],function(a,b,c,d){"use strict";function f(a){return a[""].parentConst=d.DOM.span,a}var e=a.compFactory;return{mixins:[b],renderProxy:function(){var a=this.proxyData,b=this.createFormattedText(a,"span"),d="wysiwyg.viewer.components.WRichText",g=this.getRichTextChildCompProps(d,f);return g.compData=c.richText(b),e.getCompClass(d)(g)}}}),define("wixappsCore/proxies/labelProxy",["core","wixappsCore/proxies/mixins/textProxy","wixappsCore/core/typesConverter"],function(a,b,c){"use strict";var d=a.compFactory,e="wysiwyg.viewer.components.WRichText";return{mixins:[b],statics:{componentType:e},renderProxy:function(){var a=this.proxyData,b=this.createFormattedText(a),f=this.getRichTextChildCompProps(e);return f.compData=c.richText(b),d.getCompClass(e)(f)}}}),define("wixappsCore/proxies/linkProxy",["react","utils","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/boxProxy"],function(a,b,c,d){"use strict";return{mixins:[d],getChildrenOrientation:function(){return this.getCompProp("orientation")||"vertical"},getReactClass:function(){return a.DOM.a},getCustomProps:function(){var a=c.link(this.proxyData),d=b.linkRenderer.renderLink(a,this.props.viewProps.siteData);return d.className="wixAppsLink",d}}}),define("wixappsCore/proxies/listProxy",["react","lodash","core","wixappsCore/core/proxyFactory","wixappsCore/proxies/mixins/templateBasedChildrenProxy","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c,d,e,f){"use strict";var g=c.compFactory;return{mixins:[f,e],getDefaultProps:function(){return{}},getInitialState:function(){return{currentPage:1}},prevPageClicked:function(){var a=this.proxyData.length,b=this.getCompProp("itemsPerPage"),c=Math.ceil(a/b),d={currentPage:this.state.currentPage};1===this.state.currentPage?d.currentPage=c:d.currentPage-=1,this.setState(d),this.props.viewProps.siteAPI.registerReLayoutPending()},nextPageClicked:function(){var a=this.proxyData.length,b=this.getCompProp("itemsPerPage"),c=Math.ceil(a/b),d={currentPage:this.state.currentPage};this.state.currentPage===c?d.currentPage=1:d.currentPage+=1,this.setState(d),this.props.viewProps.siteAPI.registerReLayoutPending()},renderProxy:function(){var e,a=this.proxyData,c=a.length,d=this.getCompProp("templates")?this.getCompProp("templates.vars"):{},f=this.getCompProp("hidePagination");f||(e=this.getCompProp("itemsPerPage"));var h=0,i=c,j=1,k=this.state.currentPage;b.isUndefined(e)||(h=(k-1)*e,i=Math.min(h+e,c),j=Math.ceil(c/e));var l=a.slice(h,i),m=l.length,n=b.map(l,function(a,c){var e="middle";0===c&&m>1?e="first":c===m-1&&(e="last");var f={indexInParent:c,indexOneInParent:c+1,positionInParent:e,isOddIndexInParent:c%2===1,currentPage:k,maxPage:j,hasNext:k!==j,hasPrev:1!==k,hidePagination:this.getCompProp("hidePagination")};f=b.merge({},d,f);var g={prevPageClicked:this.prevPageClicked,nextPageClicked:this.nextPageClicked},i=this.getViewDefProp("data")||"this",l=this.getChildTemplateDefinition(c,m),n={vars:{proxy:f},events:g},o=h+c,p=this.getChildProxyProps(l,[i,o],n);return p["data-isfirst"]=0===c,p["data-iseven"]=c%2===1,p["data-islast"]=c===m-1,p.proxyParentId=this.props.viewDef.id+"_"+o,this.renderChildProxy(l,o,this.props.childAdditionalStyle,p)},this),o=this.getChildCompProps("wysiwyg.viewer.components.VerticalRepeater");return o.style=b.merge(o.style,this.props.additionalStyle),g.getCompClass("wysiwyg.viewer.components.VerticalRepeater")(o,n)}}}),define("wixappsCore/proxies/mediaLabelProxy",["lodash","core","wixappsCore/proxies/mixins/textProxy","wixappsCore/core/typesConverter"],function(a,b,c,d){"use strict";function f(b){return b[""]=a.merge({},b[""],{"data-proxy-name":"MediaLabel"}),b}function g(a){var b=a.viewDef.data||"this";return this.props.viewProps.getNormalizedDataPath(this.contextPath,b)}var e=b.compFactory;return{mixins:[c],shouldComponentUpdate:function(b){var c=a.includes(this.props.viewProps.siteData.componentsToRender,this.props.viewProps.compId),d=g.call(this,b),e=d&&!a.isEqual(this.fullDataPath,d);return c||e||!(!this.isViewDefCompChangedInNextProps||!this.isViewDefCompChangedInNextProps(b))},getMediaDataByQuery:function(a){var b=this.proxyData.refMap[a];if(b){if("wix:Image"===b._type)return d.image(b,this.props.viewProps.resolveImageData,this.props.viewProps.siteData.serviceTopology,this.props.viewProps.packageName);if("wix:Video"===b._type)return d.video(b)}return null},getDataOrMediaByQuery:function(a){return this.getDataByQuery(a)||this.getMediaDataByQuery(a)},renderProxy:function(){var a=this.proxyData;this.fullDataPath=g.call(this,this.props);var b=this.createFormattedText(a),c="wysiwyg.viewer.components.MediaRichText",h=this.getRichTextChildCompProps(c,f,this.getDataOrMediaByQuery);return h.compData=d.richText(b),e.getCompClass(c)(h)}}}),define("wixappsCore/proxies/paginatedColumnGalleryProxy",["lodash","core","react","utils","wixappsCore/core/proxyFactory","wixappsCore/proxies/mixins/templateBasedChildrenProxy","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c,d,e,f,g){"use strict";var h=b.componentUtils.galleryPagingCalculations;return{mixins:[g,f],componentWillUpdate:function(a){var b=Math.ceil(this.proxyData.length/this.getItemsNumberPerPage(a)),c=this.getVar("maxPage");b!==c&&this.setVar("maxPage",b,!0)},componentWillMount:function(){var a=Math.ceil(this.proxyData.length/this.getItemsNumberPerPage(this.props));this.setVar("maxPage",a,!0)},getItemsNumberPerPage:function(b){var c=parseInt(this.getCompProp("itemsPerPage",b.viewDef),10);return(a.isNaN(c)||!a.isNaN(c)&&c>=this.proxyData.length)&&(c=this.proxyData.length),c},createChildProxy:function(b,e,f){var g=this.getViewDefProp("data")||"this",h=this.getChildTemplateDefinition(b,e),i=this.getChildProxyProps(h,[g,b],{});return c.DOM.div({key:b,style:a.assign({display:"inline-block",verticalAlign:"top",width:100/f+"%"},d.style.prefix({boxSizing:"border-box"}))},this.renderChildProxy(h,b,null,i))},getCurrentPositionInData:function(a,b){return a===this.proxyData.length?0:b*a},getCurrentPage:function(){var a=this.getVar("currentPage")||1;return a=parseInt(a,10)-1},renderProxy:function(){for(var a=this.getItemsNumberPerPage(this.props),b=this.getCurrentPage(),d=this.getCurrentPositionInData(a,b),e=this.getCompProp("columns")||3,f=[],g=h.getLastItemIndex(this.proxyData,d,a),i=d;g>=i;i++)f.push(this.createChildProxy(i,a,e));var j=this.getChildCompProps();return j["data-proxy-name"]="PaginatedColumnGalleryProxy",j["data-direction"]=this.getVar("partDirection")||"ltr",j["data-horizontal-gap"]=this.getCompProp("horizontalGap")||0,j["data-vertical-gap"]=this.getCompProp("verticalGap")||0,j["data-columns"]=e,c.DOM.div(j,f)}}}),define("wixappsCore/proxies/sliderGalleryProxy",["lodash","react","core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseProxy"],function(a,b,c,d,e){"use strict";function g(){return{showAutoplay:this.getCompProp("showAutoplay")||!1,loop:this.getCompProp("loop")||!1,showCounter:this.getCompProp("showCounter")||!1,expandEnabled:this.getCompProp("expandEnabled")||!1,galleryImageOnClickAction:this.getCompProp("galleryImageOnClickAction"),imageMode:this.getCompProp("imageMode"),maxSpeed:this.getCompProp("maxSpeed")||5,margin:this.getCompProp("margin"),aspectRatio:1.333}}function h(){var b=a.map(this.proxyData,function(b){var c=a.clone(b);return this.props.viewProps.resolveImageData(c,this.props.viewProps.siteData.serviceTopology,this.props.viewProps.packageName)},this);return{items:b}}var f=c.compFactory;return{mixins:[e],useSkinInsteadOfStyles:!0,renderProxy:function(){var c="wysiwyg.viewer.components.SliderGallery",e=h.call(this),i=g.call(this),j=a.merge(this.getChildCompProps(c),{compData:d.imageList(e,this.props.viewProps.resolveImageData,this.props.viewProps.siteData.serviceTopology),compProp:i,onImageSelected:this.handleViewEvent,structure:this.props.structure}),k={"data-proxy-name":"SliderGallery","data-aspect-ratio":i.aspectRatio,"data-image-mode":i.imageMode,id:j.id+"_container",style:j.style,ref:"container"};return b.DOM.div(k,f.getCompClass(c)(j))}}}),define("wixappsCore/proxies/stackProxy",["lodash","react","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c){"use strict";return{mixins:[c],getCustomStyle:function(){return{position:"relative"}},renderProxy:function(){var c=this.getCompProp("items"),d=a.map(c,function(a,b){var c=this.getCompProp("layout",a),d=0===b&&"layout"!==this.getCompProp("stackType")?"static":"absolute",e={position:d,top:c.top||"0px",left:c.left||"0px"};return this.renderChildProxy(a,b,e)},this),e=this.getChildCompProps();return e["data-proxy-name"]="Stack",b.DOM.div(e,d)}}}),define("wixappsCore/proxies/switchBoxProxy",["lodash","wixappsCore/core/proxyFactory","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c){"use strict";return{mixins:[c],renderProxy:function(){var b=this.getCompProp("cases"),c=a.has(b,this.proxyData)?this.proxyData:"default",d=b[c];if(!d||0===d.length)return null;var e=this.getCompProp("orientation")||"vertical",f=a.cloneDeep(a.omit(this.props.viewDef,["comp.cases"]));return delete f.data,delete f.name,delete f.forType,delete f.comp.cases,f.id=f.id+"_"+c,f.comp.name="vertical"===e?"VBox":"HBox",f.comp.items=d,this.renderChildProxy(f,f.id,this.getProxyStyle())}}}),define("wixappsCore/proxies/textAreaProxy",["core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/inputProxy"],function(a,b,c){"use strict";var d=a.compFactory;return{mixins:[c],renderProxy:function(){var a="wixapps.integration.components.inputs.TextArea",c=this.getChildCompProps(a),e=this.proxyData,f=void 0!==e.valid?e.valid:!0;return c.compData=b.text(this.state.text),c.compProp={placeholder:this.getCompProp("placeholder"),label:this.getCompProp("label"),message:this.getCompProp("message")||!f,maxLength:this.getCompProp("maxLength"),isPreset:this.getCompProp("isPreset"),onChange:this.updateText,onBlur:this.onBlur},d.getCompClass(a)(c)},getInitialState:function(){var a=this.proxyData,b=void 0!==a.text?a.text:a;return{text:b}},updateText:function(a){var b=a.target.value;this.setState({text:b})},onBlur:function(a,b){var c=a.target.value;a.type="inputChanged",a.payload={value:c};var d=void 0!==this.proxyData.text?"text":"this";this.setData(c,d),this.handleViewEvent(a,b)}}}),define("wixappsCore/proxies/textInputProxy",["core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/inputProxy"],function(a,b,c){"use strict";var d=a.compFactory;return{mixins:[c],renderProxy:function(){var a=this.proxyData,c="wixapps.integration.components.inputs.TextInput",e=this.getChildCompProps(c);e.compData=b.text(a),e.compProp={label:this.getCompProp("label"),placeholder:this.getCompProp("placeholder")},e.message=this.getCompProp("message"),e.isValid=this.getCompProp("isValid");var f=this;return e.onChange=function(a,b){f.setData(a.target.value),a.type="inputChanged",f.handleViewEvent(a,b)},d.getCompClass(c)(e)}}}),define("wixappsCore/proxies/toggleProxy",["react","core","wixappsCore/core/proxyFactory","wixappsCore/proxies/mixins/baseCompositeProxy"],function(a,b,c,d){"use strict";function f(){var a=this.getCompProp("templates"),b=this.renderChildProxy(a.on,"on"),c=this.renderChildProxy(a.off,"off");return[b,c]}var e=b.compFactory;return{mixins:[d],renderProxy:function(){var a=f.call(this),b="wixapps.integration.components.Toggle",c=this.getChildCompProps(b);return c.initialState=this.getCompProp("initialState")||"off",e.getCompClass(b)(c,a)}}}),define("wixappsCore/proxies/vBoxProxy",["react","wixappsCore/proxies/mixins/boxProxy"],function(a,b){"use strict";return{mixins:[b],getChildrenOrientation:function(){return"vertical"},getReactClass:function(){return a.DOM.div}}}),define("wixappsCore/proxies/flowListProxy",["wixappsCore/proxies/listProxy"],function(a){"use strict";return{mixins:[a],getDefaultProps:function(){return{additionalStyle:{display:"block",whiteSpace:"normal"},childAdditionalStyle:{display:"inline-block",width:"auto"}}}}}),define("wixappsCore/proxies/videoProxy",["core","wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseProxy"],function(a,b,c){"use strict";var d=a.compFactory,e="wysiwyg.viewer.components.Video";return{mixins:[c],statics:{componentType:e},renderProxy:function(){var a=this.proxyData,c=this.getChildCompProps(e);return c.compData=b.video(a),c.compProp={showControls:this.getCompProp("showControls"),autoplay:this.getCompProp("autoplay"),loop:this.getCompProp("loop"),showinfo:this.getCompProp("showinfo"),lightTheme:this.getCompProp("lightTheme")},d.getCompClass(e)(c)}}}),define("wixappsCore/proxies/videoThumbProxy",["wixappsCore/core/typesConverter","wixappsCore/proxies/mixins/baseImageProxy"],function(a,b){"use strict";return{mixins:[b],getProxyCustomCssClass:function(){return this.props.viewProps.classSet({videoIndicator:!0})},getCompData:function(){return a.videoThumb(this.proxyData,this.props.viewProps.resolveImageData,this.props.viewProps.siteData.serviceTopology)}}}),define("wixappsCore/core/stylesheetRenderer",["lodash"],function(a){"use strict";function b(a){return/^#/.test(a)?a:"#"+a}function c(b){var c=a.map(b,function(a,b){return b+":"+a});return"{"+c.join(";")+"}"}function d(b,d,e){var f=b+" "+d+" ",g=[];return a.forOwn(e,function(b,d){a.forEach(d.split(/\s*,\s*/),function(a){var d=f+a+c(b);g.push(d)})}),g}function e(c,e,f){if(e=b(e),f=b(f),a.isEmpty(c))return null;if(!a.isArray(c))throw"stylesheetRenderer:: stylesheet definition must be an array";return a.flattenDeep(a.map(c,d.bind(null,e,f))).join("")}return{render:e}}),define("wixappsCore/util/wrappedProxyStyles",["lodash"],function(a){"use strict";function c(c){return a.some(b,function(b){return a.includes(c,b)})}var b=["padding","margin","border","top","left","right","bottom","visibility"];return{getWrapperCssClass:function(b){var c=a.some(b,function(b,c){return a.includes(c,"flex")});return c?"flex_display":""},getProxyStyles:function(b){return a.mapValues(b,function(a,b){return c(b)?null:a})}}}),define("wixappsCore/proxies/viewProxy",["lodash","react","wixappsCore/util/viewsUtils","wixappsCore/core/proxyFactory","wixappsCore/proxies/mixins/baseProxy","wixappsCore/proxies/mixins/baseCompositeProxy","wixappsCore/core/stylesheetRenderer","wixappsCore/util/typeNameResolver","wixappsCore/core/wixappsPlugins","wixappsCore/util/wrappedProxyStyles"],function(a,b,c,d,e,f,g,h,i,j){"use strict";function k(a,b,d){var e=this.getChildProxyProps(a);return e.viewDef=a,e.viewName=b,e.forType=d,e.viewId=c.sanitizeCompId(b+"_"+d+"_"+this.props.formatName),e.viewContainerId=c.sanitizeCompId(e.viewId+"_"+this.contextPath),e.parentContextPath=this.innerContextPath,e}function l(a,c,d){var e=g.render(a,c,d);return b.DOM.style({type:"text/css",key:c+"."+d,dangerouslySetInnerHTML:{__html:e||""}})}function n(b,c,d){var e=this.getChildCompProps();return e.id=b.viewContainerId,e.ref="viewWrapper",e.style=a.merge({},c,d),e.className+=" "+j.getWrapperCssClass(e.style),e}var m=b.createClass({displayName:"WixappsStyleSheet",mixins:[e],renderProxy:function(){return l(this.getViewDefProp("stylesheet"),this.props.viewProps.compId,this.props.viewContainerId)}});return{mixins:[f],renderProxy:function(){var c=this.getCompProp("name")||this.props.viewName,d=this.proxyData,e=h.getDataItemTypeName(d),f=this.props.viewProps.getViewDef(c,e,this.props.formatName);if(!f)throw"ViewProxy:: Cannot find view definition for viewName ["+c+"] typeName ["+e+"] format ["+this.props.formatName+"]";var g=this.getViewDefProp("data")||"this",i=a.merge({},this.getCompProp("vars"),this.getViewDefProp("vars",f));this.innerContextPath&&this.props.viewContextMap.hasContext(this.innerContextPath)||(this.innerContextPath=this.createContext(this.contextPath,[g],{view:i},{},{}));var l=k.call(this,f,c,e),o=this.getProxyStyle(),p=this.getStyleDef(f,this.innerContextPath),q=n.call(this,l,p,o),r=j.getProxyStyles(q.style);a.has(q.style,"height")&&(r.height=r.width="100%");var s=this.renderChildProxy(f,"child",r,l),t=k.call(this,f,c,e);t.key="stylesheet";var u=b.createElement(m,t);return b.DOM.div(q,u,s)}}}),define("wixappsCore/proxies/verticalLineProxy",["core","wixappsCore/proxies/mixins/baseProxy"],function(a,b){"use strict";var c=a.compFactory;return{mixins:[b],renderProxy:function(){var a="wysiwyg.viewer.components.VerticalLine",b=this.getChildCompProps(a);return c.getCompClass(a)(b)}}}),define("wixappsCore/proxies/proxyMap",["wixappsCore/core/proxyFactory","wixappsCore/proxies/zoomLinkProxy","wixappsCore/proxies/appLinkProxy","wixappsCore/proxies/areaProxy","wixappsCore/proxies/buttonProxy","wixappsCore/proxies/button2Proxy","wixappsCore/proxies/clippedParagraphProxy","wixappsCore/proxies/comboBoxProxy","wixappsCore/proxies/cssProxy","wixappsCore/proxies/dateProxy","wixappsCore/proxies/erasableTextInputProxy","wixappsCore/proxies/fixedRatioProxy","wixappsCore/proxies/galleryProxy","wixappsCore/proxies/hBoxProxy","wixappsCore/proxies/horizontalLineProxy","wixappsCore/proxies/iconProxy","wixappsCore/proxies/imageButtonProxy","wixappsCore/proxies/imageProxy","wixappsCore/proxies/inlineSpacerProxy","wixappsCore/proxies/inlineTextProxy","wixappsCore/proxies/labelProxy","wixappsCore/proxies/linkProxy","wixappsCore/proxies/listProxy","wixappsCore/proxies/mediaLabelProxy","wixappsCore/proxies/paginatedColumnGalleryProxy","wixappsCore/proxies/sliderGalleryProxy","wixappsCore/proxies/stackProxy","wixappsCore/proxies/switchBoxProxy","wixappsCore/proxies/textAreaProxy","wixappsCore/proxies/textInputProxy","wixappsCore/proxies/toggleProxy","wixappsCore/proxies/vBoxProxy","wixappsCore/proxies/flowListProxy","wixappsCore/proxies/videoProxy","wixappsCore/proxies/videoThumbProxy","wixappsCore/proxies/viewProxy","wixappsCore/proxies/verticalLineProxy"],function(a,b,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){"use strict";a.register("ZoomLink",b),a.register("AppLink",c),a.register("Area",d),a.register("Container",d),a.register("Button2",f),a.register("Button",e),a.register("ClippedParagraph",g),a.register("ClippedParagraph2",g),a.register("ComboBox",h),a.register("Css",i),a.register("Date",j),a.register("ErasableTextInput",k),a.register("FixedRatioLayout",l),a.register("Gallery",m),a.register("HBox",n),a.register("HorizontalLine",o),a.register("Icon",p),a.register("ImageButton",q),a.register("Image",r),a.register("InlineSpacer",s),a.register("InlineText",t),a.register("Label",u),a.register("Link",v),a.register("MediaLabel",x),a.register("ColumnGallery",y),a.register("PaginatedColumnGallery",y),a.register("SliderGallery",z),a.register("Stack",A),a.register("SwitchBox",B),a.register("TextArea",C),a.register("TextInput",D),a.register("Toggle",E),a.register("VBox",F),a.register("VerticalList",w),a.register("List2",w),a.register("PaginatedList",w),a.register("FlowList",G),a.register("Video",H),a.register("VideoThumb",I),a.register("View",J),a.register("VerticalLine",K)}),define("wixappsCore/core/wixappsDataAspect",["lodash","core","wixappsCore/core/wixappsDataHandler"],function(a,b,c){ "use strict";function e(a){this.aspectSiteApi=a}var d=b.siteAspectsRegistry;e.prototype={getDescriptor:function(a){return c.getDescriptor(this.aspectSiteApi.getSiteData(),a)},getDataByCompId:function(a,b){return c.getDataByCompId(this.aspectSiteApi.getSiteData(),a,b)},getExtraDataByCompId:function(a,b){return c.getExtraDataByCompId(this.aspectSiteApi.getSiteData(),a,b)},getDataByPath:function(a,b){return c.getDataByPath(this.aspectSiteApi.getSiteData(),a,b)},setDataByPath:function(a,b,d){c.setDataByPath(this.aspectSiteApi.getSiteData(),a,b,d),this.aspectSiteApi.forceUpdate()},setBatchedData:function(b,d,e){if(0!==d.length){var f=this.aspectSiteApi.getSiteData();a.forEach(d,function(a){c.setDataByPath(f,b,a.path,a.value)}),e||this.aspectSiteApi.forceUpdate()}},getMetadata:function(a,b){return b?c.getCompMetadata(this.aspectSiteApi.getSiteData(),a,b):c.getPackageMetadata(this.aspectSiteApi.getSiteData(),a)},setMetadata:function(a,b,d){c.setPackageMetadata(a,this.aspectSiteApi.getSiteData(),b,d),this.aspectSiteApi.forceUpdate()}},d.registerSiteAspect("wixappsDataAspect",e)}),define("wixappsCore",["wixappsCore/core/viewsRenderer","wixappsCore/core/viewsCustomizer","wixappsCore/core/proxyFactory","wixappsCore/core/logicFactory","wixappsCore/core/styleCollector","wixappsCore/core/styleData","wixappsCore/core/ViewContextMap","wixappsCore/core/wixappsDataHandler","wixappsCore/core/wixappsLogger","wixappsCore/proxies/mixins/baseProxy","wixappsCore/proxies/mixins/inputProxy","wixappsCore/core/typesConverter","wixappsCore/util/videoThumbDataHandler","wixappsCore/proxies/mixins/baseCompositeProxy","wixappsCore/util/spacersCalculator","wixappsCore/core/wixappsConfiguration","wixappsCore/core/linksConverter","wixappsCore/util/localizer","wixappsCore/core/expressions/functionLibrary","wixappsCore/util/viewsUtils","wixappsCore/util/wixappsUrlParser","wixappsCore/util/socialShareHandler","wixappsCore/util/typeNameResolver","wixappsCore/util/styleMapping","wixappsCore/core/expressions/expression","wixappsCore/proxies/proxyMap","wixappsCore/core/wixappsDataAspect"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){"use strict";return{viewsRenderer:a,viewsCustomizer:b,proxyFactory:c,baseProxy:j,inputProxy:k,baseCompositeProxy:n,typesConverter:l,logicFactory:d,ViewContextMap:g,wixappsDataHandler:h,wixappsLogger:i,videoThumbDataHandler:m,styleCollector:e,spacersCalculator:o,wixappsConfiguration:p,linksConverter:q,localizer:r,FunctionLibrary:s,viewsUtils:t,wixappsUrlParser:u,socialShareHandler:v,typeNameResolver:w,styleData:f,convertStringToPrimitive:y.convertStringToPrimitive,styleMapping:x}});
src/universal/components/Toast/Toast.js
ruffers9/django-react-boilerplate
import React, { Component } from 'react'; import './Toast.scss'; class Toast extends Component { state = { toasted: false }; componentWillMount() { setTimeout(() => { this.setState({ toasted: true }); }, 5000); } componentWillReceiveProps(nextProps) { // If the text prop changes then re-render // Or else it will toast every time the props change in any menu item if (nextProps.text != this.props.text) { this.setState({ toasted: false }); setTimeout(() => { this.setState({ toasted: true }); console.log('true'); }, 5000); } } render() { if (!this.state.toasted) { const { color, text } = this.props; return ( <div style={{backgroundColor: color }} className="toast"> <h2 className="toast-text">{text}</h2> </div> ); } return null; } } export default Toast;
src/dataTypes/RegExp.js
mrose/react-dump
import React from 'react'; import { Row, Table } from '../format'; export const RegExp = ( props ) => { const obj = props.obj || null const opts = props.opts || { expand:true , format:'html' , label:'RegExp' } let { label, expand } = opts return ( <Table className='reactdump reactdump-RegExp' label={label} cols='1' expand={expand}> <Row className='reactdump-label reactdump-RegExp' label={label} expand={expand} expandCells={expand}> {obj.toString()} </Row> </Table> ) };
ajax/libs/react-redux/8.0.0-beta.3/react-redux.js
cdnjs/cdnjs
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom')) : typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRedux = {}, global.React, global.ReactDOM)); }(this, (function (exports, React, reactDom) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var React__default = /*#__PURE__*/_interopDefaultLegacy(React); function createCommonjsModule(fn, basedir, module) { return module = { path: basedir, exports: {}, require: function (path, base) { return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); } }, fn(module, module.exports), module.exports; } function commonjsRequire () { throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); } var useSyncExternalStoreWithSelector_development = createCommonjsModule(function (module, exports) { { (function() { /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function' ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } var React = React__default['default']; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ function is(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare ; } var objectIs = typeof Object.is === 'function' ? Object.is : is; var useSyncExternalStore = React.useSyncExternalStore; // for CommonJS interop. var useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments. function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { // Use this to track the rendered snapshot. var instRef = useRef(null); var inst; if (instRef.current === null) { inst = { hasValue: false, value: null }; instRef.current = inst; } else { inst = instRef.current; } var _useMemo = useMemo(function () { // Track the memoized state using closure variables that are local to this // memoized instance of a getSnapshot function. Intentionally not using a // useRef hook, because that state would be shared across all concurrent // copies of the hook/component. var hasMemo = false; var memoizedSnapshot; var memoizedSelection; var memoizedSelector = function (nextSnapshot) { if (!hasMemo) { // The first time the hook is called, there is no memoized result. hasMemo = true; memoizedSnapshot = nextSnapshot; var _nextSelection = selector(nextSnapshot); if (isEqual !== undefined) { // Even if the selector has changed, the currently rendered selection // may be equal to the new selection. We should attempt to reuse the // current value if possible, to preserve downstream memoizations. if (inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, _nextSelection)) { memoizedSelection = currentSelection; return currentSelection; } } } memoizedSelection = _nextSelection; return _nextSelection; } // We may be able to reuse the previous invocation's result. // We may be able to reuse the previous invocation's result. var prevSnapshot = memoizedSnapshot; var prevSelection = memoizedSelection; if (objectIs(prevSnapshot, nextSnapshot)) { // The snapshot is the same as last time. Reuse the previous selection. return prevSelection; } // The snapshot has changed, so we need to compute a new selection. // The snapshot has changed, so we need to compute a new selection. var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data // has changed. If it hasn't, return the previous selection. That signals // to React that the selections are conceptually equal, and we can bail // out of rendering. // If a custom isEqual function is provided, use that to check if the data // has changed. If it hasn't, return the previous selection. That signals // to React that the selections are conceptually equal, and we can bail // out of rendering. if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) { return prevSelection; } memoizedSnapshot = nextSnapshot; memoizedSelection = nextSelection; return nextSelection; }; // Assigning this to a constant so that Flow knows it can't change. // Assigning this to a constant so that Flow knows it can't change. var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot; var getSnapshotWithSelector = function () { return memoizedSelector(getSnapshot()); }; var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () { return memoizedSelector(maybeGetServerSnapshot()); }; return [getSnapshotWithSelector, getServerSnapshotWithSelector]; }, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection = _useMemo[0], getServerSelection = _useMemo[1]; var value = useSyncExternalStore(subscribe, getSelection, getServerSelection); useEffect(function () { inst.hasValue = true; inst.value = value; }, [value]); useDebugValue(value); return value; } exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === 'function' ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); } })(); } }); var withSelector = createCommonjsModule(function (module) { { module.exports = useSyncExternalStoreWithSelector_development; } }); // Default to a dummy "batch" implementation that just runs the callback function defaultNoopBatch(callback) { callback(); } let batch = defaultNoopBatch; // Allow injecting another batching function later const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings const getBatch = () => batch; const ReactReduxContext = /*#__PURE__*/React__default['default'].createContext(null); { ReactReduxContext.displayName = 'ReactRedux'; } /** * A hook to access the value of the `ReactReduxContext`. This is a low-level * hook that you should usually not need to call directly. * * @returns {any} the value of the `ReactReduxContext` * * @example * * import React from 'react' * import { useReduxContext } from 'react-redux' * * export const CounterComponent = () => { * const { store } = useReduxContext() * return <div>{store.getState()}</div> * } */ function useReduxContext() { const contextValue = React.useContext(ReactReduxContext); if (!contextValue) { throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>'); } return contextValue; } const notInitialized = () => { throw new Error('uSES not initialized!'); }; let useSyncExternalStoreWithSelector = notInitialized; const initializeUseSelector = fn => { useSyncExternalStoreWithSelector = fn; }; const refEquality = (a, b) => a === b; /** * Hook factory, which creates a `useSelector` hook bound to a given context. * * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. * @returns {Function} A `useSelector` hook bound to the specified context. */ function createSelectorHook(context = ReactReduxContext) { const useReduxContext$1 = context === ReactReduxContext ? useReduxContext : () => React.useContext(context); return function useSelector(selector, equalityFn = refEquality) { { if (!selector) { throw new Error(`You must pass a selector to useSelector`); } if (typeof selector !== 'function') { throw new Error(`You must pass a function as a selector to useSelector`); } if (typeof equalityFn !== 'function') { throw new Error(`You must pass a function as an equality function to useSelector`); } } const { store, subscription, getServerState } = useReduxContext$1(); const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn); React.useDebugValue(selectedState); return selectedState; }; } /** * A hook to access the redux store's state. This hook takes a selector function * as an argument. The selector is called with the store state. * * This hook takes an optional equality comparison function as the second parameter * that allows you to customize the way the selected state is compared to determine * whether the component needs to be re-rendered. * * @param {Function} selector the selector function * @param {Function=} equalityFn the function that will be used to determine equality * * @returns {any} the selected state * * @example * * import React from 'react' * import { useSelector } from 'react-redux' * * export const CounterComponent = () => { * const counter = useSelector(state => state.counter) * return <div>{counter}</div> * } */ const useSelector = /*#__PURE__*/createSelectorHook(); function _extends() { _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; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var reactIs_development$1 = createCommonjsModule(function (module, exports) { { (function() { // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary // (unstable) APIs that have been removed. Can we remove the symbols? var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } // AsyncMode is deprecated along with isAsyncMode var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } }); var reactIs$1 = createCommonjsModule(function (module) { { module.exports = reactIs_development$1; } }); /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { '$$typeof': true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { '$$typeof': true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS; function getStatics(component) { // React v16.11 and below if (reactIs$1.isMemo(component)) { return MEMO_STATICS; } // React v16.12 and above return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } } return targetComponent; } var hoistNonReactStatics_cjs = hoistNonReactStatics; var reactIs_development = createCommonjsModule(function (module, exports) { { (function() { // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var REACT_ELEMENT_TYPE = 0xeac7; var REACT_PORTAL_TYPE = 0xeaca; var REACT_FRAGMENT_TYPE = 0xeacb; var REACT_STRICT_MODE_TYPE = 0xeacc; var REACT_PROFILER_TYPE = 0xead2; var REACT_PROVIDER_TYPE = 0xeacd; var REACT_CONTEXT_TYPE = 0xeace; var REACT_FORWARD_REF_TYPE = 0xead0; var REACT_SUSPENSE_TYPE = 0xead1; var REACT_SUSPENSE_LIST_TYPE = 0xead8; var REACT_MEMO_TYPE = 0xead3; var REACT_LAZY_TYPE = 0xead4; var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; var REACT_OFFSCREEN_TYPE = 0xeae2; var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; if (typeof Symbol === 'function' && Symbol.for) { var symbolFor = Symbol.for; REACT_ELEMENT_TYPE = symbolFor('react.element'); REACT_PORTAL_TYPE = symbolFor('react.portal'); REACT_FRAGMENT_TYPE = symbolFor('react.fragment'); REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); REACT_PROFILER_TYPE = symbolFor('react.profiler'); REACT_PROVIDER_TYPE = symbolFor('react.provider'); REACT_CONTEXT_TYPE = symbolFor('react.context'); REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); REACT_MEMO_TYPE = symbolFor('react.memo'); REACT_LAZY_TYPE = symbolFor('react.lazy'); symbolFor('react.scope'); REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); symbolFor('react.cache'); } // Filter certain DOM attributes (e.g. src, href) if their values are empty strings. var enableCache = false; // Only used in www builds. var enableScopeAPI = false; // Experimental Create Event Handle API. var REACT_MODULE_REFERENCE = 0; if (typeof Symbol === 'function') { REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); } function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCache ) { return true; } if (typeof type === 'object' && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } return false; } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: case REACT_SUSPENSE_LIST_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var SuspenseList = REACT_SUSPENSE_LIST_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } return false; } function isConcurrentMode(object) { { if (!hasWarnedAboutDeprecatedIsConcurrentMode) { hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } return false; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } function isSuspenseList(object) { return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; } exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.SuspenseList = SuspenseList; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isSuspenseList = isSuspenseList; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } }); var reactIs = createCommonjsModule(function (module) { { module.exports = reactIs_development; } }); /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ } function verify(selector, methodName) { if (!selector) { throw new Error(`Unexpected value for ${methodName} in connect.`); } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) { warning(`The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`); } } } function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) { verify(mapStateToProps, 'mapStateToProps'); verify(mapDispatchToProps, 'mapDispatchToProps'); verify(mergeProps, 'mergeProps'); } const _excluded$1 = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]; function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, { areStatesEqual, areOwnPropsEqual, areStatePropsEqual }) { let hasRunAtLeastOnce = false; let state; let ownProps; let stateProps; let dispatchProps; let mergedProps; function handleFirstCall(firstState, firstOwnProps) { state = firstState; ownProps = firstOwnProps; // @ts-ignore stateProps = mapStateToProps(state, ownProps); // @ts-ignore dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); hasRunAtLeastOnce = true; return mergedProps; } function handleNewPropsAndNewState() { // @ts-ignore stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) // @ts-ignore dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewProps() { if (mapStateToProps.dependsOnOwnProps) // @ts-ignore stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) // @ts-ignore dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewState() { const nextStateProps = mapStateToProps(state, ownProps); const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); // @ts-ignore stateProps = nextStateProps; if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleSubsequentCalls(nextState, nextOwnProps) { const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); const stateChanged = !areStatesEqual(nextState, state); state = nextState; ownProps = nextOwnProps; if (propsChanged && stateChanged) return handleNewPropsAndNewState(); if (propsChanged) return handleNewProps(); if (stateChanged) return handleNewState(); return mergedProps; } return function pureFinalPropsSelector(nextState, nextOwnProps) { return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); }; } // TODO: Add more comments // The selector returned by selectorFactory will memoize its results, // allowing connect's shouldComponentUpdate to return false if final // props have not changed. function finalPropsSelectorFactory(dispatch, _ref) { let { initMapStateToProps, initMapDispatchToProps, initMergeProps } = _ref, options = _objectWithoutPropertiesLoose(_ref, _excluded$1); const mapStateToProps = initMapStateToProps(dispatch, options); const mapDispatchToProps = initMapDispatchToProps(dispatch, options); const mergeProps = initMergeProps(dispatch, options); { verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps); } return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); } function bindActionCreators(actionCreators, dispatch) { const boundActionCreators = {}; for (const key in actionCreators) { const actionCreator = actionCreators[key]; if (typeof actionCreator === 'function') { boundActionCreators[key] = (...args) => dispatch(actionCreator(...args)); } } return boundActionCreators; } /** * @param {any} obj The object to inspect. * @returns {boolean} True if the argument appears to be a plain object. */ function isPlainObject(obj) { if (typeof obj !== 'object' || obj === null) return false; let proto = Object.getPrototypeOf(obj); if (proto === null) return true; let baseProto = proto; while (Object.getPrototypeOf(baseProto) !== null) { baseProto = Object.getPrototypeOf(baseProto); } return proto === baseProto; } function verifyPlainObject(value, displayName, methodName) { if (!isPlainObject(value)) { warning(`${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`); } } function wrapMapToPropsConstant( // * Note: // It seems that the dispatch argument // could be a dispatch function in some cases (ex: whenMapDispatchToPropsIsMissing) // and a state object in some others (ex: whenMapStateToPropsIsMissing) // eslint-disable-next-line no-unused-vars getConstant) { return function initConstantSelector(dispatch) { const constant = getConstant(dispatch); function constantSelector() { return constant; } constantSelector.dependsOnOwnProps = false; return constantSelector; }; } // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine // whether mapToProps needs to be invoked when props have changed. // // A length of one signals that mapToProps does not depend on props from the parent component. // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and // therefore not reporting its length accurately.. // TODO Can this get pulled out so that we can subscribe directly to the store if we don't need ownProps? function getDependsOnOwnProps(mapToProps) { return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; } // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, // this function wraps mapToProps in a proxy function which does several things: // // * Detects whether the mapToProps function being called depends on props, which // is used by selectorFactory to decide if it should reinvoke on props changes. // // * On first call, handles mapToProps if returns another function, and treats that // new function as the true mapToProps for subsequent calls. // // * On first call, verifies the first result is a plain object, in order to warn // the developer that their mapToProps function is not returning a valid result. // function wrapMapToPropsFunc(mapToProps, methodName) { return function initProxySelector(dispatch, { displayName }) { const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, undefined); }; // allow detectFactoryAndVerify to get ownProps proxy.dependsOnOwnProps = true; proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { proxy.mapToProps = mapToProps; proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); let props = proxy(stateOrDispatch, ownProps); if (typeof props === 'function') { proxy.mapToProps = props; proxy.dependsOnOwnProps = getDependsOnOwnProps(props); props = proxy(stateOrDispatch, ownProps); } verifyPlainObject(props, displayName, methodName); return props; }; return proxy; }; } function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined; } function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { return !mapDispatchToProps ? wrapMapToPropsConstant(dispatch => ({ dispatch })) : undefined; } function whenMapDispatchToPropsIsObject(mapDispatchToProps) { return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(dispatch => bindActionCreators(mapDispatchToProps, dispatch)) : undefined; } var defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]; function whenMapStateToPropsIsFunction(mapStateToProps) { return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined; } function whenMapStateToPropsIsMissing(mapStateToProps) { return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : undefined; } var defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]; function defaultMergeProps(stateProps, dispatchProps, ownProps) { return _extends({}, ownProps, stateProps, dispatchProps); } function wrapMergePropsFunc(mergeProps) { return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) { let hasRunOnce = false; let mergedProps; return function mergePropsProxy(stateProps, dispatchProps, ownProps) { const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); if (hasRunOnce) { if (!areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; } else { hasRunOnce = true; mergedProps = nextMergedProps; verifyPlainObject(mergedProps, displayName, 'mergeProps'); } return mergedProps; }; }; } function whenMergePropsIsFunction(mergeProps) { return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined; } function whenMergePropsIsOmitted(mergeProps) { return !mergeProps ? () => defaultMergeProps : undefined; } var defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted]; // well as nesting subscriptions of descendant components, so that we can ensure the // ancestor components re-render before descendants function createListenerCollection() { const batch = getBatch(); let first = null; let last = null; return { clear() { first = null; last = null; }, notify() { batch(() => { let listener = first; while (listener) { listener.callback(); listener = listener.next; } }); }, get() { let listeners = []; let listener = first; while (listener) { listeners.push(listener); listener = listener.next; } return listeners; }, subscribe(callback) { let isSubscribed = true; let listener = last = { callback, next: null, prev: last }; if (listener.prev) { listener.prev.next = listener; } else { first = listener; } return function unsubscribe() { if (!isSubscribed || first === null) return; isSubscribed = false; if (listener.next) { listener.next.prev = listener.prev; } else { last = listener.prev; } if (listener.prev) { listener.prev.next = listener.next; } else { first = listener.next; } }; } }; } const nullListeners = { notify() {}, get: () => [] }; function createSubscription(store, parentSub) { let unsubscribe; let listeners = nullListeners; function addNestedSub(listener) { trySubscribe(); return listeners.subscribe(listener); } function notifyNestedSubs() { listeners.notify(); } function handleChangeWrapper() { if (subscription.onStateChange) { subscription.onStateChange(); } } function isSubscribed() { return Boolean(unsubscribe); } function trySubscribe() { if (!unsubscribe) { unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper); listeners = createListenerCollection(); } } function tryUnsubscribe() { if (unsubscribe) { unsubscribe(); unsubscribe = undefined; listeners.clear(); listeners = nullListeners; } } const subscription = { addNestedSub, notifyNestedSubs, handleChangeWrapper, isSubscribed, trySubscribe, tryUnsubscribe, getListeners: () => listeners }; return subscription; } // To get around it, we can conditionally useEffect on the server (no-op) and // useLayoutEffect in the browser. We need useLayoutEffect to ensure the store // subscription callback always has the selector from the latest render commit // available, otherwise a store update may happen between render and the effect, // which may cause missed updates; we also must ensure the store subscription // is created synchronously, otherwise a store update may occur before the // subscription is created and an inconsistent state may be observed // Matches logic in React's `shared/ExecutionEnvironment` file const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect; function is(x, y) { if (x === y) { return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { return x !== x && y !== y; } } function shallowEqual(objA, objB) { if (is(objA, objB)) return true; if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } const keysA = Object.keys(objA); const keysB = Object.keys(objB); if (keysA.length !== keysB.length) return false; for (let i = 0; i < keysA.length; i++) { if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; } const _excluded = ["reactReduxForwardedRef"]; let useSyncExternalStore = notInitialized; const initializeConnect = fn => { useSyncExternalStore = fn; }; // Define some constant arrays just to avoid re-creating these const NO_SUBSCRIPTION_ARRAY = [null, null]; // Attempts to stringify whatever not-really-a-component value we were given // for logging in an error message const stringifyComponent = Comp => { try { return JSON.stringify(Comp); } catch (err) { return String(Comp); } }; // This is "just" a `useLayoutEffect`, but with two modifications: // - we need to fall back to `useEffect` in SSR to avoid annoying warnings // - we extract this to a separate function to avoid closing over values // and causing memory leaks function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) { useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies); } // Effect callback, extracted: assign the latest props values to refs for later usage function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, // actualChildProps: unknown, childPropsFromStoreUpdate, notifyNestedSubs) { // We want to capture the wrapper props and child props we used for later comparisons lastWrapperProps.current = wrapperProps; renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update if (childPropsFromStoreUpdate.current) { childPropsFromStoreUpdate.current = null; notifyNestedSubs(); } } // Effect callback, extracted: subscribe to the Redux store or nearest connected ancestor, // check for updates after dispatched actions, and trigger re-renders. function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, // forceComponentUpdateDispatch: React.Dispatch<any>, additionalSubscribeListener) { // If we're not subscribed to the store, nothing to do here if (!shouldHandleStateChanges) return () => {}; // Capture values for checking if and when this component unmounts let didUnsubscribe = false; let lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component const checkForUpdates = () => { if (didUnsubscribe || !isMounted.current) { // Don't run stale listeners. // Redux doesn't guarantee unsubscriptions happen until next dispatch. return; } // TODO We're currently calling getState ourselves here, rather than letting `uSES` do it const latestStoreState = store.getState(); let newChildProps, error; try { // Actually run the selector with the most recent store state and wrapper props // to determine what the child props should be newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current); } catch (e) { error = e; lastThrownError = e; } if (!error) { lastThrownError = null; } // If the child props haven't changed, nothing to do here - cascade the subscription update if (newChildProps === lastChildProps.current) { if (!renderIsScheduled.current) { notifyNestedSubs(); } } else { // Save references to the new child props. Note that we track the "child props from store update" // as a ref instead of a useState/useReducer because we need a way to determine if that value has // been processed. If this went into useState/useReducer, we couldn't clear out the value without // forcing another re-render, which we don't want. lastChildProps.current = newChildProps; childPropsFromStoreUpdate.current = newChildProps; renderIsScheduled.current = true; // TODO This is hacky and not how `uSES` is meant to be used // Trigger the React `useSyncExternalStore` subscriber additionalSubscribeListener(); } }; // Actually subscribe to the nearest connected ancestor (or store) subscription.onStateChange = checkForUpdates; subscription.trySubscribe(); // Pull data from the store after first render in case the store has // changed since we began. checkForUpdates(); const unsubscribeWrapper = () => { didUnsubscribe = true; subscription.tryUnsubscribe(); subscription.onStateChange = null; if (lastThrownError) { // It's possible that we caught an error due to a bad mapState function, but the // parent re-rendered without this component and we're about to unmount. // This shouldn't happen as long as we do top-down subscriptions correctly, but // if we ever do those wrong, this throw will surface the error in our tests. // In that case, throw the error from here so it doesn't get lost. throw lastThrownError; } }; return unsubscribeWrapper; } // Reducer initial state creation for our update reducer function match(arg, factories, name) { for (let i = factories.length - 1; i >= 0; i--) { const result = factories[i](arg); if (result) return result; } return (dispatch, options) => { throw new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`); }; } function strictEqual(a, b) { return a === b; } /** * Infers the type of props that a connector will inject into a component. */ /** * Connects a React component to a Redux store. * * - Without arguments, just wraps the component, without changing the behavior / props * * - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior * is to override ownProps (as stated in the docs), so what remains is everything that's * not a state or dispatch prop * * - When 3rd param is passed, we don't know if ownProps propagate and whether they * should be valid component props, because it depends on mergeProps implementation. * As such, it is the user's responsibility to extend ownProps interface from state or * dispatch props or both when applicable * * @param mapStateToProps A function that extracts values from state * @param mapDispatchToProps Setup for dispatching actions * @param mergeProps Optional callback to merge state and dispatch props together * @param options Options for configuring the connection * */ function connect(mapStateToProps, mapDispatchToProps, mergeProps, { // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence. // @ts-ignore pure, areStatesEqual = strictEqual, areOwnPropsEqual = shallowEqual, areStatePropsEqual = shallowEqual, areMergedPropsEqual = shallowEqual, // use React's forwardRef to expose a ref of the wrapped component forwardRef = false, // the context consumer to use context = ReactReduxContext } = {}) { { if (pure !== undefined) { throw new Error('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'); } } const Context = context; const initMapStateToProps = match(mapStateToProps, // @ts-ignore defaultMapStateToPropsFactories, 'mapStateToProps'); const initMapDispatchToProps = match(mapDispatchToProps, // @ts-ignore defaultMapDispatchToPropsFactories, 'mapDispatchToProps'); const initMergeProps = match(mergeProps, // @ts-ignore defaultMergePropsFactories, 'mergeProps'); const shouldHandleStateChanges = Boolean(mapStateToProps); const wrapWithConnect = WrappedComponent => { if (!reactIs.isValidElementType(WrappedComponent)) { throw new Error(`You must pass a component to the function returned by connect. Instead received ${stringifyComponent(WrappedComponent)}`); } const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; const displayName = `Connect(${wrappedComponentName})`; const selectorFactoryOptions = { shouldHandleStateChanges, displayName, wrappedComponentName, WrappedComponent, initMapStateToProps, initMapDispatchToProps, // @ts-ignore initMergeProps, areStatesEqual, areStatePropsEqual, areOwnPropsEqual, areMergedPropsEqual }; function ConnectFunction(props) { const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => { // Distinguish between actual "data" props that were passed to the wrapper component, // and values needed to control behavior (forwarded refs, alternate context instances). // To maintain the wrapperProps object reference, memoize this destructuring. const { reactReduxForwardedRef } = props, wrapperProps = _objectWithoutPropertiesLoose(props, _excluded); return [props.context, reactReduxForwardedRef, wrapperProps]; }, [props]); const ContextToUse = React.useMemo(() => { // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext. // Memoize the check that determines which context instance we should use. return propsContext && propsContext.Consumer && // @ts-ignore reactIs.isContextConsumer( /*#__PURE__*/React__default['default'].createElement(propsContext.Consumer, null)) ? propsContext : Context; }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available const contextValue = React.useContext(ContextToUse); // The store _must_ exist as either a prop or in context. // We'll check to see if it _looks_ like a Redux store first. // This allows us to pass through a `store` prop that is just a plain value. const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch); const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store); if (!didStoreComeFromProps && !didStoreComeFromContext) { throw new Error(`Could not find "store" in the context of ` + `"${displayName}". Either wrap the root component in a <Provider>, ` + `or pass a custom React context provider to <Provider> and the corresponding ` + `React context consumer to ${displayName} in connect options.`); } // Based on the previous check, one of these must be true const store = didStoreComeFromProps ? props.store : contextValue.store; const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState; const childPropsSelector = React.useMemo(() => { // The child props selector needs the store reference as an input. // Re-create this selector whenever the store changes. return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions); }, [store]); const [subscription, notifyNestedSubs] = React.useMemo(() => { if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component // connected to the store via props shouldn't use subscription from context, or vice versa. const subscription = createSubscription(store, didStoreComeFromProps ? undefined : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in // the middle of the notification loop, where `subscription` will then be null. This can // probably be avoided if Subscription's listeners logic is changed to not call listeners // that have been unsubscribed in the middle of the notification loop. const notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription); return [subscription, notifyNestedSubs]; }, [store, didStoreComeFromProps, contextValue]); // Determine what {store, subscription} value should be put into nested context, if necessary, // and memoize that value to avoid unnecessary context updates. const overriddenContextValue = React.useMemo(() => { if (didStoreComeFromProps) { // This component is directly subscribed to a store from props. // We don't want descendants reading from this store - pass down whatever // the existing context value is from the nearest connected ancestor. return contextValue; } // Otherwise, put this component's subscription instance into context, so that // connected descendants won't update until after this component is done return _extends({}, contextValue, { subscription }); }, [didStoreComeFromProps, contextValue, subscription]); // Set up refs to coordinate values between the subscription effect and the render logic const lastChildProps = React.useRef(); const lastWrapperProps = React.useRef(wrapperProps); const childPropsFromStoreUpdate = React.useRef(); const renderIsScheduled = React.useRef(false); React.useRef(false); const isMounted = React.useRef(false); const latestSubscriptionCallbackError = React.useRef(); useIsomorphicLayoutEffect(() => { isMounted.current = true; return () => { isMounted.current = false; }; }, []); const actualChildPropsSelector = React.useMemo(() => { const selector = () => { // Tricky logic here: // - This render may have been triggered by a Redux store update that produced new child props // - However, we may have gotten new wrapper props after that // If we have new child props, and the same wrapper props, we know we should use the new child props as-is. // But, if we have new wrapper props, those might change the child props, so we have to recalculate things. // So, we'll use the child props from store update only if the wrapper props are the same as last time. if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) { return childPropsFromStoreUpdate.current; } // TODO We're reading the store directly in render() here. Bad idea? // This will likely cause Bad Things (TM) to happen in Concurrent Mode. // Note that we do this because on renders _not_ caused by store updates, we need the latest store state // to determine what the child props should be. return childPropsSelector(store.getState(), wrapperProps); }; return selector; }, [store, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns // about useLayoutEffect in SSR, so we try to detect environment and fall back to // just useEffect instead to avoid the warning, since neither will run anyway. const subscribeForReact = React.useMemo(() => { const subscribe = reactListener => { if (!subscription) { return () => {}; } return subscribeUpdates(shouldHandleStateChanges, store, subscription, // @ts-ignore childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener); }; return subscribe; }, [subscription]); useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs]); let actualChildProps; try { actualChildProps = useSyncExternalStore( // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing subscribeForReact, // TODO This is incredibly hacky. We've already processed the store update and calculated new child props, // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`. actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector); } catch (err) { if (latestSubscriptionCallbackError.current) { err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`; } throw err; } useIsomorphicLayoutEffect(() => { latestSubscriptionCallbackError.current = undefined; childPropsFromStoreUpdate.current = undefined; lastChildProps.current = actualChildProps; }); // Now that all that's done, we can finally try to actually render the child component. // We memoize the elements for the rendered child component as an optimization. const renderedWrappedComponent = React.useMemo(() => { return ( /*#__PURE__*/ // @ts-ignore React__default['default'].createElement(WrappedComponent, _extends({}, actualChildProps, { ref: reactReduxForwardedRef })) ); }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. const renderedChild = React.useMemo(() => { if (shouldHandleStateChanges) { // If this component is subscribed to store updates, we need to pass its own // subscription instance down to our descendants. That means rendering the same // Context instance, and putting a different value into the context. return /*#__PURE__*/React__default['default'].createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent); } return renderedWrappedComponent; }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]); return renderedChild; } const _Connect = React__default['default'].memo(ConnectFunction); // Add a hacky cast to get the right output type const Connect = _Connect; Connect.WrappedComponent = WrappedComponent; Connect.displayName = ConnectFunction.displayName = displayName; if (forwardRef) { const _forwarded = React__default['default'].forwardRef(function forwardConnectRef(props, ref) { // @ts-ignore return /*#__PURE__*/React__default['default'].createElement(Connect, _extends({}, props, { reactReduxForwardedRef: ref })); }); const forwarded = _forwarded; forwarded.displayName = displayName; forwarded.WrappedComponent = WrappedComponent; return hoistNonReactStatics_cjs(forwarded, WrappedComponent); } return hoistNonReactStatics_cjs(Connect, WrappedComponent); }; return wrapWithConnect; } function Provider({ store, context, children, serverState }) { const contextValue = React.useMemo(() => { const subscription = createSubscription(store); return { store, subscription, getServerState: serverState ? () => serverState : undefined }; }, [store, serverState]); const previousState = React.useMemo(() => store.getState(), [store]); useIsomorphicLayoutEffect(() => { const { subscription } = contextValue; subscription.onStateChange = subscription.notifyNestedSubs; subscription.trySubscribe(); if (previousState !== store.getState()) { subscription.notifyNestedSubs(); } return () => { subscription.tryUnsubscribe(); subscription.onStateChange = undefined; }; }, [contextValue, previousState]); const Context = context || ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype return /*#__PURE__*/React__default['default'].createElement(Context.Provider, { value: contextValue }, children); } /** * Hook factory, which creates a `useStore` hook bound to a given context. * * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. * @returns {Function} A `useStore` hook bound to the specified context. */ function createStoreHook(context = ReactReduxContext) { const useReduxContext$1 = // @ts-ignore context === ReactReduxContext ? useReduxContext : () => React.useContext(context); return function useStore() { const { store } = useReduxContext$1(); // @ts-ignore return store; }; } /** * A hook to access the redux store. * * @returns {any} the redux store * * @example * * import React from 'react' * import { useStore } from 'react-redux' * * export const ExampleComponent = () => { * const store = useStore() * return <div>{store.getState()}</div> * } */ const useStore = /*#__PURE__*/createStoreHook(); /** * Hook factory, which creates a `useDispatch` hook bound to a given context. * * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. * @returns {Function} A `useDispatch` hook bound to the specified context. */ function createDispatchHook(context = ReactReduxContext) { const useStore$1 = // @ts-ignore context === ReactReduxContext ? useStore : createStoreHook(context); return function useDispatch() { const store = useStore$1(); // @ts-ignore return store.dispatch; }; } /** * A hook to access the redux `dispatch` function. * * @returns {any|function} redux store's `dispatch` function * * @example * * import React, { useCallback } from 'react' * import { useDispatch } from 'react-redux' * * export const CounterComponent = ({ value }) => { * const dispatch = useDispatch() * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), []) * return ( * <div> * <span>{value}</span> * <button onClick={increaseCounter}>Increase counter</button> * </div> * ) * } */ const useDispatch = /*#__PURE__*/createDispatchHook(); // The default entry point assumes we are working with React 18, and thus have initializeUseSelector(withSelector.useSyncExternalStoreWithSelector); initializeConnect(React.useSyncExternalStore); // Enable batched updates in our subscriptions for use // with standard React renderers (ReactDOM, React Native) setBatch(reactDom.unstable_batchedUpdates); Object.defineProperty(exports, 'batch', { enumerable: true, get: function () { return reactDom.unstable_batchedUpdates; } }); exports.Provider = Provider; exports.ReactReduxContext = ReactReduxContext; exports.connect = connect; exports.createDispatchHook = createDispatchHook; exports.createSelectorHook = createSelectorHook; exports.createStoreHook = createStoreHook; exports.shallowEqual = shallowEqual; exports.useDispatch = useDispatch; exports.useSelector = useSelector; exports.useStore = useStore; Object.defineProperty(exports, '__esModule', { value: true }); })));
packages/core/tocco-ui/src/SignalList/SignalListItem.js
tocco/tocco-client
import PropTypes from 'prop-types' import React from 'react' import Icon from '../Icon' import {design} from '../utilStyles' import StyledSignalListItem from './StyledSignalListItem' const ICONS = { [design.condition.BASE]: false, [design.condition.PRIMARY]: false, [design.condition.DANGER]: 'times', [design.condition.SUCCESS]: 'check', [design.condition.WARNING]: 'exclamation-triangle', [design.condition.INFO]: 'info' } const getIcon = props => { const icon = ICONS[props.condition] if (icon) { return <Icon icon={icon} position={design.position.SOLE} /> } else { return <i>{'\u2022'}</i> } } /** * Signalize single condition by icon and color. It must be wrapped by <SignalList/> */ const SignalListItem = props => ( <StyledSignalListItem condition={props.condition}> {getIcon(props)} {props.label} {React.Children.map(props.children, child => React.cloneElement(child))} </StyledSignalListItem> ) SignalListItem.defaultProps = { condition: design.condition.BASE } SignalListItem.propTypes = { /** * Visible text. Default is an empty string. */ label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), children: PropTypes.node, /** * Color and icon is set according condition. Default value is 'base'. * Possible values: base|danger|primary|success|warning */ condition: design.conditionPropTypes(ICONS) } export default SignalListItem
src/issues/IssueDetailContainer.js
evandavis/react-github-issues
import React from 'react'; import IssueDetail from './IssueDetail'; function issueDetailByNumberURL(issueNumber) { return `https://api.github.com/repos/rails/rails/issues/${issueNumber}`; } const IssueDetailContainer = React.createClass({ propTypes: { params: React.PropTypes.shape({ issueNumber: React.PropTypes.string.isRequired }).isRequired }, getInitialState() { return {issue: {user: {}}}; }, componentWillMount() { const {issueNumber} = this.props.params; this.fetchIssueDetail(issueNumber) .then((issue) => { this.setState({issue}); return this.fetchIssueComments(issue.comments_url) }) .then((comments) => { this.setState({comments}); }) .catch(function(ex) { console.log('parsing failed', ex) }); }, fetchIssueDetail(issueNumber) { return fetch(issueDetailByNumberURL(issueNumber)) .then((response) => { return response.json(); }); }, fetchIssueComments(commentURL) { return fetch(commentURL).then((response) => { return response.json(); }); }, render() { return (<IssueDetail {...this.state} />) } }); export default IssueDetailContainer;
ajax/libs/yasr/2.2.2/yasr.bundled.min.js
ThibWeb/cdnjs
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.YASR=e()}}(function(){var e;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t){"use strict";var n=e("jquery"),r=e("yasgui-utils");console=console||{log:function(){}};var i=t.exports=function(t,s,l){var u={};u.options=n.extend(!0,{},i.defaults,s);u.container=n("<div class='yasr'></div>").appendTo(t);u.header=n("<div class='yasr_header'></div>").appendTo(u.container);u.resultsContainer=n("<div class='yasr_results'></div>").appendTo(u.container);u.plugins={};for(var c in i.plugins)u.plugins[c]=new i.plugins[c](u);u.draw=function(e){if(!u.results)return!1;e||(e=u.options.output);if(e in u.plugins&&u.plugins[e].canHandleResults(u)){n(u.resultsContainer).empty();u.plugins[e].draw();return!0}var t=null,r=-1;for(var i in u.plugins)if(u.plugins[i].canHandleResults(u)){var o=u.plugins[i].getPriority;"function"==typeof o&&(o=o(u));if(null!=o&&void 0!=o&&o>r){r=o;t=i}}if(t){n(u.resultsContainer).empty();u.plugins[t].draw();return!0}return!1};u.somethingDrawn=function(){return!u.resultsContainer.is(":empty")};u.setResponse=function(t){try{u.results=e("./parsers/wrapper.js")(t)}catch(n){u.results=n}u.draw();if(u.options.persistency&&u.options.persistency.results&&u.results.getOriginalResponseAsString&&u.results.getOriginalResponseAsString().length<u.options.persistency.results.maxSize){var i="string"==typeof u.options.persistency.results.id?u.options.persistency.results.id:u.options.persistency.results.id(u);r.storage.set(i,u.results.getOriginalResponse(),"month")}};if(u.options.persistency&&u.options.persistency.outputSelector){var f="string"==typeof u.options.persistency.outputSelector?u.options.persistency.outputSelector:u.options.persistency.outputSelector(u);if(f){var d=r.storage.get(f);d&&(u.options.output=d)}}if(!l&&u.options.persistency&&u.options.persistency.results){var f="string"==typeof u.options.persistency.results.id?u.options.persistency.results.id:u.options.persistency.results.id(u);l=r.storage.get(f)}a(u);l&&u.setResponse(l);o(u);return u},o=function(e){var t=e.header.find(".yasr_downloadIcon");t.removeAttr("title");var n=e.plugins[e.options.output];if(n){var r=n.getDownloadInfo?n.getDownloadInfo():null;if(r){r.buttonTitle&&t.attr(r.buttonTitle);t.prop("disabled",!1);t.find("path").each(function(){this.style.fill="black"})}else{t.prop("disabled",!0).prop("title","Download not supported for this result representation");t.find("path").each(function(){this.style.fill="gray"})}}},a=function(t){var i=function(){var e=n('<div class="yasr_btnGroup"></div>');n.each(t.plugins,function(i,a){if(!a.hideFromSelection){var s=a.name||i,l=n("<button class='yasr_btn'></button>").text(s).addClass("select_"+i).click(function(){e.find("button.selected").removeClass("selected");n(this).addClass("selected");t.options.output=i;if(t.options.persistency&&t.options.persistency.outputSelector){var a="string"==typeof t.options.persistency.outputSelector?t.options.persistency.outputSelector:t.options.persistency.outputSelector(t);r.storage.set(a,t.options.output,"month")}t.draw();o(t)}).appendTo(e);t.options.output==i&&l.addClass("selected")}});e.children().length>1&&t.header.append(e)},a=function(){var r=function(e,t){var n=null,r=window.URL||window.webkitURL||window.mozURL||window.msURL;if(r&&Blob){var i=new Blob([e],{type:t});n=r.createObjectURL(i)}return n},i=n("<button class='yasr_btn yasr_downloadIcon'></button>").append(e("yasgui-utils").svg.getElement(e("./imgs.js").download,{width:"15px",height:"15px"})).click(function(){var e=t.plugins[t.options.output];if(e&&e.getDownloadInfo){var i=e.getDownloadInfo(),o=r(i.getContent(),i.contentType?i.contentType:"text/plain"),a=n("<a></a>");a.attr("href",o);a.attr("download",i.filename);a.get(0).click()}});t.header.append(i)};t.options.drawOutputSelector&&i();t.options.drawDownloadIcon&&a()};i.plugins={};i.registerOutput=function(e,t){i.plugins[e]=t};i.registerOutput("boolean",e("./boolean.js"));i.registerOutput("table",e("./table.js"));i.registerOutput("rawResponse",e("./rawResponse.js"));i.registerOutput("error",e("./error.js"));i.defaults=e("./defaults.js");i.version={YASR:e("../package.json").version,jquery:n.fn.jquery,"yasgui-utils":e("yasgui-utils").version}},{"../package.json":18,"./boolean.js":20,"./defaults.js":21,"./error.js":22,"./imgs.js":23,"./parsers/wrapper.js":28,"./rawResponse.js":30,"./table.js":31,jquery:12,"yasgui-utils":15}],2:[function(t,n,r){(function(n,i,o){(function(n){"use strict";"function"==typeof e&&e.amd?e("datatables",["jquery"],n):"object"==typeof r?n(t("jquery")):jQuery&&!jQuery.fn.dataTable&&n(jQuery)})(function(e){"use strict";function t(n){var r,i,o="a aa ai ao as b fn i m o s ",a={};e.each(n,function(e){r=e.match(/^([^A-Z]+?)([A-Z])/);if(r&&-1!==o.indexOf(r[1]+" ")){i=e.replace(r[0],r[2].toLowerCase());a[i]=e;"o"===r[1]&&t(n[e])}});n._hungarianMap=a}function r(n,i,a){n._hungarianMap||t(n);var s;e.each(i,function(t){s=n._hungarianMap[t];if(s!==o&&(a||i[s]===o))if("o"===s.charAt(0)){i[s]||(i[s]={});e.extend(!0,i[s],i[t]);r(n[s],i[s],a)}else i[s]=i[t]})}function a(e){var t=Xt.defaults.oLanguage,n=e.sZeroRecords;!e.sEmptyTable&&n&&"No data available in table"===t.sEmptyTable&&Ft(e,e,"sZeroRecords","sEmptyTable");!e.sLoadingRecords&&n&&"Loading..."===t.sLoadingRecords&&Ft(e,e,"sZeroRecords","sLoadingRecords");e.sInfoThousands&&(e.sThousands=e.sInfoThousands);var r=e.sDecimal;r&&Gt(r)}function s(e){yn(e,"ordering","bSort");yn(e,"orderMulti","bSortMulti");yn(e,"orderClasses","bSortClasses");yn(e,"orderCellsTop","bSortCellsTop");yn(e,"order","aaSorting");yn(e,"orderFixed","aaSortingFixed");yn(e,"paging","bPaginate");yn(e,"pagingType","sPaginationType");yn(e,"pageLength","iDisplayLength");yn(e,"searching","bFilter");var t=e.aoSearchCols;if(t)for(var n=0,i=t.length;i>n;n++)t[n]&&r(Xt.models.oSearch,t[n])}function l(e){yn(e,"orderable","bSortable");yn(e,"orderData","aDataSort");yn(e,"orderSequence","asSorting");yn(e,"orderDataType","sortDataType")}function u(t){var n=t.oBrowser,r=e("<div/>").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(e("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(e('<div class="test"/>').css({width:"100%",height:10}))).appendTo("body"),i=r.find(".test");n.bScrollOversize=100===i[0].offsetWidth;n.bScrollbarLeft=1!==i.offset().left;r.remove()}function c(e,t,n,r,i,a){var s,l=r,u=!1;if(n!==o){s=n;u=!0}for(;l!==i;)if(e.hasOwnProperty(l)){s=u?t(s,e[l],l,e):e[l];u=!0;l+=a}return s}function f(t,n){var r=Xt.defaults.column,o=t.aoColumns.length,a=e.extend({},Xt.models.oColumn,r,{nTh:n?n:i.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[o],mData:r.mData?r.mData:o,idx:o});t.aoColumns.push(a);var s=t.aoPreSearchCols;s[o]=e.extend({},Xt.models.oSearch,s[o]);d(t,o,null)}function d(t,n,i){var a=t.aoColumns[n],s=t.oClasses,u=e(a.nTh);if(!a.sWidthOrig){a.sWidthOrig=u.attr("width")||null;var c=(u.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);c&&(a.sWidthOrig=c[1])}if(i!==o&&null!==i){l(i);r(Xt.defaults.column,i);i.mDataProp===o||i.mData||(i.mData=i.mDataProp);i.sType&&(a._sManualType=i.sType);i.className&&!i.sClass&&(i.sClass=i.className);e.extend(a,i);Ft(a,i,"sWidth","sWidthOrig");"number"==typeof i.iDataSort&&(a.aDataSort=[i.iDataSort]);Ft(a,i,"aDataSort")}var f=a.mData,d=L(f),h=a.mRender?L(a.mRender):null,p=function(e){return"string"==typeof e&&-1!==e.indexOf("@")};a._bAttrSrc=e.isPlainObject(f)&&(p(f.sort)||p(f.type)||p(f.filter));a.fnGetData=function(e,t,n){var r=d(e,t,o,n);return h&&t?h(r,t,e,n):r};a.fnSetData=function(e,t,n){return A(f)(e,t,n)};if(!t.oFeatures.bSort){a.bSortable=!1;u.addClass(s.sSortableNone)}var g=-1!==e.inArray("asc",a.asSorting),m=-1!==e.inArray("desc",a.asSorting);if(a.bSortable&&(g||m))if(g&&!m){a.sSortingClass=s.sSortableAsc;a.sSortingClassJUI=s.sSortJUIAscAllowed}else if(!g&&m){a.sSortingClass=s.sSortableDesc;a.sSortingClassJUI=s.sSortJUIDescAllowed}else{a.sSortingClass=s.sSortable;a.sSortingClassJUI=s.sSortJUI}else{a.sSortingClass=s.sSortableNone;a.sSortingClassJUI=""}}function h(e){if(e.oFeatures.bAutoWidth!==!1){var t=e.aoColumns;yt(e);for(var n=0,r=t.length;r>n;n++)t[n].nTh.style.width=t[n].sWidth}var i=e.oScroll;(""!==i.sY||""!==i.sX)&&mt(e);zt(e,null,"column-sizing",[e])}function p(e,t){var n=v(e,"bVisible");return"number"==typeof n[t]?n[t]:null}function g(t,n){var r=v(t,"bVisible"),i=e.inArray(n,r);return-1!==i?i:null}function m(e){return v(e,"bVisible").length}function v(t,n){var r=[];e.map(t.aoColumns,function(e,t){e[n]&&r.push(t)});return r}function y(e){var t,n,r,i,a,s,l,u,c,f=e.aoColumns,d=e.aoData,h=Xt.ext.type.detect;for(t=0,n=f.length;n>t;t++){l=f[t];c=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,i=h.length;i>r;r++){for(a=0,s=d.length;s>a;a++){c[a]===o&&(c[a]=T(e,a,t,"type"));u=h[r](c[a],e);if(!u||"html"===u)break}if(u){l.sType=u;break}}l.sType||(l.sType="string")}}}function b(t,n,r,i){var a,s,l,u,c,d,h,p=t.aoColumns;if(n)for(a=n.length-1;a>=0;a--){h=n[a];var g=h.targets!==o?h.targets:h.aTargets;e.isArray(g)||(g=[g]);for(l=0,u=g.length;u>l;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)f(t);i(g[l],h)}else if("number"==typeof g[l]&&g[l]<0)i(p.length+g[l],h);else if("string"==typeof g[l])for(c=0,d=p.length;d>c;c++)("_all"==g[l]||e(p[c].nTh).hasClass(g[l]))&&i(c,h)}if(r)for(a=0,s=r.length;s>a;a++)i(a,r[a])}function x(t,n,r,i){var o=t.aoData.length,a=e.extend(!0,{},Xt.models.oRow,{src:r?"dom":"data"});a._aData=n;t.aoData.push(a);for(var s=t.aoColumns,l=0,u=s.length;u>l;l++){r&&k(t,o,l,T(t,o,l));s[l].sType=null}t.aiDisplayMaster.push(o);(r||!t.oFeatures.bDeferRender)&&I(t,o,r,i);return o}function w(t,n){var r;n instanceof e||(n=e(n));return n.map(function(e,n){r=j(t,n);return x(t,r.data,n,r.cells)})}function C(e,t){return t._DT_RowIndex!==o?t._DT_RowIndex:null}function S(t,n,r){return e.inArray(r,t.aoData[n].anCells)}function T(e,t,n,r){var i=e.iDraw,a=e.aoColumns[n],s=e.aoData[t]._aData,l=a.sDefaultContent,u=a.fnGetData(s,r,{settings:e,row:t,col:n});if(u===o){if(e.iDrawError!=i&&null===l){Ot(e,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+t,4);e.iDrawError=i}return l}if(u!==s&&null!==u||null===l){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"==r?"":u}function k(e,t,n,r){var i=e.aoColumns[n],o=e.aoData[t]._aData;i.fnSetData(o,r,{settings:e,row:t,col:n})}function D(t){return e.map(t.match(/(\\.|[^\.])+/g),function(e){return e.replace(/\\./g,".")})}function L(t){if(e.isPlainObject(t)){var n={};e.each(t,function(e,t){t&&(n[e]=L(t))});return function(e,t,r,i){var a=n[t]||n._;return a!==o?a(e,t,r,i):e}}if(null===t)return function(e){return e};if("function"==typeof t)return function(e,n,r,i){return t(e,n,r,i)};if("string"!=typeof t||-1===t.indexOf(".")&&-1===t.indexOf("[")&&-1===t.indexOf("("))return function(e){return e[t]};var r=function(e,t,n){var i,a,s,l;if(""!==n)for(var u=D(n),c=0,f=u.length;f>c;c++){i=u[c].match(bn);a=u[c].match(xn);if(i){u[c]=u[c].replace(bn,"");""!==u[c]&&(e=e[u[c]]);s=[];u.splice(0,c+1);l=u.join(".");for(var d=0,h=e.length;h>d;d++)s.push(r(e[d],t,l));var p=i[0].substring(1,i[0].length-1);e=""===p?s:s.join(p);break}if(a){u[c]=u[c].replace(xn,"");e=e[u[c]]()}else{if(null===e||e[u[c]]===o)return o;e=e[u[c]]}}return e};return function(e,n){return r(e,n,t)}}function A(t){if(e.isPlainObject(t))return A(t._);if(null===t)return function(){};if("function"==typeof t)return function(e,n,r){t(e,"set",n,r)};if("string"!=typeof t||-1===t.indexOf(".")&&-1===t.indexOf("[")&&-1===t.indexOf("("))return function(e,n){e[t]=n};var n=function(e,t,r){for(var i,a,s,l,u,c=D(r),f=c[c.length-1],d=0,h=c.length-1;h>d;d++){a=c[d].match(bn);s=c[d].match(xn);if(a){c[d]=c[d].replace(bn,"");e[c[d]]=[];i=c.slice();i.splice(0,d+1);u=i.join(".");for(var p=0,g=t.length;g>p;p++){l={};n(l,t[p],u);e[c[d]].push(l)}return}if(s){c[d]=c[d].replace(xn,"");e=e[c[d]](t)}(null===e[c[d]]||e[c[d]]===o)&&(e[c[d]]={});e=e[c[d]]}f.match(xn)?e=e[f.replace(xn,"")](t):e[f.replace(bn,"")]=t};return function(e,r){return n(e,r,t)}}function N(e){return hn(e.aoData,"_aData")}function _(e){e.aoData.length=0;e.aiDisplayMaster.length=0;e.aiDisplay.length=0}function M(e,t,n){for(var r=-1,i=0,a=e.length;a>i;i++)e[i]==t?r=i:e[i]>t&&e[i]--;-1!=r&&n===o&&e.splice(r,1)}function E(e,t,n,r){var i,a,s=e.aoData[t];if("dom"!==n&&(n&&"auto"!==n||"dom"!==s.src)){var l,u=s.anCells;if(u)for(i=0,a=u.length;a>i;i++){l=u[i];for(;l.childNodes.length;)l.removeChild(l.firstChild);u[i].innerHTML=T(e,t,i,"display")}}else s._aData=j(e,s).data;s._aSortData=null;s._aFilterData=null;var c=e.aoColumns;if(r!==o)c[r].sType=null;else for(i=0,a=c.length;a>i;i++)c[i].sType=null;H(s)}function j(t,n){var r,i,o,a,s=[],l=[],u=n.firstChild,c=0,f=t.aoColumns,d=function(e,t,n){if("string"==typeof e){var r=e.indexOf("@");if(-1!==r){var i=e.substring(r+1);o["@"+i]=n.getAttribute(i)}}},h=function(t){i=f[c];a=e.trim(t.innerHTML);if(i&&i._bAttrSrc){o={display:a};d(i.mData.sort,o,t);d(i.mData.type,o,t);d(i.mData.filter,o,t);s.push(o)}else s.push(a);c++};if(u)for(;u;){r=u.nodeName.toUpperCase();if("TD"==r||"TH"==r){h(u);l.push(u)}u=u.nextSibling}else{l=n.anCells;for(var p=0,g=l.length;g>p;p++)h(l[p])}return{data:s,cells:l}}function I(e,t,n,r){var o,a,s,l,u,c=e.aoData[t],f=c._aData,d=[];if(null===c.nTr){o=n||i.createElement("tr");c.nTr=o;c.anCells=d;o._DT_RowIndex=t;H(c);for(l=0,u=e.aoColumns.length;u>l;l++){s=e.aoColumns[l];a=n?r[l]:i.createElement(s.sCellType);d.push(a);(!n||s.mRender||s.mData!==l)&&(a.innerHTML=T(e,t,l,"display"));s.sClass&&(a.className+=" "+s.sClass);s.bVisible&&!n?o.appendChild(a):!s.bVisible&&n&&a.parentNode.removeChild(a);s.fnCreatedCell&&s.fnCreatedCell.call(e.oInstance,a,T(e,t,l),f,t,l)}zt(e,"aoRowCreatedCallback",null,[o,f,t])}c.nTr.setAttribute("role","row")}function H(t){var n=t.nTr,r=t._aData;if(n){r.DT_RowId&&(n.id=r.DT_RowId);if(r.DT_RowClass){var i=r.DT_RowClass.split(" ");t.__rowc=t.__rowc?vn(t.__rowc.concat(i)):i;e(n).removeClass(t.__rowc.join(" ")).addClass(r.DT_RowClass)}r.DT_RowData&&e(n).data(r.DT_RowData)}}function O(t){var n,r,i,o,a,s=t.nTHead,l=t.nTFoot,u=0===e("th, td",s).length,c=t.oClasses,f=t.aoColumns;u&&(o=e("<tr/>").appendTo(s));for(n=0,r=f.length;r>n;n++){a=f[n];i=e(a.nTh).addClass(a.sClass);u&&i.appendTo(o);if(t.oFeatures.bSort){i.addClass(a.sSortingClass);if(a.bSortable!==!1){i.attr("tabindex",t.iTabIndex).attr("aria-controls",t.sTableId);_t(t,a.nTh,n)}}a.sTitle!=i.html()&&i.html(a.sTitle);qt(t,"header")(t,i,a,c)}u&&z(t.aoHeader,s);e(s).find(">tr").attr("role","row");e(s).find(">tr>th, >tr>td").addClass(c.sHeaderTH);e(l).find(">tr>th, >tr>td").addClass(c.sFooterTH);if(null!==l){var d=t.aoFooter[0];for(n=0,r=d.length;r>n;n++){a=f[n];a.nTf=d[n].cell;a.sClass&&e(a.nTf).addClass(a.sClass)}}}function F(t,n,r){var i,a,s,l,u,c,f,d,h,p=[],g=[],m=t.aoColumns.length;if(n){r===o&&(r=!1);for(i=0,a=n.length;a>i;i++){p[i]=n[i].slice();p[i].nTr=n[i].nTr;for(s=m-1;s>=0;s--)t.aoColumns[s].bVisible||r||p[i].splice(s,1);g.push([])}for(i=0,a=p.length;a>i;i++){f=p[i].nTr;if(f)for(;c=f.firstChild;)f.removeChild(c);for(s=0,l=p[i].length;l>s;s++){d=1;h=1;if(g[i][s]===o){f.appendChild(p[i][s].cell);g[i][s]=1;for(;p[i+d]!==o&&p[i][s].cell==p[i+d][s].cell;){g[i+d][s]=1;d++}for(;p[i][s+h]!==o&&p[i][s].cell==p[i][s+h].cell;){for(u=0;d>u;u++)g[i+u][s+h]=1;h++}e(p[i][s].cell).attr("rowspan",d).attr("colspan",h)}}}}}function P(t){var n=zt(t,"aoPreDrawCallback","preDraw",[t]);if(-1===e.inArray(!1,n)){var r=[],i=0,a=t.asStripeClasses,s=a.length,l=(t.aoOpenRows.length,t.oLanguage),u=t.iInitDisplayStart,c="ssp"==Ut(t),f=t.aiDisplay;t.bDrawing=!0;if(u!==o&&-1!==u){t._iDisplayStart=c?u:u>=t.fnRecordsDisplay()?0:u;t.iInitDisplayStart=-1}var d=t._iDisplayStart,h=t.fnDisplayEnd();if(t.bDeferLoading){t.bDeferLoading=!1;t.iDraw++;pt(t,!1)}else if(c){if(!t.bDestroying&&!U(t))return}else t.iDraw++;if(0!==f.length)for(var p=c?0:d,g=c?t.aoData.length:h,v=p;g>v;v++){var y=f[v],b=t.aoData[y];null===b.nTr&&I(t,y);var x=b.nTr;if(0!==s){var w=a[i%s];if(b._sRowStripe!=w){e(x).removeClass(b._sRowStripe).addClass(w);b._sRowStripe=w}}zt(t,"aoRowCallback",null,[x,b._aData,i,v]);r.push(x);i++}else{var C=l.sZeroRecords;1==t.iDraw&&"ajax"==Ut(t)?C=l.sLoadingRecords:l.sEmptyTable&&0===t.fnRecordsTotal()&&(C=l.sEmptyTable);r[0]=e("<tr/>",{"class":s?a[0]:""}).append(e("<td />",{valign:"top",colSpan:m(t),"class":t.oClasses.sRowEmpty}).html(C))[0]}zt(t,"aoHeaderCallback","header",[e(t.nTHead).children("tr")[0],N(t),d,h,f]);zt(t,"aoFooterCallback","footer",[e(t.nTFoot).children("tr")[0],N(t),d,h,f]);var S=e(t.nTBody);S.children().detach();S.append(e(r));zt(t,"aoDrawCallback","draw",[t]);t.bSorted=!1;t.bFiltered=!1;t.bDrawing=!1}else pt(t,!1)}function R(e,t){var n=e.oFeatures,r=n.bSort,i=n.bFilter;r&&Lt(e);i?J(e,e.oPreviousSearch):e.aiDisplay=e.aiDisplayMaster.slice();t!==!0&&(e._iDisplayStart=0);e._drawHold=t;P(e);e._drawHold=!1}function W(t){var n=t.oClasses,r=e(t.nTable),i=e("<div/>").insertBefore(r),o=t.oFeatures,a=e("<div/>",{id:t.sTableId+"_wrapper","class":n.sWrapper+(t.nTFoot?"":" "+n.sNoFooter)});t.nHolding=i[0];t.nTableWrapper=a[0];t.nTableReinsertBefore=t.nTable.nextSibling;for(var s,l,u,c,f,d,h=t.sDom.split(""),p=0;p<h.length;p++){s=null;l=h[p];if("<"==l){u=e("<div/>")[0];c=h[p+1];if("'"==c||'"'==c){f="";d=2;for(;h[p+d]!=c;){f+=h[p+d];d++}"H"==f?f=n.sJUIHeader:"F"==f&&(f=n.sJUIFooter);if(-1!=f.indexOf(".")){var g=f.split(".");u.id=g[0].substr(1,g[0].length-1);u.className=g[1]}else"#"==f.charAt(0)?u.id=f.substr(1,f.length-1):u.className=f;p+=d}a.append(u);a=e(u)}else if(">"==l)a=a.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=ct(t);else if("f"==l&&o.bFilter)s=X(t);else if("r"==l&&o.bProcessing)s=ht(t);else if("t"==l)s=gt(t);else if("i"==l&&o.bInfo)s=it(t);else if("p"==l&&o.bPaginate)s=ft(t);else if(0!==Xt.ext.feature.length)for(var m=Xt.ext.feature,v=0,y=m.length;y>v;v++)if(l==m[v].cFeature){s=m[v].fnInit(t);break}if(s){var b=t.aanFeatures;b[l]||(b[l]=[]);b[l].push(s);a.append(s)}}i.replaceWith(a)}function z(t,n){var r,i,o,a,s,l,u,c,f,d,h,p=e(n).children("tr"),g=function(e,t,n){for(var r=e[t];r[n];)n++;return n};t.splice(0,t.length);for(o=0,l=p.length;l>o;o++)t.push([]);for(o=0,l=p.length;l>o;o++){r=p[o];c=0;i=r.firstChild;for(;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){f=1*i.getAttribute("colspan");d=1*i.getAttribute("rowspan");f=f&&0!==f&&1!==f?f:1;d=d&&0!==d&&1!==d?d:1;u=g(t,o,c);h=1===f?!0:!1;for(s=0;f>s;s++)for(a=0;d>a;a++){t[o+a][u+s]={cell:i,unique:h};t[o+a].nTr=r}}i=i.nextSibling}}}function B(e,t,n){var r=[];if(!n){n=e.aoHeader;if(t){n=[];z(n,t)}}for(var i=0,o=n.length;o>i;i++)for(var a=0,s=n[i].length;s>a;a++)!n[i][a].unique||r[a]&&e.bSortCellsTop||(r[a]=n[i][a].cell);return r}function q(t,n,r){zt(t,"aoServerParams","serverParams",[n]);if(n&&e.isArray(n)){var i={},o=/(.*?)\[\]$/;e.each(n,function(e,t){var n=t.name.match(o);if(n){var r=n[0];i[r]||(i[r]=[]);i[r].push(t.value)}else i[t.name]=t.value});n=i}var a,s=t.ajax,l=t.oInstance;if(e.isPlainObject(s)&&s.data){a=s.data;var u=e.isFunction(a)?a(n):a;n=e.isFunction(a)&&u?u:e.extend(!0,n,u);delete s.data}var c={data:n,success:function(e){var n=e.error||e.sError;n&&t.oApi._fnLog(t,0,n);t.json=e;zt(t,null,"xhr",[t,e]);r(e)},dataType:"json",cache:!1,type:t.sServerMethod,error:function(e,n){var r=t.oApi._fnLog;"parsererror"==n?r(t,0,"Invalid JSON response",1):4===e.readyState&&r(t,0,"Ajax error",7);pt(t,!1)}};t.oAjaxData=n;zt(t,null,"preXhr",[t,n]);if(t.fnServerData)t.fnServerData.call(l,t.sAjaxSource,e.map(n,function(e,t){return{name:t,value:e}}),r,t);else if(t.sAjaxSource||"string"==typeof s)t.jqXHR=e.ajax(e.extend(c,{url:s||t.sAjaxSource}));else if(e.isFunction(s))t.jqXHR=s.call(l,n,r,t);else{t.jqXHR=e.ajax(e.extend(c,s));s.data=a}}function U(e){if(e.bAjaxDataGet){e.iDraw++;pt(e,!0);q(e,V(e),function(t){G(e,t)});return!1}return!0}function V(t){var n,r,i,o,a=t.aoColumns,s=a.length,l=t.oFeatures,u=t.oPreviousSearch,c=t.aoPreSearchCols,f=[],d=Dt(t),h=t._iDisplayStart,p=l.bPaginate!==!1?t._iDisplayLength:-1,g=function(e,t){f.push({name:e,value:t})};g("sEcho",t.iDraw);g("iColumns",s);g("sColumns",hn(a,"sName").join(","));g("iDisplayStart",h);g("iDisplayLength",p);var m={draw:t.iDraw,columns:[],order:[],start:h,length:p,search:{value:u.sSearch,regex:u.bRegex}};for(n=0;s>n;n++){i=a[n];o=c[n];r="function"==typeof i.mData?"function":i.mData;m.columns.push({data:r,name:i.sName,searchable:i.bSearchable,orderable:i.bSortable,search:{value:o.sSearch,regex:o.bRegex}});g("mDataProp_"+n,r);if(l.bFilter){g("sSearch_"+n,o.sSearch);g("bRegex_"+n,o.bRegex);g("bSearchable_"+n,i.bSearchable)}l.bSort&&g("bSortable_"+n,i.bSortable)}if(l.bFilter){g("sSearch",u.sSearch);g("bRegex",u.bRegex)}if(l.bSort){e.each(d,function(e,t){m.order.push({column:t.col,dir:t.dir});g("iSortCol_"+e,t.col);g("sSortDir_"+e,t.dir)});g("iSortingCols",d.length)}var v=Xt.ext.legacy.ajax;return null===v?t.sAjaxSource?f:m:v?f:m}function G(e,t){var n=function(e,n){return t[e]!==o?t[e]:t[n]},r=n("sEcho","draw"),i=n("iTotalRecords","recordsTotal"),a=n("iTotalDisplayRecords","recordsFiltered");if(r){if(1*r<e.iDraw)return;e.iDraw=1*r}_(e);e._iRecordsTotal=parseInt(i,10);e._iRecordsDisplay=parseInt(a,10);for(var s=$(e,t),l=0,u=s.length;u>l;l++)x(e,s[l]);e.aiDisplay=e.aiDisplayMaster.slice();e.bAjaxDataGet=!1;P(e);e._bInitComplete||lt(e,t);e.bAjaxDataGet=!0;pt(e,!1)}function $(t,n){var r=e.isPlainObject(t.ajax)&&t.ajax.dataSrc!==o?t.ajax.dataSrc:t.sAjaxDataProp;return"data"===r?n.aaData||n[r]:""!==r?L(r)(n):n}function X(t){var n=t.oClasses,r=t.sTableId,o=t.oLanguage,a=t.oPreviousSearch,s=t.aanFeatures,l='<input type="search" class="'+n.sFilterInput+'"/>',u=o.sSearch;u=u.match(/_INPUT_/)?u.replace("_INPUT_",l):u+l;var c=e("<div/>",{id:s.f?null:r+"_filter","class":n.sFilter}).append(e("<label/>").append(u)),f=function(){var e=(s.f,this.value?this.value:"");if(e!=a.sSearch){J(t,{sSearch:e,bRegex:a.bRegex,bSmart:a.bSmart,bCaseInsensitive:a.bCaseInsensitive});t._iDisplayStart=0;P(t)}},d=e("input",c).val(a.sSearch).attr("placeholder",o.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT","ssp"===Ut(t)?bt(f,400):f).bind("keypress.DT",function(e){return 13==e.keyCode?!1:void 0}).attr("aria-controls",r);e(t.nTable).on("search.dt.DT",function(e,n){if(t===n)try{d[0]!==i.activeElement&&d.val(a.sSearch)}catch(r){}});return c[0]}function J(e,t,n){var r=e.oPreviousSearch,i=e.aoPreSearchCols,a=function(e){r.sSearch=e.sSearch;r.bRegex=e.bRegex;r.bSmart=e.bSmart;r.bCaseInsensitive=e.bCaseInsensitive},s=function(e){return e.bEscapeRegex!==o?!e.bEscapeRegex:e.bRegex};y(e);if("ssp"!=Ut(e)){Q(e,t.sSearch,n,s(t),t.bSmart,t.bCaseInsensitive);a(t);for(var l=0;l<i.length;l++)K(e,i[l].sSearch,l,s(i[l]),i[l].bSmart,i[l].bCaseInsensitive);Y(e)}else a(t);e.bFiltered=!0;zt(e,null,"search",[e])}function Y(e){for(var t,n,r=Xt.ext.search,i=e.aiDisplay,o=0,a=r.length;a>o;o++){for(var s=[],l=0,u=i.length;u>l;l++){n=i[l];t=e.aoData[n];r[o](e,t._aFilterData,n,t._aData,l)&&s.push(n)}i.length=0;i.push.apply(i,s)}}function K(e,t,n,r,i,o){if(""!==t)for(var a,s=e.aiDisplay,l=Z(t,r,i,o),u=s.length-1;u>=0;u--){a=e.aoData[s[u]]._aFilterData[n];l.test(a)||s.splice(u,1)}}function Q(e,t,n,r,i,o){var a,s,l,u=Z(t,r,i,o),c=e.oPreviousSearch.sSearch,f=e.aiDisplayMaster;0!==Xt.ext.search.length&&(n=!0);s=tt(e);if(t.length<=0)e.aiDisplay=f.slice();else{(s||n||c.length>t.length||0!==t.indexOf(c)||e.bSorted)&&(e.aiDisplay=f.slice());a=e.aiDisplay;for(l=a.length-1;l>=0;l--)u.test(e.aoData[a[l]]._sFilterRow)||a.splice(l,1)}}function Z(t,n,r,i){t=n?t:et(t);if(r){var o=e.map(t.match(/"[^"]+"|[^ ]+/g)||"",function(e){return'"'===e.charAt(0)?e.match(/^"(.*)"$/)[1]:e});t="^(?=.*?"+o.join(")(?=.*?")+").*$"}return new RegExp(t,i?"i":"")}function et(e){return e.replace(on,"\\$1")}function tt(e){var t,n,r,i,o,a,s,l,u=e.aoColumns,c=Xt.ext.type.search,f=!1;for(n=0,i=e.aoData.length;i>n;n++){l=e.aoData[n];if(!l._aFilterData){a=[];for(r=0,o=u.length;o>r;r++){t=u[r];if(t.bSearchable){s=T(e,n,r,"filter");c[t.sType]&&(s=c[t.sType](s));null===s&&(s="");"string"!=typeof s&&s.toString&&(s=s.toString())}else s="";if(s.indexOf&&-1!==s.indexOf("&")){wn.innerHTML=s;s=Cn?wn.textContent:wn.innerText}s.replace&&(s=s.replace(/[\r\n]/g,""));a.push(s)}l._aFilterData=a;l._sFilterRow=a.join(" ");f=!0}}return f}function nt(e){return{search:e.sSearch,smart:e.bSmart,regex:e.bRegex,caseInsensitive:e.bCaseInsensitive}}function rt(e){return{sSearch:e.search,bSmart:e.smart,bRegex:e.regex,bCaseInsensitive:e.caseInsensitive}}function it(t){var n=t.sTableId,r=t.aanFeatures.i,i=e("<div/>",{"class":t.oClasses.sInfo,id:r?null:n+"_info"});if(!r){t.aoDrawCallback.push({fn:ot,sName:"information"});i.attr("role","status").attr("aria-live","polite");e(t.nTable).attr("aria-describedby",n+"_info")}return i[0]}function ot(t){var n=t.aanFeatures.i;if(0!==n.length){var r=t.oLanguage,i=t._iDisplayStart+1,o=t.fnDisplayEnd(),a=t.fnRecordsTotal(),s=t.fnRecordsDisplay(),l=s?r.sInfo:r.sInfoEmpty;s!==a&&(l+=" "+r.sInfoFiltered);l+=r.sInfoPostFix;l=at(t,l);var u=r.fnInfoCallback;null!==u&&(l=u.call(t.oInstance,t,i,o,a,s,l));e(n).html(l)}}function at(e,t){var n=e.fnFormatNumber,r=e._iDisplayStart+1,i=e._iDisplayLength,o=e.fnRecordsDisplay(),a=-1===i;return t.replace(/_START_/g,n.call(e,r)).replace(/_END_/g,n.call(e,e.fnDisplayEnd())).replace(/_MAX_/g,n.call(e,e.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(e,o)).replace(/_PAGE_/g,n.call(e,a?1:Math.ceil(r/i))).replace(/_PAGES_/g,n.call(e,a?1:Math.ceil(o/i)))}function st(e){var t,n,r,i=e.iInitDisplayStart,o=e.aoColumns,a=e.oFeatures;if(e.bInitialised){W(e);O(e);F(e,e.aoHeader);F(e,e.aoFooter);pt(e,!0);a.bAutoWidth&&yt(e);for(t=0,n=o.length;n>t;t++){r=o[t];r.sWidth&&(r.nTh.style.width=Tt(r.sWidth))}R(e);var s=Ut(e);if("ssp"!=s)if("ajax"==s)q(e,[],function(n){var r=$(e,n);for(t=0;t<r.length;t++)x(e,r[t]);e.iInitDisplayStart=i;R(e);pt(e,!1);lt(e,n)},e);else{pt(e,!1);lt(e)}}else setTimeout(function(){st(e)},200)}function lt(e,t){e._bInitComplete=!0;t&&h(e);zt(e,"aoInitComplete","init",[e,t])}function ut(e,t){var n=parseInt(t,10);e._iDisplayLength=n;Bt(e);zt(e,null,"length",[e,n])}function ct(t){for(var n=t.oClasses,r=t.sTableId,i=t.aLengthMenu,o=e.isArray(i[0]),a=o?i[0]:i,s=o?i[1]:i,l=e("<select/>",{name:r+"_length","aria-controls":r,"class":n.sLengthSelect}),u=0,c=a.length;c>u;u++)l[0][u]=new Option(s[u],a[u]);var f=e("<div><label/></div>").addClass(n.sLength);t.aanFeatures.l||(f[0].id=r+"_length");f.children().append(t.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML));e("select",f).val(t._iDisplayLength).bind("change.DT",function(){ut(t,e(this).val());P(t)});e(t.nTable).bind("length.dt.DT",function(n,r,i){t===r&&e("select",f).val(i)});return f[0]}function ft(t){var n=t.sPaginationType,r=Xt.ext.pager[n],i="function"==typeof r,o=function(e){P(e)},a=e("<div/>").addClass(t.oClasses.sPaging+n)[0],s=t.aanFeatures;i||r.fnInit(t,a,o);if(!s.p){a.id=t.sTableId+"_paginate";t.aoDrawCallback.push({fn:function(e){if(i){var t,n,a=e._iDisplayStart,l=e._iDisplayLength,u=e.fnRecordsDisplay(),c=-1===l,f=c?0:Math.ceil(a/l),d=c?1:Math.ceil(u/l),h=r(f,d);for(t=0,n=s.p.length;n>t;t++)qt(e,"pageButton")(e,s.p[t],t,h,f,d)}else r.fnUpdate(e,o)},sName:"pagination"})}return a}function dt(e,t,n){var r=e._iDisplayStart,i=e._iDisplayLength,o=e.fnRecordsDisplay();if(0===o||-1===i)r=0;else if("number"==typeof t){r=t*i;r>o&&(r=0)}else if("first"==t)r=0;else if("previous"==t){r=i>=0?r-i:0;0>r&&(r=0)}else"next"==t?o>r+i&&(r+=i):"last"==t?r=Math.floor((o-1)/i)*i:Ot(e,0,"Unknown paging action: "+t,5);var a=e._iDisplayStart!==r;e._iDisplayStart=r;if(a){zt(e,null,"page",[e]);n&&P(e)}return a}function ht(t){return e("<div/>",{id:t.aanFeatures.r?null:t.sTableId+"_processing","class":t.oClasses.sProcessing}).html(t.oLanguage.sProcessing).insertBefore(t.nTable)[0]}function pt(t,n){t.oFeatures.bProcessing&&e(t.aanFeatures.r).css("display",n?"block":"none");zt(t,null,"processing",[t,n])}function gt(t){var n=e(t.nTable);n.attr("role","grid");var r=t.oScroll;if(""===r.sX&&""===r.sY)return t.nTable;var i=r.sX,o=r.sY,a=t.oClasses,s=n.children("caption"),l=s.length?s[0]._captionSide:null,u=e(n[0].cloneNode(!1)),c=e(n[0].cloneNode(!1)),f=n.children("tfoot"),d="<div/>",h=function(e){return e?Tt(e):null};r.sX&&"100%"===n.attr("width")&&n.removeAttr("width");f.length||(f=null);var p=e(d,{"class":a.sScrollWrapper}).append(e(d,{"class":a.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:i?h(i):"100%"}).append(e(d,{"class":a.sScrollHeadInner}).css({"box-sizing":"content-box",width:r.sXInner||"100%"}).append(u.removeAttr("id").css("margin-left",0).append(n.children("thead")))).append("top"===l?s:null)).append(e(d,{"class":a.sScrollBody}).css({overflow:"auto",height:h(o),width:h(i)}).append(n));f&&p.append(e(d,{"class":a.sScrollFoot}).css({overflow:"hidden",border:0,width:i?h(i):"100%"}).append(e(d,{"class":a.sScrollFootInner}).append(c.removeAttr("id").css("margin-left",0).append(n.children("tfoot")))).append("bottom"===l?s:null));var g=p.children(),m=g[0],v=g[1],y=f?g[2]:null;i&&e(v).scroll(function(){var e=this.scrollLeft;m.scrollLeft=e;f&&(y.scrollLeft=e)});t.nScrollHead=m;t.nScrollBody=v;t.nScrollFoot=y;t.aoDrawCallback.push({fn:mt,sName:"scrolling"});return p[0]}function mt(t){var n,r,i,o,a,s,l,u,c,f=t.oScroll,d=f.sX,h=f.sXInner,g=f.sY,m=f.iBarWidth,v=e(t.nScrollHead),y=v[0].style,b=v.children("div"),x=b[0].style,w=b.children("table"),C=t.nScrollBody,S=e(C),T=C.style,k=e(t.nScrollFoot),D=k.children("div"),L=D.children("table"),A=e(t.nTHead),N=e(t.nTable),_=N[0],M=_.style,E=t.nTFoot?e(t.nTFoot):null,j=t.oBrowser,I=j.bScrollOversize,H=[],O=[],F=[],P=function(e){var t=e.style;t.paddingTop="0";t.paddingBottom="0";t.borderTopWidth="0";t.borderBottomWidth="0";t.height=0};N.children("thead, tfoot").remove();a=A.clone().prependTo(N);n=A.find("tr");i=a.find("tr");a.find("th, td").removeAttr("tabindex");if(E){s=E.clone().prependTo(N);r=E.find("tr");o=s.find("tr")}if(!d){T.width="100%";v[0].style.width="100%"}e.each(B(t,a),function(e,n){l=p(t,e);n.style.width=t.aoColumns[l].sWidth});E&&vt(function(e){e.style.width=""},o);f.bCollapse&&""!==g&&(T.height=S[0].offsetHeight+A[0].offsetHeight+"px");c=N.outerWidth();if(""===d){M.width="100%";I&&(N.find("tbody").height()>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(M.width=Tt(N.outerWidth()-m))}else if(""!==h)M.width=Tt(h);else if(c==S.width()&&S.height()<N.height()){M.width=Tt(c-m);N.outerWidth()>c-m&&(M.width=Tt(c))}else M.width=Tt(c);c=N.outerWidth();vt(P,i);vt(function(t){F.push(t.innerHTML);H.push(Tt(e(t).css("width")))},i);vt(function(e,t){e.style.width=H[t]},n);e(i).height(0);if(E){vt(P,o);vt(function(t){O.push(Tt(e(t).css("width")))},o);vt(function(e,t){e.style.width=O[t]},r);e(o).height(0)}vt(function(e,t){e.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+F[t]+"</div>";e.style.width=H[t]},i);E&&vt(function(e,t){e.innerHTML="";e.style.width=O[t]},o);if(N.outerWidth()<c){u=C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y")?c+m:c;I&&(C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(M.width=Tt(u-m));(""===d||""!==h)&&Ot(t,1,"Possible column misalignment",6)}else u="100%";T.width=Tt(u);y.width=Tt(u);E&&(t.nScrollFoot.style.width=Tt(u));g||I&&(T.height=Tt(_.offsetHeight+m));if(g&&f.bCollapse){T.height=Tt(g);var R=d&&_.offsetWidth>C.offsetWidth?m:0; _.offsetHeight<C.offsetHeight&&(T.height=Tt(_.offsetHeight+R))}var W=N.outerWidth();w[0].style.width=Tt(W);x.width=Tt(W);var z=N.height()>C.clientHeight||"scroll"==S.css("overflow-y"),q="padding"+(j.bScrollbarLeft?"Left":"Right");x[q]=z?m+"px":"0px";if(E){L[0].style.width=Tt(W);D[0].style.width=Tt(W);D[0].style[q]=z?m+"px":"0px"}S.scroll();!t.bSorted&&!t.bFiltered||t._drawHold||(C.scrollTop=0)}function vt(e,t,n){for(var r,i,o=0,a=0,s=t.length;s>a;){r=t[a].firstChild;i=n?n[a].firstChild:null;for(;r;){if(1===r.nodeType){n?e(r,i,o):e(r,o);o++}r=r.nextSibling;i=n?i.nextSibling:null}a++}}function yt(t){var r,i,o,a,s,l=t.nTable,u=t.aoColumns,c=t.oScroll,f=c.sY,d=c.sX,p=c.sXInner,g=u.length,y=v(t,"bVisible"),b=e("th",t.nTHead),x=l.getAttribute("width"),w=l.parentNode,C=!1;for(r=0;r<y.length;r++){i=u[y[r]];if(null!==i.sWidth){i.sWidth=xt(i.sWidthOrig,w);C=!0}}if(C||d||f||g!=m(t)||g!=b.length){var S=e(l).clone().empty().css("visibility","hidden").removeAttr("id").append(e(t.nTHead).clone(!1)).append(e(t.nTFoot).clone(!1)).append(e("<tbody><tr/></tbody>"));S.find("tfoot th, tfoot td").css("width","");var T=S.find("tbody tr");b=B(t,S.find("thead")[0]);for(r=0;r<y.length;r++){i=u[y[r]];b[r].style.width=null!==i.sWidthOrig&&""!==i.sWidthOrig?Tt(i.sWidthOrig):""}if(t.aoData.length)for(r=0;r<y.length;r++){o=y[r];i=u[o];e(Ct(t,o)).clone(!1).append(i.sContentPadding).appendTo(T)}S.appendTo(w);if(d&&p)S.width(p);else if(d){S.css("width","auto");S.width()<w.offsetWidth&&S.width(w.offsetWidth)}else f?S.width(w.offsetWidth):x&&S.width(x);wt(t,S[0]);if(d){var k=0;for(r=0;r<y.length;r++){i=u[y[r]];s=e(b[r]).outerWidth();k+=null===i.sWidthOrig?s:parseInt(i.sWidth,10)+s-e(b[r]).width()}S.width(Tt(k));l.style.width=Tt(k)}for(r=0;r<y.length;r++){i=u[y[r]];a=e(b[r]).width();a&&(i.sWidth=Tt(a))}l.style.width=Tt(S.css("width"));S.remove()}else for(r=0;g>r;r++)u[r].sWidth=Tt(b.eq(r).width());x&&(l.style.width=Tt(x));if((x||d)&&!t._reszEvt){e(n).bind("resize.DT-"+t.sInstance,bt(function(){h(t)}));t._reszEvt=!0}}function bt(e,t){var n,r,i=t||200;return function(){var t=this,a=+new Date,s=arguments;if(n&&n+i>a){clearTimeout(r);r=setTimeout(function(){n=o;e.apply(t,s)},i)}else if(n){n=a;e.apply(t,s)}else n=a}}function xt(t,n){if(!t)return 0;var r=e("<div/>").css("width",Tt(t)).appendTo(n||i.body),o=r[0].offsetWidth;r.remove();return o}function wt(t,n){var r=t.oScroll;if(r.sX||r.sY){var i=r.sX?0:r.iBarWidth;n.style.width=Tt(e(n).outerWidth()-i)}}function Ct(t,n){var r=St(t,n);if(0>r)return null;var i=t.aoData[r];return i.nTr?i.anCells[n]:e("<td/>").html(T(t,r,n,"display"))[0]}function St(e,t){for(var n,r=-1,i=-1,o=0,a=e.aoData.length;a>o;o++){n=T(e,o,t,"display")+"";n=n.replace(Sn,"");if(n.length>r){r=n.length;i=o}}return i}function Tt(e){return null===e?"0px":"number"==typeof e?0>e?"0px":e+"px":e.match(/\d$/)?e+"px":e}function kt(){if(!Xt.__scrollbarWidth){var t=e("<p/>").css({width:"100%",height:200,padding:0})[0],n=e("<div/>").css({position:"absolute",top:0,left:0,width:200,height:150,padding:0,overflow:"hidden",visibility:"hidden"}).append(t).appendTo("body"),r=t.offsetWidth;n.css("overflow","scroll");var i=t.offsetWidth;r===i&&(i=n[0].clientWidth);n.remove();Xt.__scrollbarWidth=r-i}return Xt.__scrollbarWidth}function Dt(t){var n,r,i,o,a,s,l,u=[],c=t.aoColumns,f=t.aaSortingFixed,d=e.isPlainObject(f),h=[],p=function(t){t.length&&!e.isArray(t[0])?h.push(t):h.push.apply(h,t)};e.isArray(f)&&p(f);d&&f.pre&&p(f.pre);p(t.aaSorting);d&&f.post&&p(f.post);for(n=0;n<h.length;n++){l=h[n][0];o=c[l].aDataSort;for(r=0,i=o.length;i>r;r++){a=o[r];s=c[a].sType||"string";u.push({src:l,col:a,dir:h[n][1],index:h[n][2],type:s,formatter:Xt.ext.type.order[s+"-pre"]})}}return u}function Lt(e){var t,n,r,i,o,a=[],s=Xt.ext.type.order,l=e.aoData,u=(e.aoColumns,0),c=e.aiDisplayMaster;y(e);o=Dt(e);for(t=0,n=o.length;n>t;t++){i=o[t];i.formatter&&u++;Et(e,i.col)}if("ssp"!=Ut(e)&&0!==o.length){for(t=0,r=c.length;r>t;t++)a[c[t]]=t;c.sort(u===o.length?function(e,t){var n,r,i,s,u,c=o.length,f=l[e]._aSortData,d=l[t]._aSortData;for(i=0;c>i;i++){u=o[i];n=f[u.col];r=d[u.col];s=r>n?-1:n>r?1:0;if(0!==s)return"asc"===u.dir?s:-s}n=a[e];r=a[t];return r>n?-1:n>r?1:0}:function(e,t){var n,r,i,u,c,f,d=o.length,h=l[e]._aSortData,p=l[t]._aSortData;for(i=0;d>i;i++){c=o[i];n=h[c.col];r=p[c.col];f=s[c.type+"-"+c.dir]||s["string-"+c.dir];u=f(n,r);if(0!==u)return u}n=a[e];r=a[t];return r>n?-1:n>r?1:0})}e.bSorted=!0}function At(e){for(var t,n,r=e.aoColumns,i=Dt(e),o=e.oLanguage.oAria,a=0,s=r.length;s>a;a++){var l=r[a],u=l.asSorting,c=l.sTitle.replace(/<.*?>/g,""),f=l.nTh;f.removeAttribute("aria-sort");if(l.bSortable){if(i.length>0&&i[0].col==a){f.setAttribute("aria-sort","asc"==i[0].dir?"ascending":"descending");n=u[i[0].index+1]||u[0]}else n=u[0];t=c+("asc"===n?o.sSortAscending:o.sSortDescending)}else t=c;f.setAttribute("aria-label",t)}}function Nt(t,n,r,i){var a,s=t.aoColumns[n],l=t.aaSorting,u=s.asSorting,c=function(t){var n=t._idx;n===o&&(n=e.inArray(t[1],u));return n+1>=u.length?0:n+1};"number"==typeof l[0]&&(l=t.aaSorting=[l]);if(r&&t.oFeatures.bSortMulti){var f=e.inArray(n,hn(l,"0"));if(-1!==f){a=c(l[f]);l[f][1]=u[a];l[f]._idx=a}else{l.push([n,u[0],0]);l[l.length-1]._idx=0}}else if(l.length&&l[0][0]==n){a=c(l[0]);l.length=1;l[0][1]=u[a];l[0]._idx=a}else{l.length=0;l.push([n,u[0]]);l[0]._idx=0}R(t);"function"==typeof i&&i(t)}function _t(e,t,n,r){var i=e.aoColumns[n];Rt(t,{},function(t){if(i.bSortable!==!1)if(e.oFeatures.bProcessing){pt(e,!0);setTimeout(function(){Nt(e,n,t.shiftKey,r);"ssp"!==Ut(e)&&pt(e,!1)},0)}else Nt(e,n,t.shiftKey,r)})}function Mt(t){var n,r,i,o=t.aLastSort,a=t.oClasses.sSortColumn,s=Dt(t),l=t.oFeatures;if(l.bSort&&l.bSortClasses){for(n=0,r=o.length;r>n;n++){i=o[n].src;e(hn(t.aoData,"anCells",i)).removeClass(a+(2>n?n+1:3))}for(n=0,r=s.length;r>n;n++){i=s[n].src;e(hn(t.aoData,"anCells",i)).addClass(a+(2>n?n+1:3))}}t.aLastSort=s}function Et(e,t){var n,r=e.aoColumns[t],i=Xt.ext.order[r.sSortDataType];i&&(n=i.call(e.oInstance,e,t,g(e,t)));for(var o,a,s=Xt.ext.type.order[r.sType+"-pre"],l=0,u=e.aoData.length;u>l;l++){o=e.aoData[l];o._aSortData||(o._aSortData=[]);if(!o._aSortData[t]||i){a=i?n[l]:T(e,l,t,"sort");o._aSortData[t]=s?s(a):a}}}function jt(t){if(t.oFeatures.bStateSave&&!t.bDestroying){var n={time:+new Date,start:t._iDisplayStart,length:t._iDisplayLength,order:e.extend(!0,[],t.aaSorting),search:nt(t.oPreviousSearch),columns:e.map(t.aoColumns,function(e,n){return{visible:e.bVisible,search:nt(t.aoPreSearchCols[n])}})};zt(t,"aoStateSaveParams","stateSaveParams",[t,n]);t.oSavedState=n;t.fnStateSaveCallback.call(t.oInstance,t,n)}}function It(t){var n,r,i=t.aoColumns;if(t.oFeatures.bStateSave){var o=t.fnStateLoadCallback.call(t.oInstance,t);if(o&&o.time){var a=zt(t,"aoStateLoadParams","stateLoadParams",[t,o]);if(-1===e.inArray(!1,a)){var s=t.iStateDuration;if(!(s>0&&o.time<+new Date-1e3*s)&&i.length===o.columns.length){t.oLoadedState=e.extend(!0,{},o);t._iDisplayStart=o.start;t.iInitDisplayStart=o.start;t._iDisplayLength=o.length;t.aaSorting=[];e.each(o.order,function(e,n){t.aaSorting.push(n[0]>=i.length?[0,n[1]]:n)});e.extend(t.oPreviousSearch,rt(o.search));for(n=0,r=o.columns.length;r>n;n++){var l=o.columns[n];i[n].bVisible=l.visible;e.extend(t.aoPreSearchCols[n],rt(l.search))}zt(t,"aoStateLoaded","stateLoaded",[t,o])}}}}}function Ht(t){var n=Xt.settings,r=e.inArray(t,hn(n,"nTable"));return-1!==r?n[r]:null}function Ot(e,t,r,i){r="DataTables warning: "+(null!==e?"table id="+e.sTableId+" - ":"")+r;i&&(r+=". For more information about this error, please see http://datatables.net/tn/"+i);if(t)n.console&&console.log&&console.log(r);else{var o=Xt.ext,a=o.sErrMode||o.errMode;if("alert"!=a)throw new Error(r);alert(r)}}function Ft(t,n,r,i){if(e.isArray(r))e.each(r,function(r,i){e.isArray(i)?Ft(t,n,i[0],i[1]):Ft(t,n,i)});else{i===o&&(i=r);n[r]!==o&&(t[i]=n[r])}}function Pt(t,n,r){var i;for(var o in n)if(n.hasOwnProperty(o)){i=n[o];if(e.isPlainObject(i)){e.isPlainObject(t[o])||(t[o]={});e.extend(!0,t[o],i)}else t[o]=r&&"data"!==o&&"aaData"!==o&&e.isArray(i)?i.slice():i}return t}function Rt(t,n,r){e(t).bind("click.DT",n,function(e){t.blur();r(e)}).bind("keypress.DT",n,function(e){if(13===e.which){e.preventDefault();r(e)}}).bind("selectstart.DT",function(){return!1})}function Wt(e,t,n,r){n&&e[t].push({fn:n,sName:r})}function zt(t,n,r,i){var o=[];n&&(o=e.map(t[n].slice().reverse(),function(e){return e.fn.apply(t.oInstance,i)}));null!==r&&e(t.nTable).trigger(r+".dt",i);return o}function Bt(e){var t=e._iDisplayStart,n=e.fnDisplayEnd(),r=e._iDisplayLength;n===e.fnRecordsDisplay()&&(t=n-r);(-1===r||0>t)&&(t=0);e._iDisplayStart=t}function qt(t,n){var r=t.renderer,i=Xt.ext.renderer[n];return e.isPlainObject(r)&&r[n]?i[r[n]]||i._:"string"==typeof r?i[r]||i._:i._}function Ut(e){return e.oFeatures.bServerSide?"ssp":e.ajax||e.sAjaxSource?"ajax":"dom"}function Vt(e,t){var n=[],r=Vn.numbers_length,i=Math.floor(r/2);if(r>=t)n=gn(0,t);else if(i>=e){n=gn(0,r-2);n.push("ellipsis");n.push(t-1)}else if(e>=t-1-i){n=gn(t-(r-2),t);n.splice(0,0,"ellipsis");n.splice(0,0,0)}else{n=gn(e-1,e+2);n.push("ellipsis");n.push(t-1);n.splice(0,0,"ellipsis");n.splice(0,0,0)}n.DT_el="span";return n}function Gt(t){e.each({num:function(e){return Gn(e,t)},"num-fmt":function(e){return Gn(e,t,an)},"html-num":function(e){return Gn(e,t,tn)},"html-num-fmt":function(e){return Gn(e,t,tn,an)}},function(e,n){Jt.type.order[e+t+"-pre"]=n})}function $t(e){return function(){var t=[Ht(this[Xt.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return Xt.ext.internal[e].apply(this,t)}}var Xt,Jt,Yt,Kt,Qt,Zt={},en=/[\r\n]/g,tn=/<.*?>/g,nn=/^[\w\+\-]/,rn=/[\w\+\-]$/,on=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),an=/[',$£€¥%\u2009\u202F]/g,sn=function(e){return e&&e!==!0&&"-"!==e?!1:!0},ln=function(e){var t=parseInt(e,10);return!isNaN(t)&&isFinite(e)?t:null},un=function(e,t){Zt[t]||(Zt[t]=new RegExp(et(t),"g"));return"string"==typeof e?e.replace(/\./g,"").replace(Zt[t],"."):e},cn=function(e,t,n){var r="string"==typeof e;t&&r&&(e=un(e,t));n&&r&&(e=e.replace(an,""));return sn(e)||!isNaN(parseFloat(e))&&isFinite(e)},fn=function(e){return sn(e)||"string"==typeof e},dn=function(e,t,n){if(sn(e))return!0;var r=fn(e);return r&&cn(mn(e),t,n)?!0:null},hn=function(e,t,n){var r=[],i=0,a=e.length;if(n!==o)for(;a>i;i++)e[i]&&e[i][t]&&r.push(e[i][t][n]);else for(;a>i;i++)e[i]&&r.push(e[i][t]);return r},pn=function(e,t,n,r){var i=[],a=0,s=t.length;if(r!==o)for(;s>a;a++)i.push(e[t[a]][n][r]);else for(;s>a;a++)i.push(e[t[a]][n]);return i},gn=function(e,t){var n,r=[];if(t===o){t=0;n=e}else{n=t;t=e}for(var i=t;n>i;i++)r.push(i);return r},mn=function(e){return e.replace(tn,"")},vn=function(e){var t,n,r,i=[],o=e.length,a=0;e:for(n=0;o>n;n++){t=e[n];for(r=0;a>r;r++)if(i[r]===t)continue e;i.push(t);a++}return i},yn=function(e,t,n){e[t]!==o&&(e[n]=e[t])},bn=/\[.*?\]$/,xn=/\(\)$/,wn=e("<div>")[0],Cn=wn.textContent!==o,Sn=/<.*?>/g;Xt=function(t){this.$=function(e,t){return this.api(!0).$(e,t)};this._=function(e,t){return this.api(!0).rows(e,t).data()};this.api=function(e){return new Yt(e?Ht(this[Jt.iApiIndex]):this)};this.fnAddData=function(t,n){var r=this.api(!0),i=e.isArray(t)&&(e.isArray(t[0])||e.isPlainObject(t[0]))?r.rows.add(t):r.row.add(t);(n===o||n)&&r.draw();return i.flatten().toArray()};this.fnAdjustColumnSizing=function(e){var t=this.api(!0).columns.adjust(),n=t.settings()[0],r=n.oScroll;e===o||e?t.draw(!1):(""!==r.sX||""!==r.sY)&&mt(n)};this.fnClearTable=function(e){var t=this.api(!0).clear();(e===o||e)&&t.draw()};this.fnClose=function(e){this.api(!0).row(e).child.hide()};this.fnDeleteRow=function(e,t,n){var r=this.api(!0),i=r.rows(e),a=i.settings()[0],s=a.aoData[i[0][0]];i.remove();t&&t.call(this,a,s);(n===o||n)&&r.draw();return s};this.fnDestroy=function(e){this.api(!0).destroy(e)};this.fnDraw=function(e){this.api(!0).draw(!e)};this.fnFilter=function(e,t,n,r,i,a){var s=this.api(!0);null===t||t===o?s.search(e,n,r,a):s.column(t).search(e,n,r,a);s.draw()};this.fnGetData=function(e,t){var n=this.api(!0);if(e!==o){var r=e.nodeName?e.nodeName.toLowerCase():"";return t!==o||"td"==r||"th"==r?n.cell(e,t).data():n.row(e).data()||null}return n.data().toArray()};this.fnGetNodes=function(e){var t=this.api(!0);return e!==o?t.row(e).node():t.rows().nodes().flatten().toArray()};this.fnGetPosition=function(e){var t=this.api(!0),n=e.nodeName.toUpperCase();if("TR"==n)return t.row(e).index();if("TD"==n||"TH"==n){var r=t.cell(e).index();return[r.row,r.columnVisible,r.column]}return null};this.fnIsOpen=function(e){return this.api(!0).row(e).child.isShown()};this.fnOpen=function(e,t,n){return this.api(!0).row(e).child(t,n).show().child()[0]};this.fnPageChange=function(e,t){var n=this.api(!0).page(e);(t===o||t)&&n.draw(!1)};this.fnSetColumnVis=function(e,t,n){var r=this.api(!0).column(e).visible(t);(n===o||n)&&r.columns.adjust().draw()};this.fnSettings=function(){return Ht(this[Jt.iApiIndex])};this.fnSort=function(e){this.api(!0).order(e).draw()};this.fnSortListener=function(e,t,n){this.api(!0).order.listener(e,t,n)};this.fnUpdate=function(e,t,n,r,i){var a=this.api(!0);n===o||null===n?a.row(t).data(e):a.cell(t,n).data(e);(i===o||i)&&a.columns.adjust();(r===o||r)&&a.draw();return 0};this.fnVersionCheck=Jt.fnVersionCheck;var n=this,i=t===o,c=this.length;i&&(t={});this.oApi=this.internal=Jt.internal;for(var h in Xt.ext.internal)h&&(this[h]=$t(h));this.each(function(){var h,p={},g=c>1?Pt(p,t,!0):t,m=0,v=this.getAttribute("id"),y=!1,C=Xt.defaults;if("table"==this.nodeName.toLowerCase()){s(C);l(C.column);r(C,C,!0);r(C.column,C.column,!0);r(C,g);var S=Xt.settings;for(m=0,h=S.length;h>m;m++){if(S[m].nTable==this){var T=g.bRetrieve!==o?g.bRetrieve:C.bRetrieve,k=g.bDestroy!==o?g.bDestroy:C.bDestroy;if(i||T)return S[m].oInstance;if(k){S[m].oInstance.fnDestroy();break}Ot(S[m],0,"Cannot reinitialise DataTable",3);return}if(S[m].sTableId==this.id){S.splice(m,1);break}}if(null===v||""===v){v="DataTables_Table_"+Xt.ext._unique++;this.id=v}var D=e.extend(!0,{},Xt.models.oSettings,{nTable:this,oApi:n.internal,oInit:g,sDestroyWidth:e(this)[0].style.width,sInstance:v,sTableId:v});S.push(D);D.oInstance=1===n.length?n:e(this).dataTable();s(g);g.oLanguage&&a(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=e.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=Pt(e.extend(!0,{},C),g);Ft(D.oFeatures,g,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]);Ft(D,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);Ft(D.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);Ft(D.oLanguage,g,"fnInfoCallback");Wt(D,"aoDrawCallback",g.fnDrawCallback,"user");Wt(D,"aoServerParams",g.fnServerParams,"user");Wt(D,"aoStateSaveParams",g.fnStateSaveParams,"user");Wt(D,"aoStateLoadParams",g.fnStateLoadParams,"user");Wt(D,"aoStateLoaded",g.fnStateLoaded,"user");Wt(D,"aoRowCallback",g.fnRowCallback,"user");Wt(D,"aoRowCreatedCallback",g.fnCreatedRow,"user");Wt(D,"aoHeaderCallback",g.fnHeaderCallback,"user");Wt(D,"aoFooterCallback",g.fnFooterCallback,"user");Wt(D,"aoInitComplete",g.fnInitComplete,"user");Wt(D,"aoPreDrawCallback",g.fnPreDrawCallback,"user");var L=D.oClasses;if(g.bJQueryUI){e.extend(L,Xt.ext.oJUIClasses,g.oClasses);g.sDom===C.sDom&&"lfrtip"===C.sDom&&(D.sDom='<"H"lfr>t<"F"ip>');D.renderer?e.isPlainObject(D.renderer)&&!D.renderer.header&&(D.renderer.header="jqueryui"):D.renderer="jqueryui"}else e.extend(L,Xt.ext.classes,g.oClasses);e(this).addClass(L.sTable);(""!==D.oScroll.sX||""!==D.oScroll.sY)&&(D.oScroll.iBarWidth=kt());D.oScroll.sX===!0&&(D.oScroll.sX="100%");if(D.iInitDisplayStart===o){D.iInitDisplayStart=g.iDisplayStart;D._iDisplayStart=g.iDisplayStart}if(null!==g.iDeferLoading){D.bDeferLoading=!0;var A=e.isArray(g.iDeferLoading);D._iRecordsDisplay=A?g.iDeferLoading[0]:g.iDeferLoading;D._iRecordsTotal=A?g.iDeferLoading[1]:g.iDeferLoading}if(""!==g.oLanguage.sUrl){D.oLanguage.sUrl=g.oLanguage.sUrl;e.getJSON(D.oLanguage.sUrl,null,function(t){a(t);r(C.oLanguage,t);e.extend(!0,D.oLanguage,g.oLanguage,t);st(D)});y=!0}else e.extend(!0,D.oLanguage,g.oLanguage);null===g.asStripeClasses&&(D.asStripeClasses=[L.sStripeOdd,L.sStripeEven]);var N=D.asStripeClasses,_=e("tbody tr:eq(0)",this);if(-1!==e.inArray(!0,e.map(N,function(e){return _.hasClass(e)}))){e("tbody tr",this).removeClass(N.join(" "));D.asDestroyStripes=N.slice()}var M,E=[],I=this.getElementsByTagName("thead");if(0!==I.length){z(D.aoHeader,I[0]);E=B(D)}if(null===g.aoColumns){M=[];for(m=0,h=E.length;h>m;m++)M.push(null)}else M=g.aoColumns;for(m=0,h=M.length;h>m;m++)f(D,E?E[m]:null);b(D,g.aoColumnDefs,M,function(e,t){d(D,e,t)});if(_.length){var H=function(e,t){return e.getAttribute("data-"+t)?t:null};e.each(j(D,_[0]).cells,function(e,t){var n=D.aoColumns[e];if(n.mData===e){var r=H(t,"sort")||H(t,"order"),i=H(t,"filter")||H(t,"search");if(null!==r||null!==i){n.mData={_:e+".display",sort:null!==r?e+".@data-"+r:o,type:null!==r?e+".@data-"+r:o,filter:null!==i?e+".@data-"+i:o};d(D,e)}}})}var O=D.oFeatures;if(g.bStateSave){O.bStateSave=!0;It(D,g);Wt(D,"aoDrawCallback",jt,"state_save")}if(g.aaSorting===o){var F=D.aaSorting;for(m=0,h=F.length;h>m;m++)F[m][1]=D.aoColumns[m].asSorting[0]}Mt(D);O.bSort&&Wt(D,"aoDrawCallback",function(){if(D.bSorted){var t=Dt(D),n={};e.each(t,function(e,t){n[t.src]=t.dir});zt(D,null,"order",[D,t,n]);At(D)}});Wt(D,"aoDrawCallback",function(){(D.bSorted||"ssp"===Ut(D)||O.bDeferRender)&&Mt(D)},"sc");u(D);var P=e(this).children("caption").each(function(){this._captionSide=e(this).css("caption-side")}),R=e(this).children("thead");0===R.length&&(R=e("<thead/>").appendTo(this));D.nTHead=R[0];var W=e(this).children("tbody");0===W.length&&(W=e("<tbody/>").appendTo(this));D.nTBody=W[0];var q=e(this).children("tfoot");0===q.length&&P.length>0&&(""!==D.oScroll.sX||""!==D.oScroll.sY)&&(q=e("<tfoot/>").appendTo(this));if(0===q.length||0===q.children().length)e(this).addClass(L.sNoFooter);else if(q.length>0){D.nTFoot=q[0];z(D.aoFooter,D.nTFoot)}if(g.aaData)for(m=0;m<g.aaData.length;m++)x(D,g.aaData[m]);else(D.bDeferLoading||"dom"==Ut(D))&&w(D,e(D.nTBody).children("tr"));D.aiDisplay=D.aiDisplayMaster.slice();D.bInitialised=!0;y===!1&&st(D)}else Ot(null,0,"Non-table node initialisation ("+this.nodeName+")",2)});n=null;return this};var Tn=[],kn=Array.prototype,Dn=function(t){var n,r,i=Xt.settings,o=e.map(i,function(e){return e.nTable});if(!t)return[];if(t.nTable&&t.oApi)return[t];if(t.nodeName&&"table"===t.nodeName.toLowerCase()){n=e.inArray(t,o);return-1!==n?[i[n]]:null}if(t&&"function"==typeof t.settings)return t.settings().toArray();"string"==typeof t?r=e(t):t instanceof e&&(r=t);return r?r.map(function(){n=e.inArray(this,o);return-1!==n?i[n]:null}).toArray():void 0};Yt=function(t,n){if(!this instanceof Yt)throw"DT API must be constructed as a new object";var r=[],i=function(e){var t=Dn(e);t&&r.push.apply(r,t)};if(e.isArray(t))for(var o=0,a=t.length;a>o;o++)i(t[o]);else i(t);this.context=vn(r);n&&this.push.apply(this,n.toArray?n.toArray():n);this.selector={rows:null,cols:null,opts:null};Yt.extend(this,this,Tn)};Xt.Api=Yt;Yt.prototype={concat:kn.concat,context:[],each:function(e){for(var t=0,n=this.length;n>t;t++)e.call(this,this[t],t,this);return this},eq:function(e){var t=this.context;return t.length>e?new Yt(t[e],this[e]):null},filter:function(e){var t=[];if(kn.filter)t=kn.filter.call(this,e,this);else for(var n=0,r=this.length;r>n;n++)e.call(this,this[n],n,this)&&t.push(this[n]);return new Yt(this.context,t)},flatten:function(){var e=[];return new Yt(this.context,e.concat.apply(e,this.toArray()))},join:kn.join,indexOf:kn.indexOf||function(e,t){for(var n=t||0,r=this.length;r>n;n++)if(this[n]===e)return n;return-1},iterator:function(e,t,n){var r,i,a,s,l,u,c,f,d=[],h=this.context,p=this.selector;if("string"==typeof e){n=t;t=e;e=!1}for(i=0,a=h.length;a>i;i++)if("table"===t){r=n(h[i],i);r!==o&&d.push(r)}else if("columns"===t||"rows"===t){r=n(h[i],this[i],i);r!==o&&d.push(r)}else if("column"===t||"column-rows"===t||"row"===t||"cell"===t){c=this[i];"column-rows"===t&&(u=En(h[i],p.opts));for(s=0,l=c.length;l>s;s++){f=c[s];r="cell"===t?n(h[i],f.row,f.column,i,s):n(h[i],f,i,s,u);r!==o&&d.push(r)}}if(d.length){var g=new Yt(h,e?d.concat.apply([],d):d),m=g.selector;m.rows=p.rows;m.cols=p.cols;m.opts=p.opts;return g}return this},lastIndexOf:kn.lastIndexOf||function(){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(e){var t=[];if(kn.map)t=kn.map.call(this,e,this);else for(var n=0,r=this.length;r>n;n++)t.push(e.call(this,this[n],n));return new Yt(this.context,t)},pluck:function(e){return this.map(function(t){return t[e]})},pop:kn.pop,push:kn.push,reduce:kn.reduce||function(e,t){return c(this,e,t,0,this.length,1)},reduceRight:kn.reduceRight||function(e,t){return c(this,e,t,this.length-1,-1,-1)},reverse:kn.reverse,selector:null,shift:kn.shift,sort:kn.sort,splice:kn.splice,toArray:function(){return kn.slice.call(this)},to$:function(){return e(this)},toJQuery:function(){return e(this)},unique:function(){return new Yt(this.context,vn(this))},unshift:kn.unshift};Yt.extend=function(t,n,r){if(n&&(n instanceof Yt||n.__dt_wrapper)){var i,o,a,s=function(e,t,n){return function(){var r=t.apply(e,arguments);Yt.extend(r,r,n.methodExt);return r}};for(i=0,o=r.length;o>i;i++){a=r[i];n[a.name]="function"==typeof a.val?s(t,a.val,a):e.isPlainObject(a.val)?{}:a.val;n[a.name].__dt_wrapper=!0;Yt.extend(t,n[a.name],a.propExt)}}};Yt.register=Kt=function(t,n){if(e.isArray(t))for(var r=0,i=t.length;i>r;r++)Yt.register(t[r],n);else{var o,a,s,l,u=t.split("."),c=Tn,f=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n].name===t)return e[n];return null};for(o=0,a=u.length;a>o;o++){l=-1!==u[o].indexOf("()");s=l?u[o].replace("()",""):u[o];var d=f(c,s);if(!d){d={name:s,val:{},methodExt:[],propExt:[]};c.push(d)}o===a-1?d.val=n:c=l?d.methodExt:d.propExt}}};Yt.registerPlural=Qt=function(t,n,r){Yt.register(t,r);Yt.register(n,function(){var t=r.apply(this,arguments);return t===this?this:t instanceof Yt?t.length?e.isArray(t[0])?new Yt(t.context,t[0]):t[0]:o:t})};var Ln=function(t,n){if("number"==typeof t)return[n[t]];var r=e.map(n,function(e){return e.nTable});return e(r).filter(t).map(function(){var t=e.inArray(this,r);return n[t]}).toArray()};Kt("tables()",function(e){return e?new Yt(Ln(e,this.context)):this});Kt("table()",function(e){var t=this.tables(e),n=t.context;return n.length?new Yt(n[0]):t});Qt("tables().nodes()","table().node()",function(){return this.iterator("table",function(e){return e.nTable})});Qt("tables().body()","table().body()",function(){return this.iterator("table",function(e){return e.nTBody})});Qt("tables().header()","table().header()",function(){return this.iterator("table",function(e){return e.nTHead})});Qt("tables().footer()","table().footer()",function(){return this.iterator("table",function(e){return e.nTFoot})});Qt("tables().containers()","table().container()",function(){return this.iterator("table",function(e){return e.nTableWrapper})});Kt("draw()",function(e){return this.iterator("table",function(t){R(t,e===!1)})});Kt("page()",function(e){return e===o?this.page.info().page:this.iterator("table",function(t){dt(t,e)})});Kt("page.info()",function(){if(0===this.context.length)return o;var e=this.context[0],t=e._iDisplayStart,n=e._iDisplayLength,r=e.fnRecordsDisplay(),i=-1===n;return{page:i?0:Math.floor(t/n),pages:i?1:Math.ceil(r/n),start:t,end:e.fnDisplayEnd(),length:n,recordsTotal:e.fnRecordsTotal(),recordsDisplay:r}});Kt("page.len()",function(e){return e===o?0!==this.context.length?this.context[0]._iDisplayLength:o:this.iterator("table",function(t){ut(t,e)})});var An=function(e,t,n){if("ssp"==Ut(e))R(e,t);else{pt(e,!0);q(e,[],function(n){_(e);for(var r=$(e,n),i=0,o=r.length;o>i;i++)x(e,r[i]);R(e,t);pt(e,!1)})}if(n){var r=new Yt(e);r.one("draw",function(){n(r.ajax.json())})}};Kt("ajax.json()",function(){var e=this.context;return e.length>0?e[0].json:void 0});Kt("ajax.params()",function(){var e=this.context;return e.length>0?e[0].oAjaxData:void 0});Kt("ajax.reload()",function(e,t){return this.iterator("table",function(n){An(n,t===!1,e)})});Kt("ajax.url()",function(t){var n=this.context;if(t===o){if(0===n.length)return o;n=n[0];return n.ajax?e.isPlainObject(n.ajax)?n.ajax.url:n.ajax:n.sAjaxSource}return this.iterator("table",function(n){e.isPlainObject(n.ajax)?n.ajax.url=t:n.ajax=t})});Kt("ajax.url().load()",function(e,t){return this.iterator("table",function(n){An(n,t===!1,e)})});var Nn=function(t,n){var r,i,a,s,l,u,c=[];t&&"string"!=typeof t&&t.length!==o||(t=[t]);for(a=0,s=t.length;s>a;a++){i=t[a]&&t[a].split?t[a].split(","):[t[a]];for(l=0,u=i.length;u>l;l++){r=n("string"==typeof i[l]?e.trim(i[l]):i[l]);r&&r.length&&c.push.apply(c,r)}}return c},_n=function(e){e||(e={});e.filter&&!e.search&&(e.search=e.filter);return{search:e.search||"none",order:e.order||"current",page:e.page||"all"}},Mn=function(e){for(var t=0,n=e.length;n>t;t++)if(e[t].length>0){e[0]=e[t];e.length=1;e.context=[e.context[t]];return e}e.length=0;return e},En=function(t,n){var r,i,o,a=[],s=t.aiDisplay,l=t.aiDisplayMaster,u=n.search,c=n.order,f=n.page;if("ssp"==Ut(t))return"removed"===u?[]:gn(0,l.length);if("current"==f)for(r=t._iDisplayStart,i=t.fnDisplayEnd();i>r;r++)a.push(s[r]);else if("current"==c||"applied"==c)a="none"==u?l.slice():"applied"==u?s.slice():e.map(l,function(t){return-1===e.inArray(t,s)?t:null});else if("index"==c||"original"==c)for(r=0,i=t.aoData.length;i>r;r++)if("none"==u)a.push(r);else{o=e.inArray(r,s);(-1===o&&"removed"==u||o>=0&&"applied"==u)&&a.push(r)}return a},jn=function(t,n,r){return Nn(n,function(n){var i=ln(n);if(null!==i&&!r)return[i];var o=En(t,r);if(null!==i&&-1!==e.inArray(i,o))return[i];if(!n)return o;for(var a=[],s=0,l=o.length;l>s;s++)a.push(t.aoData[o[s]].nTr);return n.nodeName&&-1!==e.inArray(n,a)?[n._DT_RowIndex]:e(a).filter(n).map(function(){return this._DT_RowIndex}).toArray()})};Kt("rows()",function(t,n){if(t===o)t="";else if(e.isPlainObject(t)){n=t;t=""}n=_n(n);var r=this.iterator("table",function(e){return jn(e,t,n)});r.selector.rows=t;r.selector.opts=n;return r});Kt("rows().nodes()",function(){return this.iterator("row",function(e,t){return e.aoData[t].nTr||o})});Kt("rows().data()",function(){return this.iterator(!0,"rows",function(e,t){return pn(e.aoData,t,"_aData")})});Qt("rows().cache()","row().cache()",function(e){return this.iterator("row",function(t,n){var r=t.aoData[n];return"search"===e?r._aFilterData:r._aSortData})});Qt("rows().invalidate()","row().invalidate()",function(e){return this.iterator("row",function(t,n){E(t,n,e)})});Qt("rows().indexes()","row().index()",function(){return this.iterator("row",function(e,t){return t})});Qt("rows().remove()","row().remove()",function(){var t=this;return this.iterator("row",function(n,r,i){var o=n.aoData;o.splice(r,1);for(var a=0,s=o.length;s>a;a++)null!==o[a].nTr&&(o[a].nTr._DT_RowIndex=a);e.inArray(r,n.aiDisplay);M(n.aiDisplayMaster,r);M(n.aiDisplay,r);M(t[i],r,!1);Bt(n)})});Kt("rows.add()",function(e){var t=this.iterator("table",function(t){var n,r,i,o=[];for(r=0,i=e.length;i>r;r++){n=e[r];o.push(n.nodeName&&"TR"===n.nodeName.toUpperCase()?w(t,n)[0]:x(t,n))}return o}),n=this.rows(-1);n.pop();n.push.apply(n,t.toArray());return n});Kt("row()",function(e,t){return Mn(this.rows(e,t))});Kt("row().data()",function(e){var t=this.context;if(e===o)return t.length&&this.length?t[0].aoData[this[0]]._aData:o;t[0].aoData[this[0]]._aData=e;E(t[0],this[0],"data");return this});Kt("row().node()",function(){var e=this.context;return e.length&&this.length?e[0].aoData[this[0]].nTr||null:null});Kt("row.add()",function(t){t instanceof e&&t.length&&(t=t[0]);var n=this.iterator("table",function(e){return t.nodeName&&"TR"===t.nodeName.toUpperCase()?w(e,t)[0]:x(e,t)});return this.row(n[0])});var In=function(t,n,r,i){var o=[],a=function(n,r){if(n.nodeName&&"tr"===n.nodeName.toLowerCase())o.push(n);else{var i=e("<tr><td/></tr>").addClass(r);e("td",i).addClass(r).html(n)[0].colSpan=m(t);o.push(i[0])}};if(e.isArray(r)||r instanceof e)for(var s=0,l=r.length;l>s;s++)a(r[s],i);else a(r,i);n._details&&n._details.remove();n._details=e(o);n._detailsShow&&n._details.insertAfter(n.nTr)},Hn=function(e){var t=e.context;if(t.length&&e.length){var n=t[0].aoData[e[0]];if(n._details){n._details.remove();n._detailsShow=o;n._details=o}}},On=function(e,t){var n=e.context;if(n.length&&e.length){var r=n[0].aoData[e[0]];if(r._details){r._detailsShow=t;t?r._details.insertAfter(r.nTr):r._details.detach();Fn(n[0])}}},Fn=function(e){var t=new Yt(e),n=".dt.DT_details",r="draw"+n,i="column-visibility"+n,o="destroy"+n,a=e.aoData;t.off(r+" "+i+" "+o);if(hn(a,"_details").length>0){t.on(r,function(n,r){e===r&&t.rows({page:"current"}).eq(0).each(function(e){var t=a[e];t._detailsShow&&t._details.insertAfter(t.nTr)})});t.on(i,function(t,n){if(e===n)for(var r,i=m(n),o=0,s=a.length;s>o;o++){r=a[o];r._details&&r._details.children("td[colspan]").attr("colspan",i)}});t.on(o,function(t,n){if(e===n)for(var r=0,i=a.length;i>r;r++)a[r]._details&&Hn(a[r])})}},Pn="",Rn=Pn+"row().child",Wn=Rn+"()";Kt(Wn,function(e,t){var n=this.context;if(e===o)return n.length&&this.length?n[0].aoData[this[0]]._details:o;e===!0?this.child.show():e===!1?Hn(this):n.length&&this.length&&In(n[0],n[0].aoData[this[0]],e,t);return this});Kt([Rn+".show()",Wn+".show()"],function(){On(this,!0);return this});Kt([Rn+".hide()",Wn+".hide()"],function(){On(this,!1);return this});Kt([Rn+".remove()",Wn+".remove()"],function(){Hn(this);return this});Kt(Rn+".isShown()",function(){var e=this.context;return e.length&&this.length?e[0].aoData[this[0]]._detailsShow||!1:!1});var zn=/^(.+):(name|visIdx|visible)$/,Bn=function(t,n){var r=t.aoColumns,i=hn(r,"sName"),o=hn(r,"nTh");return Nn(n,function(n){var a=ln(n);if(""===n)return gn(r.length);if(null!==a)return[a>=0?a:r.length+a];var s="string"==typeof n?n.match(zn):"";if(!s)return e(o).filter(n).map(function(){return e.inArray(this,o)}).toArray();switch(s[2]){case"visIdx":case"visible":var l=parseInt(s[1],10);if(0>l){var u=e.map(r,function(e,t){return e.bVisible?t:null});return[u[u.length+l]]}return[p(t,l)];case"name":return e.map(i,function(e,t){return e===s[1]?t:null})}})},qn=function(t,n,r,i){var a,s,l,u,c=t.aoColumns,f=c[n],d=t.aoData;if(r===o)return f.bVisible;if(f.bVisible!==r){if(r){var p=e.inArray(!0,hn(c,"bVisible"),n+1);for(s=0,l=d.length;l>s;s++){u=d[s].nTr;a=d[s].anCells;u&&u.insertBefore(a[n],a[p]||null)}}else e(hn(t.aoData,"anCells",n)).detach();f.bVisible=r;F(t,t.aoHeader);F(t,t.aoFooter);if(i===o||i){h(t);(t.oScroll.sX||t.oScroll.sY)&&mt(t)}zt(t,null,"column-visibility",[t,n,r]);jt(t)}};Kt("columns()",function(t,n){if(t===o)t="";else if(e.isPlainObject(t)){n=t;t=""}n=_n(n);var r=this.iterator("table",function(e){return Bn(e,t,n)});r.selector.cols=t;r.selector.opts=n;return r});Qt("columns().header()","column().header()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t].nTh})});Qt("columns().footer()","column().footer()",function(){return this.iterator("column",function(e,t){return e.aoColumns[t].nTf})});Qt("columns().data()","column().data()",function(){return this.iterator("column-rows",function(e,t,n,r,i){for(var o=[],a=0,s=i.length;s>a;a++)o.push(T(e,i[a],t,""));return o})});Qt("columns().cache()","column().cache()",function(e){return this.iterator("column-rows",function(t,n,r,i,o){return pn(t.aoData,o,"search"===e?"_aFilterData":"_aSortData",n)})});Qt("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(e,t,n,r,i){return pn(e.aoData,i,"anCells",t) })});Qt("columns().visible()","column().visible()",function(e,t){return this.iterator("column",function(n,r){return e===o?n.aoColumns[r].bVisible:qn(n,r,e,t)})});Qt("columns().indexes()","column().index()",function(e){return this.iterator("column",function(t,n){return"visible"===e?g(t,n):n})});Kt("columns.adjust()",function(){return this.iterator("table",function(e){h(e)})});Kt("column.index()",function(e,t){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===e||"toData"===e)return p(n,t);if("fromData"===e||"toVisible"===e)return g(n,t)}});Kt("column()",function(e,t){return Mn(this.columns(e,t))});var Un=function(t,n,r){var i,a,s,l,u,c=t.aoData,f=En(t,r),d=pn(c,f,"anCells"),h=e([].concat.apply([],d)),p=t.aoColumns.length;return Nn(n,function(t){if(null===t||t===o){a=[];for(s=0,l=f.length;l>s;s++){i=f[s];for(u=0;p>u;u++)a.push({row:i,column:u})}return a}return e.isPlainObject(t)?[t]:h.filter(t).map(function(t,n){i=n.parentNode._DT_RowIndex;return{row:i,column:e.inArray(n,c[i].anCells)}}).toArray()})};Kt("cells()",function(t,n,r){if(e.isPlainObject(t))if(typeof t.row!==o){r=n;n=null}else{r=t;t=null}if(e.isPlainObject(n)){r=n;n=null}if(null===n||n===o)return this.iterator("table",function(e){return Un(e,t,_n(r))});var i,a,s,l,u,c=this.columns(n,r),f=this.rows(t,r),d=this.iterator("table",function(e,t){i=[];for(a=0,s=f[t].length;s>a;a++)for(l=0,u=c[t].length;u>l;l++)i.push({row:f[t][a],column:c[t][l]});return i});e.extend(d.selector,{cols:n,rows:t,opts:r});return d});Qt("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(e,t,n){return e.aoData[t].anCells[n]})});Kt("cells().data()",function(){return this.iterator("cell",function(e,t,n){return T(e,t,n)})});Qt("cells().cache()","cell().cache()",function(e){e="search"===e?"_aFilterData":"_aSortData";return this.iterator("cell",function(t,n,r){return t.aoData[n][e][r]})});Qt("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(e,t,n){return{row:t,column:n,columnVisible:g(e,n)}})});Kt(["cells().invalidate()","cell().invalidate()"],function(e){var t=this.selector;this.rows(t.rows,t.opts).invalidate(e);return this});Kt("cell()",function(e,t,n){return Mn(this.cells(e,t,n))});Kt("cell().data()",function(e){var t=this.context,n=this[0];if(e===o)return t.length&&n.length?T(t[0],n[0].row,n[0].column):o;k(t[0],n[0].row,n[0].column,e);E(t[0],n[0].row,"data",n[0].column);return this});Kt("order()",function(t,n){var r=this.context;if(t===o)return 0!==r.length?r[0].aaSorting:o;"number"==typeof t?t=[[t,n]]:e.isArray(t[0])||(t=Array.prototype.slice.call(arguments));return this.iterator("table",function(e){e.aaSorting=t.slice()})});Kt("order.listener()",function(e,t,n){return this.iterator("table",function(r){_t(r,e,t,n)})});Kt(["columns().order()","column().order()"],function(t){var n=this;return this.iterator("table",function(r,i){var o=[];e.each(n[i],function(e,n){o.push([n,t])});r.aaSorting=o})});Kt("search()",function(t,n,r,i){var a=this.context;return t===o?0!==a.length?a[0].oPreviousSearch.sSearch:o:this.iterator("table",function(o){o.oFeatures.bFilter&&J(o,e.extend({},o.oPreviousSearch,{sSearch:t+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i}),1)})});Qt("columns().search()","column().search()",function(t,n,r,i){return this.iterator("column",function(a,s){var l=a.aoPreSearchCols;if(t===o)return l[s].sSearch;if(a.oFeatures.bFilter){e.extend(l[s],{sSearch:t+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i});J(a,a.oPreviousSearch,1)}})});Kt("state()",function(){return this.context.length?this.context[0].oSavedState:null});Kt("state.clear()",function(){return this.iterator("table",function(e){e.fnStateSaveCallback.call(e.oInstance,e,{})})});Kt("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});Kt("state.save()",function(){return this.iterator("table",function(e){jt(e)})});Xt.versionCheck=Xt.fnVersionCheck=function(e){for(var t,n,r=Xt.version.split("."),i=e.split("."),o=0,a=i.length;a>o;o++){t=parseInt(r[o],10)||0;n=parseInt(i[o],10)||0;if(t!==n)return t>n}return!0};Xt.isDataTable=Xt.fnIsDataTable=function(t){var n=e(t).get(0),r=!1;e.each(Xt.settings,function(e,t){(t.nTable===n||t.nScrollHead===n||t.nScrollFoot===n)&&(r=!0)});return r};Xt.tables=Xt.fnTables=function(t){return jQuery.map(Xt.settings,function(n){return!t||t&&e(n.nTable).is(":visible")?n.nTable:void 0})};Xt.camelToHungarian=r;Kt("$()",function(t,n){var r=this.rows(n).nodes(),i=e(r);return e([].concat(i.filter(t).toArray(),i.find(t).toArray()))});e.each(["on","one","off"],function(t,n){Kt(n+"()",function(){var t=Array.prototype.slice.call(arguments);t[0].match(/\.dt\b/)||(t[0]+=".dt");var r=e(this.tables().nodes());r[n].apply(r,t);return this})});Kt("clear()",function(){return this.iterator("table",function(e){_(e)})});Kt("settings()",function(){return new Yt(this.context,this.context)});Kt("data()",function(){return this.iterator("table",function(e){return hn(e.aoData,"_aData")}).flatten()});Kt("destroy()",function(t){t=t||!1;return this.iterator("table",function(r){var i,o=r.nTableWrapper.parentNode,a=r.oClasses,s=r.nTable,l=r.nTBody,u=r.nTHead,c=r.nTFoot,f=e(s),d=e(l),h=e(r.nTableWrapper),p=e.map(r.aoData,function(e){return e.nTr});r.bDestroying=!0;zt(r,"aoDestroyCallback","destroy",[r]);t||new Yt(r).columns().visible(!0);h.unbind(".DT").find(":not(tbody *)").unbind(".DT");e(n).unbind(".DT-"+r.sInstance);if(s!=u.parentNode){f.children("thead").detach();f.append(u)}if(c&&s!=c.parentNode){f.children("tfoot").detach();f.append(c)}f.detach();h.detach();r.aaSorting=[];r.aaSortingFixed=[];Mt(r);e(p).removeClass(r.asStripeClasses.join(" "));e("th, td",u).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone);if(r.bJUI){e("th span."+a.sSortIcon+", td span."+a.sSortIcon,u).detach();e("th, td",u).each(function(){var t=e("div."+a.sSortJUIWrapper,this);e(this).append(t.contents());t.detach()})}!t&&o&&o.insertBefore(s,r.nTableReinsertBefore);d.children().detach();d.append(p);f.css("width",r.sDestroyWidth).removeClass(a.sTable);i=r.asDestroyStripes.length;i&&d.children().each(function(t){e(this).addClass(r.asDestroyStripes[t%i])});var g=e.inArray(r,Xt.settings);-1!==g&&Xt.settings.splice(g,1)})});Xt.version="1.10.2";Xt.settings=[];Xt.models={};Xt.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};Xt.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null};Xt.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};Xt.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(e){try{return JSON.parse((-1===e.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+e.sInstance+"_"+location.pathname))}catch(t){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(e,t){try{(-1===e.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+e.sInstance+"_"+location.pathname,JSON.stringify(t))}catch(n){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:e.extend({},Xt.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null};t(Xt.defaults);Xt.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};t(Xt.defaults.column);Xt.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:o,oAjaxData:o,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Ut(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Ut(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var e=this._iDisplayLength,t=this._iDisplayStart,n=t+e,r=this.aiDisplay.length,i=this.oFeatures,o=i.bPaginate;return i.bServerSide?o===!1||-1===e?t+r:Math.min(t+e,this._iRecordsDisplay):!o||n>r||-1===e?r:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}};Xt.ext=Jt={classes:{},errMode:"alert",feature:[],search:[],internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:Xt.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:Xt.version};e.extend(Jt,{afnFiltering:Jt.search,aTypes:Jt.type.detect,ofnSearch:Jt.type.search,oSort:Jt.type.order,afnSortData:Jt.order,aoFeatures:Jt.feature,oApi:Jt.internal,oStdClasses:Jt.classes,oPagination:Jt.pager});e.extend(Xt.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});(function(){var t="";t="";var n=t+"ui-state-default",r=t+"css_right ui-icon ui-icon-",i=t+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";e.extend(Xt.ext.oJUIClasses,Xt.ext.classes,{sPageButton:"fg-button ui-button "+n,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:n+" sorting_asc",sSortDesc:n+" sorting_desc",sSortable:n+" sorting",sSortableAsc:n+" sorting_asc_disabled",sSortableDesc:n+" sorting_desc_disabled",sSortableNone:n+" sorting_disabled",sSortJUIAsc:r+"triangle-1-n",sSortJUIDesc:r+"triangle-1-s",sSortJUI:r+"carat-2-n-s",sSortJUIAscAllowed:r+"carat-1-n",sSortJUIDescAllowed:r+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+n,sScrollFoot:"dataTables_scrollFoot "+n,sHeaderTH:n,sFooterTH:n,sJUIHeader:i+" ui-corner-tl ui-corner-tr",sJUIFooter:i+" ui-corner-bl ui-corner-br"})})();var Vn=Xt.ext.pager;e.extend(Vn,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},simple_numbers:function(e,t){return["previous",Vt(e,t),"next"]},full_numbers:function(e,t){return["first","previous",Vt(e,t),"next","last"]},_numbers:Vt,numbers_length:7});e.extend(!0,Xt.ext.renderer,{pageButton:{_:function(t,n,r,o,a,s){var l,u,c=t.oClasses,f=t.oLanguage.oPaginate,d=0,h=function(n,i){var o,p,g,m,v=function(e){dt(t,e.data.action,!0)};for(o=0,p=i.length;p>o;o++){m=i[o];if(e.isArray(m)){var y=e("<"+(m.DT_el||"div")+"/>").appendTo(n);h(y,m)}else{l="";u="";switch(m){case"ellipsis":n.append("<span>&hellip;</span>");break;case"first":l=f.sFirst;u=m+(a>0?"":" "+c.sPageButtonDisabled);break;case"previous":l=f.sPrevious;u=m+(a>0?"":" "+c.sPageButtonDisabled);break;case"next":l=f.sNext;u=m+(s-1>a?"":" "+c.sPageButtonDisabled);break;case"last":l=f.sLast;u=m+(s-1>a?"":" "+c.sPageButtonDisabled);break;default:l=m+1;u=a===m?c.sPageButtonActive:""}if(l){g=e("<a>",{"class":c.sPageButton+" "+u,"aria-controls":t.sTableId,"data-dt-idx":d,tabindex:t.iTabIndex,id:0===r&&"string"==typeof m?t.sTableId+"_"+m:null}).html(l).appendTo(n);Rt(g,{action:m},v);d++}}}};try{var p=e(i.activeElement).data("dt-idx");h(e(n).empty(),o);null!==p&&e(n).find("[data-dt-idx="+p+"]").focus()}catch(g){}}}});var Gn=function(e,t,n,r){if(!e||"-"===e)return-1/0;t&&(e=un(e,t));if(e.replace){n&&(e=e.replace(n,""));r&&(e=e.replace(r,""))}return 1*e};e.extend(Jt.type.order,{"date-pre":function(e){return Date.parse(e)||0},"html-pre":function(e){return sn(e)?"":e.replace?e.replace(/<.*?>/g,"").toLowerCase():e+""},"string-pre":function(e){return sn(e)?"":"string"==typeof e?e.toLowerCase():e.toString?e.toString():""},"string-asc":function(e,t){return t>e?-1:e>t?1:0},"string-desc":function(e,t){return t>e?1:e>t?-1:0}});Gt("");e.extend(Xt.ext.type.detect,[function(e,t){var n=t.oLanguage.sDecimal;return cn(e,n)?"num"+n:null},function(e){if(e&&(!nn.test(e)||!rn.test(e)))return null;var t=Date.parse(e);return null!==t&&!isNaN(t)||sn(e)?"date":null},function(e,t){var n=t.oLanguage.sDecimal;return cn(e,n,!0)?"num-fmt"+n:null},function(e,t){var n=t.oLanguage.sDecimal;return dn(e,n)?"html-num"+n:null},function(e,t){var n=t.oLanguage.sDecimal;return dn(e,n,!0)?"html-num-fmt"+n:null},function(e){return sn(e)||"string"==typeof e&&-1!==e.indexOf("<")?"html":null}]);e.extend(Xt.ext.type.search,{html:function(e){return sn(e)?e:"string"==typeof e?e.replace(en," ").replace(tn,""):""},string:function(e){return sn(e)?e:"string"==typeof e?e.replace(en," "):e}});e.extend(!0,Xt.ext.renderer,{header:{_:function(t,n,r,i){e(t.nTable).on("order.dt.DT",function(e,o,a,s){if(t===o){var l=r.idx;n.removeClass(r.sSortingClass+" "+i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[l]?i.sSortAsc:"desc"==s[l]?i.sSortDesc:r.sSortingClass)}})},jqueryui:function(t,n,r,i){var o=r.idx;e("<div/>").addClass(i.sSortJUIWrapper).append(n.contents()).append(e("<span/>").addClass(i.sSortIcon+" "+r.sSortingClassJUI)).appendTo(n);e(t.nTable).on("order.dt.DT",function(e,a,s,l){if(t===a){n.removeClass(i.sSortAsc+" "+i.sSortDesc).addClass("asc"==l[o]?i.sSortAsc:"desc"==l[o]?i.sSortDesc:r.sSortingClass);n.find("span."+i.sSortIcon).removeClass(i.sSortJUIAsc+" "+i.sSortJUIDesc+" "+i.sSortJUI+" "+i.sSortJUIAscAllowed+" "+i.sSortJUIDescAllowed).addClass("asc"==l[o]?i.sSortJUIAsc:"desc"==l[o]?i.sSortJUIDesc:r.sSortingClassJUI)}})}}});Xt.render={number:function(e,t,n,r){return{display:function(i){var o=0>i?"-":"";i=Math.abs(parseFloat(i));var a=parseInt(i,10),s=n?t+(i-a).toFixed(n).substring(2):"";return o+(r||"")+a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)+s}}}};e.extend(Xt.ext.internal,{_fnExternApiFunc:$t,_fnBuildAjax:q,_fnAjaxUpdate:U,_fnAjaxParameters:V,_fnAjaxUpdateDraw:G,_fnAjaxDataSrc:$,_fnAddColumn:f,_fnColumnOptions:d,_fnAdjustColumnSizing:h,_fnVisibleToColumnIndex:p,_fnColumnIndexToVisible:g,_fnVisbleColumns:m,_fnGetColumns:v,_fnColumnTypes:y,_fnApplyColumnDefs:b,_fnHungarianMap:t,_fnCamelToHungarian:r,_fnLanguageCompat:a,_fnBrowserDetect:u,_fnAddData:x,_fnAddTr:w,_fnNodeToDataIndex:C,_fnNodeToColumnIndex:S,_fnGetCellData:T,_fnSetCellData:k,_fnSplitObjNotation:D,_fnGetObjectDataFn:L,_fnSetObjectDataFn:A,_fnGetDataMaster:N,_fnClearTable:_,_fnDeleteIndex:M,_fnInvalidateRow:E,_fnGetRowElements:j,_fnCreateTr:I,_fnBuildHead:O,_fnDrawHead:F,_fnDraw:P,_fnReDraw:R,_fnAddOptionsHtml:W,_fnDetectHeader:z,_fnGetUniqueThs:B,_fnFeatureHtmlFilter:X,_fnFilterComplete:J,_fnFilterCustom:Y,_fnFilterColumn:K,_fnFilter:Q,_fnFilterCreateSearch:Z,_fnEscapeRegex:et,_fnFilterData:tt,_fnFeatureHtmlInfo:it,_fnUpdateInfo:ot,_fnInfoMacros:at,_fnInitialise:st,_fnInitComplete:lt,_fnLengthChange:ut,_fnFeatureHtmlLength:ct,_fnFeatureHtmlPaginate:ft,_fnPageChange:dt,_fnFeatureHtmlProcessing:ht,_fnProcessingDisplay:pt,_fnFeatureHtmlTable:gt,_fnScrollDraw:mt,_fnApplyToChildren:vt,_fnCalculateColumnWidths:yt,_fnThrottle:bt,_fnConvertToWidth:xt,_fnScrollingWidthAdjust:wt,_fnGetWidestNode:Ct,_fnGetMaxLenString:St,_fnStringToCss:Tt,_fnScrollBarWidth:kt,_fnSortFlatten:Dt,_fnSort:Lt,_fnSortAria:At,_fnSortListener:Nt,_fnSortAttachListener:_t,_fnSortingClasses:Mt,_fnSortData:Et,_fnSaveState:jt,_fnLoadState:It,_fnSettingsFromNode:Ht,_fnLog:Ot,_fnMap:Ft,_fnBindAction:Rt,_fnCallbackReg:Wt,_fnCallbackFire:zt,_fnLengthOverflow:Bt,_fnRenderer:qt,_fnDataSource:Ut,_fnRowAttributes:H,_fnCalculateEnd:function(){}});e.fn.dataTable=Xt;e.fn.dataTableSettings=Xt.settings;e.fn.dataTableExt=Xt.ext;e.fn.DataTable=function(t){return e(this).dataTable(t).api()};e.each(Xt,function(t,n){e.fn.DataTable[t]=n});return e.fn.dataTable})})(window,document)},{jquery:12}],3:[function(){RegExp.escape=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};(function(e){"use strict";e.csv={defaults:{separator:",",delimiter:'"',headers:!0},hooks:{castToScalar:function(e){var t=/\./;if(isNaN(e))return e;if(t.test(e))return parseFloat(e);var n=parseInt(e);return isNaN(n)?null:n}},parsers:{parse:function(e,t){function n(){l=0;u="";if(t.start&&t.state.rowNum<t.start){s=[];t.state.rowNum++;t.state.colNum=1}else{if(void 0===t.onParseEntry)a.push(s);else{var e=t.onParseEntry(s,t.state);e!==!1&&a.push(e)}s=[];t.end&&t.state.rowNum>=t.end&&(c=!0);t.state.rowNum++;t.state.colNum=1}}function r(){if(void 0===t.onParseValue)s.push(u);else{var e=t.onParseValue(u,t.state);e!==!1&&s.push(e)}u="";l=0;t.state.colNum++}var i=t.separator,o=t.delimiter;t.state.rowNum||(t.state.rowNum=1);t.state.colNum||(t.state.colNum=1);var a=[],s=[],l=0,u="",c=!1,f=RegExp.escape(i),d=RegExp.escape(o),h=/(D|S|\n|\r|[^DS\r\n]+)/,p=h.source;p=p.replace(/S/g,f);p=p.replace(/D/g,d);h=RegExp(p,"gm");e.replace(h,function(e){if(!c)switch(l){case 0:if(e===i){u+="";r();break}if(e===o){l=1;break}if("\n"===e){r();n();break}if(/^\r$/.test(e))break;u+=e;l=3;break;case 1:if(e===o){l=2;break}u+=e;l=1;break;case 2:if(e===o){u+=e;l=1;break}if(e===i){r();break}if("\n"===e){r();n();break}if(/^\r$/.test(e))break;throw new Error("CSVDataError: Illegal State [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]");case 3:if(e===i){r();break}if("\n"===e){r();n();break}if(/^\r$/.test(e))break;if(e===o)throw new Error("CSVDataError: Illegal Quote [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]")}});if(0!==s.length){r();n()}return a},splitLines:function(e,t){function n(){a=0;if(t.start&&t.state.rowNum<t.start){s="";t.state.rowNum++}else{if(void 0===t.onParseEntry)o.push(s);else{var e=t.onParseEntry(s,t.state);e!==!1&&o.push(e)}s="";t.end&&t.state.rowNum>=t.end&&(l=!0);t.state.rowNum++}}var r=t.separator,i=t.delimiter;t.state.rowNum||(t.state.rowNum=1);var o=[],a=0,s="",l=!1,u=RegExp.escape(r),c=RegExp.escape(i),f=/(D|S|\n|\r|[^DS\r\n]+)/,d=f.source;d=d.replace(/S/g,u);d=d.replace(/D/g,c);f=RegExp(d,"gm");e.replace(f,function(e){if(!l)switch(a){case 0:if(e===r){s+=e;a=0;break}if(e===i){s+=e;a=1;break}if("\n"===e){n();break}if(/^\r$/.test(e))break;s+=e;a=3;break;case 1:if(e===i){s+=e;a=2;break}s+=e;a=1;break;case 2:var o=s.substr(s.length-1);if(e===i&&o===i){s+=e;a=1;break}if(e===r){s+=e;a=0;break}if("\n"===e){n();break}if("\r"===e)break;throw new Error("CSVDataError: Illegal state [Row:"+t.state.rowNum+"]");case 3:if(e===r){s+=e;a=0;break}if("\n"===e){n();break}if("\r"===e)break;if(e===i)throw new Error("CSVDataError: Illegal quote [Row:"+t.state.rowNum+"]");throw new Error("CSVDataError: Illegal state [Row:"+t.state.rowNum+"]");default:throw new Error("CSVDataError: Unknown state [Row:"+t.state.rowNum+"]")}});""!==s&&n();return o},parseEntry:function(e,t){function n(){if(void 0===t.onParseValue)o.push(s);else{var e=t.onParseValue(s,t.state);e!==!1&&o.push(e)}s="";a=0;t.state.colNum++}var r=t.separator,i=t.delimiter;t.state.rowNum||(t.state.rowNum=1);t.state.colNum||(t.state.colNum=1);var o=[],a=0,s="";if(!t.match){var l=RegExp.escape(r),u=RegExp.escape(i),c=/(D|S|\n|\r|[^DS\r\n]+)/,f=c.source;f=f.replace(/S/g,l);f=f.replace(/D/g,u);t.match=RegExp(f,"gm")}e.replace(t.match,function(e){switch(a){case 0:if(e===r){s+="";n();break}if(e===i){a=1;break}if("\n"===e||"\r"===e)break;s+=e;a=3;break;case 1:if(e===i){a=2;break}s+=e;a=1;break;case 2:if(e===i){s+=e;a=1;break}if(e===r){n();break}if("\n"===e||"\r"===e)break;throw new Error("CSVDataError: Illegal State [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]");case 3:if(e===r){n();break}if("\n"===e||"\r"===e)break;if(e===i)throw new Error("CSVDataError: Illegal Quote [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+t.state.rowNum+"][Col:"+t.state.colNum+"]")}});n();return o}},toArray:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;var o=void 0!==n.state?n.state:{},n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,state:o},a=e.csv.parsers.parseEntry(t,n);if(!i.callback)return a;i.callback("",a);return void 0},toArrays:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;var o=[],n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,start:n.start,end:n.end,state:{rowNum:1,colNum:1}};o=e.csv.parsers.parse(t,n);if(!i.callback)return o;i.callback("",o);return void 0},toObjects:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;i.headers="headers"in n?n.headers:e.csv.defaults.headers;n.start="start"in n?n.start:1;i.headers&&n.start++;n.end&&i.headers&&n.end++;var o=[],a=[],n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,start:n.start,end:n.end,state:{rowNum:1,colNum:1},match:!1},s={delimiter:i.delimiter,separator:i.separator,start:1,end:1,state:{rowNum:1,colNum:1}},l=e.csv.parsers.splitLines(t,s),u=e.csv.toArray(l[0],n),o=e.csv.parsers.splitLines(t,n);n.state.colNum=1;n.state.rowNum=u?2:1;for(var c=0,f=o.length;f>c;c++){var d=e.csv.toArray(o[c],n),h={};for(var p in u)h[u[p]]=d[p];a.push(h);n.state.rowNum++}if(!i.callback)return a;i.callback("",a);return void 0},fromArrays:function(t,n,r){var n=void 0!==n?n:{},o={};o.callback=void 0!==r&&"function"==typeof r?r:!1;o.separator="separator"in n?n.separator:e.csv.defaults.separator;o.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;o.escaper="escaper"in n?n.escaper:e.csv.defaults.escaper;o.experimental="experimental"in n?n.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(t[i]);if(!o.callback)return a;o.callback("",a);return void 0},fromObjects2CSV:function(t,n,r){var n=void 0!==n?n:{},o={};o.callback=void 0!==r&&"function"==typeof r?r:!1;o.separator="separator"in n?n.separator:e.csv.defaults.separator;o.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;o.experimental="experimental"in n?n.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(arrays[i]);if(!o.callback)return a;o.callback("",a);return void 0}};e.csvEntry2Array=e.csv.toArray;e.csv2Array=e.csv.toArrays;e.csv2Dictionary=e.csv.toObjects})(jQuery)},{}],4:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),l=t.ch-1,u=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(r&&c>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),d=n(e,a(t.line,l+(c>0?1:0)),c,f||null,i);return null==d?null:{from:a(t.line,l),to:d&&d.pos,match:d&&d.ch==u.charAt(0),forward:c>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,u=[],c=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=f;d+=n){var h=e.getLine(d);if(h){var p=n>0?0:h.length-1,g=n>0?h.length:-1;if(!(h.length>o)){d==t.line&&(p=t.ch-(0>n?1:0));for(;p!=g;p+=n){var m=h.charAt(p);if(c.test(m)&&(void 0===r||e.getTokenTypeAt(a(d,p+1))==r)){var v=s[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:a(d,p),ch:m};u.pop()}}}}}}return d-n==(n>0?e.lastLine():e.firstLine())?!1:null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&t(e,l[u].head,!1,r);if(c&&e.getLine(c.from.line).length<=i){var f=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(c.from,a(c.from.line,c.from.ch+1),{className:f}));c.to&&e.getLine(c.to.line).length<=i&&s.push(e.markText(c.to,a(c.to.line,c.to.ch+1),{className:f}))}}if(s.length){o&&e.state.focused&&e.display.input.focus();var d=function(){e.operation(function(){for(var e=0;e<s.length;e++)s[e].clear()})};if(!n)return d;setTimeout(d,800)}}function i(e){e.operation(function(){if(l){l();l=null}l=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",i);if(n){t.state.matchBrackets="object"==typeof n?n:{};t.on("cursorActivity",i)}});e.defineExtension("matchBrackets",function(){r(this,!0)});e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)});e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})})},{"../../lib/codemirror":9}],5:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function r(r){for(var i=n.ch,l=0;;){var u=0>=i?-1:s.lastIndexOf(r,i-1);if(-1!=u){if(1==l&&u<n.ch)break;o=t.getTokenTypeAt(e.Pos(a,u+1));if(!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==l)break;l=1;i=s.length}}}var i,o,a=n.line,s=t.getLine(a),l="{",u="}",i=r("{");if(null==i){l="[",u="]";i=r("[")}if(null!=i){var c,f,d=1,h=t.lastLine();e:for(var p=a;h>=p;++p)for(var g=t.getLine(p),m=p==a?i:0;;){var v=g.indexOf(l,m),y=g.indexOf(u,m);0>v&&(v=g.length);0>y&&(y=g.length);m=Math.min(v,y);if(m==g.length)break;if(t.getTokenTypeAt(e.Pos(p,m+1))==o)if(m==v)++d;else if(!--d){c=p;f=m;break e}++m}if(null!=c&&(a!=c||f!=i))return{from:e.Pos(a,i),to:e.Pos(c,f)}}});e.registerHelper("fold","import",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1)));if("keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);o>=i;++i){var a=t.getLine(i),s=a.indexOf(";");if(-1!=s)return{startCh:r.end,end:e.Pos(i,s)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var s=r(a.line+1);if(null==s)break;a=s.end}return{from:t.clipPos(e.Pos(n,o.startCh+1)),to:a}});e.registerHelper("fold","include",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1)));return"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:e.Pos(n,i+1),to:t.clipPos(e.Pos(o))}})})},{"../../lib/codemirror":9}],6:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";function t(t,i,o,a){function s(e){var n=l(t,i);if(!n||n.to.line-n.from.line<u)return null;for(var r=t.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0;r[o].clear()}return n}if(o&&o.call){var l=o;o=null}else var l=r(t,o,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var u=r(t,o,"minFoldSize"),c=s(!0);if(r(t,o,"scanUp"))for(;!c&&i.line>t.firstLine();){i=e.Pos(i.line-1,0);c=s(!1)}if(c&&!c.cleared&&"unfold"!==a){var f=n(t,o);e.on(f,"mousedown",function(t){d.clear();e.e_preventDefault(t)});var d=t.markText(c.from,c.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});d.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)});e.signal(t,"fold",t,c.from,c.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span");n.appendChild(i);n.className="CodeMirror-foldmarker" }return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}};e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)});e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0});e.commands.toggleFold=function(e){e.foldCode(e.getCursor())};e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")};e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")};e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"fold")})};e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"unfold")})};e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}});e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}});var i={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null)})},{"../../lib/codemirror":9}],7:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("./foldcode")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","./foldcode"],i):i(CodeMirror)})(function(e){"use strict";function t(e){this.options=e;this.from=this.to=0}function n(e){e===!0&&(e={});null==e.gutter&&(e.gutter="CodeMirror-foldgutter");null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open");null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded");return e}function r(e,t){for(var n=e.findMarksAt(f(t)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==t)return!0}function i(e){if("string"==typeof e){var t=document.createElement("div");t.className=e+" CodeMirror-guttermarker-subtle";return t}return e.cloneNode(!0)}function o(t,n,o){var a=t.state.foldGutter.options,s=n;t.eachLine(n,o,function(n){var o=null;if(r(t,s))o=i(a.indicatorFolded);else{var l=f(s,0),u=a.rangeFinder||e.fold.auto,c=u&&u(t,l);c&&c.from.line+1<c.to.line&&(o=i(a.indicatorOpen))}t.setGutterMarker(n,a.gutter,o);++s})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;if(n){e.operation(function(){o(e,t.from,t.to)});n.from=t.from;n.to=t.to}}function s(e,t,n){var r=e.state.foldGutter.options;n==r.gutter&&e.foldCode(f(t,0),r.rangeFinder)}function l(e){var t=e.state.foldGutter,n=e.state.foldGutter.options;t.from=t.to=0;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}function u(e){var t=e.state.foldGutter,n=e.state.foldGutter.options;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){if(n.from<t.from){o(e,n.from,t.from);t.from=n.from}if(n.to>t.to){o(e,t.to,n.to);t.to=n.to}})},n.updateViewportTimeSpan||400)}function c(e,t){var n=e.state.foldGutter,r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}e.defineOption("foldGutter",!1,function(r,i,o){if(o&&o!=e.Init){r.clearGutter(r.state.foldGutter.options.gutter);r.state.foldGutter=null;r.off("gutterClick",s);r.off("change",l);r.off("viewportChange",u);r.off("fold",c);r.off("unfold",c);r.off("swapDoc",a)}if(i){r.state.foldGutter=new t(n(i));a(r);r.on("gutterClick",s);r.on("change",l);r.on("viewportChange",u);r.on("fold",c);r.on("unfold",c);r.on("swapDoc",a)}});var f=e.Pos})},{"../../lib/codemirror":9,"./foldcode":6}],8:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t;this.ch=n;this.cm=e;this.text=e.getLine(t);this.min=r?r.from:e.firstLine();this.max=r?r.to-1:e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(d(e.line,t));return n&&/\btag\b/.test(n)}function i(e){if(!(e.line>=e.max)){e.ch=0;e.text=e.cm.getLine(++e.line);return!0}}function o(e){if(!(e.line<=e.min)){e.text=e.cm.getLine(--e.line);e.ch=e.text.length;return!0}}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));e.ch=t+1;return o?"selfClose":"regular"}e.ch=t+1}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){g.lastIndex=t;e.ch=t;var n=g.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){g.lastIndex=e.ch;var t=g.exec(e.text);if(!t){if(i(e))continue;return}if(r(e,t.index+1)){e.ch=t.index+t[0].length;return t}e.ch=t.index+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));e.ch=t+1;return i?"selfClose":"regular"}e.ch=t}}function c(e,t){for(var n=[];;){var r,i=l(e),o=e.line,s=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==i[2]){n.length=u;break}if(0>u&&(!t||t==i[2]))return{tag:i[2],from:d(o,s),to:d(e.line,e.ch)}}else n.push(i[2])}}function f(e,t){for(var n=[];;){var r=u(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=s(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(i,o)}}}else s(e)}}var d=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+h+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=l(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var t=d(r.line,r.ch),s=c(r,o[2]);return s&&{from:t,to:s.from}}}});e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=a(o),u=l&&d(o.line,o.ch),h=l&&s(o);if(l&&h&&!(t(o,r)>0)){var p={from:d(o.line,o.ch),to:u,tag:h[2]};if("selfClose"==l)return{open:p,close:null,at:"open"};if(h[1])return{open:f(o,h[2]),close:p,at:"close"};o=new n(e,u.line,u.ch,i);return{open:p,close:c(o,h[2]),at:"open"}}}};e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=f(i);if(!o)break;var a=new n(e,t.line,t.ch,r),s=c(a,o.tag);if(s)return{open:o,close:s}}};e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return c(o,r)}})},{"../../lib/codemirror":9}],9:[function(t,n,r){(function(t){if("object"==typeof r&&"object"==typeof n)n.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);this.CodeMirror=t()}})(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?yo(r):{};yo(ja,r,!1);h(r);var i=r.value;"string"==typeof i&&(i=new rs(i,r.mode));this.doc=i;var o=this.display=new t(n,i);o.wrapper.CodeMirror=this;u(this);s(this);r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");r.autofocus&&!ca&&kn(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new co,keySeq:null};Zo&&11>ea&&setTimeout(bo(Tn,this,!0),20);An(this);Mo();Qt(this);this.curOp.forceUpdate=!0;Mi(this,i);r.autofocus&&!ca||Lo()==o.input?setTimeout(bo(Qn,this),20):Zn(this);for(var a in Ia)Ia.hasOwnProperty(a)&&Ia[a](this,r[a],Ha);b(this);for(var l=0;l<Ra.length;++l)Ra[l](this);en(this)}function t(e,t){var n=this,r=n.input=So("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");ta?r.style.width="1000px":r.setAttribute("wrap","off");ua&&(r.style.border="1px solid black");r.setAttribute("autocorrect","off");r.setAttribute("autocapitalize","off");r.setAttribute("spellcheck","false");n.inputDiv=So("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");n.scrollbarH=So("div",[So("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.scrollbarV=So("div",[So("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");n.scrollbarFiller=So("div",null,"CodeMirror-scrollbar-filler");n.gutterFiller=So("div",null,"CodeMirror-gutter-filler");n.lineDiv=So("div",null,"CodeMirror-code");n.selectionDiv=So("div",null,null,"position: relative; z-index: 1");n.cursorDiv=So("div",null,"CodeMirror-cursors");n.measure=So("div",null,"CodeMirror-measure");n.lineMeasure=So("div",null,"CodeMirror-measure");n.lineSpace=So("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");n.mover=So("div",[So("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative");n.sizer=So("div",[n.mover],"CodeMirror-sizer");n.heightForcer=So("div",null,null,"position: absolute; height: "+hs+"px; width: 1px;");n.gutters=So("div",null,"CodeMirror-gutters");n.lineGutter=null;n.scroller=So("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll");n.scroller.setAttribute("tabIndex","-1");n.wrapper=So("div",[n.inputDiv,n.scrollbarH,n.scrollbarV,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror");if(Zo&&8>ea){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0}ua&&(r.style.width="0px");ta||(n.scroller.draggable=!0);if(aa){n.inputDiv.style.height="1px";n.inputDiv.style.position="absolute"}Zo&&8>ea&&(n.scrollbarH.style.minHeight=n.scrollbarV.style.minWidth="18px");e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper));n.viewFrom=n.viewTo=t.first;n.view=[];n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.prevInput="";n.alignWidgets=!1;n.pollingFast=!1;n.poll=new co;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.inaccurateSelection=!1;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption);r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null);e.styles&&(e.styles=null)});e.doc.frontier=e.doc.first;wt(e,100);e.state.modeGen++;e.curOp&&pn(e)}function i(e){if(e.options.lineWrapping){Ns(e.display.wrapper,"CodeMirror-wrap");e.display.sizer.style.minWidth=""}else{As(e.display.wrapper,"CodeMirror-wrap");d(e)}a(e);pn(e);Rt(e);setTimeout(function(){m(e)},100)}function o(e){var t=Yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Kt(e.display)-3);return function(i){if(ri(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&Hi(e,t)})}function s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-");Rt(e)}function l(e){u(e);pn(e);setTimeout(function(){y(e)},20)}function u(e){var t=e.display.gutters,n=e.options.gutters;To(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(So("div",null,"CodeMirror-gutter "+i));if("CodeMirror-linenumbers"==i){e.display.lineGutter=o;o.style.width=(e.display.lineNumWidth||1)+"px"}}t.style.display=r?"":"none";c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px";e.display.scrollbarH.style.left=e.options.fixedGutter?t+"px":0}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Yr(r);){var i=t.find(0,!0);r=i.from.line;n+=i.from.ch-i.to.ch}r=e;for(;t=Kr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch;r=i.to.line;n+=r.text.length-i.to.ch}return n}function d(e){var t=e.display,n=e.doc;t.maxLine=Ei(n,n.first);t.maxLineLength=f(t.maxLine);t.maxLineChanged=!0;n.iter(function(e){var n=f(e);if(n>t.maxLineLength){t.maxLineLength=n;t.maxLine=e}})}function h(e){var t=go(e.gutters,"CodeMirror-linenumbers");if(-1==t&&e.lineNumbers)e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]);else if(t>-1&&!e.lineNumbers){e.gutters=e.gutters.slice(0);e.gutters.splice(t,1)}}function p(e){return e.display.scroller.clientHeight-e.display.wrapper.clientHeight<hs-3}function g(e){var t=e.display.scroller;return{clientHeight:t.clientHeight,barHeight:e.display.scrollbarV.clientHeight,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth,hScrollbarTakesSpace:p(e),barWidth:e.display.scrollbarH.clientWidth,docHeight:Math.round(e.doc.height+Dt(e.display))}}function m(e,t){t||(t=g(e));var n=e.display,r=jo(n.measure),i=t.docHeight+hs,o=t.scrollWidth>t.clientWidth;o&&t.scrollWidth<=t.clientWidth+1&&r>0&&!t.hScrollbarTakesSpace&&(o=!1);var a=i>t.clientHeight;if(a){n.scrollbarV.style.display="block";n.scrollbarV.style.bottom=o?r+"px":"0";n.scrollbarV.firstChild.style.height=Math.max(0,i-t.clientHeight+(t.barHeight||n.scrollbarV.clientHeight))+"px"}else{n.scrollbarV.style.display="";n.scrollbarV.firstChild.style.height="0"}if(o){n.scrollbarH.style.display="block";n.scrollbarH.style.right=a?r+"px":"0";n.scrollbarH.firstChild.style.width=t.scrollWidth-t.clientWidth+(t.barWidth||n.scrollbarH.clientWidth)+"px"}else{n.scrollbarH.style.display="";n.scrollbarH.firstChild.style.width="0"}if(o&&a){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=n.scrollbarFiller.style.width=r+"px"}else n.scrollbarFiller.style.display="";if(o&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=r+"px";n.gutterFiller.style.width=n.gutters.offsetWidth+"px"}else n.gutterFiller.style.display="";if(!e.state.checkedOverlayScrollbar&&t.clientHeight>0){if(0===r){var s=fa&&!sa?"12px":"18px";n.scrollbarV.style.minWidth=n.scrollbarH.style.minHeight=s;var l=function(t){no(t)!=n.scrollbarV&&no(t)!=n.scrollbarH&&un(e,En)(t)};us(n.scrollbarV,"mousedown",l);us(n.scrollbarH,"mousedown",l)}e.state.checkedOverlayScrollbar=!0}}function v(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-kt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Fi(t,r),a=Fi(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(o>s)return{from:s,to:Fi(t,Pi(Ei(t,s))+e.wrapper.clientHeight)};if(Math.min(l,t.lastLine())>=a)return{from:Fi(t,Pi(Ei(t,l))-e.wrapper.clientHeight),to:l}}return{from:o,to:Math.max(a,o+1)}}function y(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=w(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function b(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=x(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(So("div",[So("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;r.lineGutter.style.width="";r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a);r.lineNumWidth=r.lineNumInnerWidth+a;r.lineNumChars=r.lineNumInnerWidth?n.length:-1;r.lineGutter.style.width=r.lineNumWidth+"px";c(e);return!0}return!1}function x(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function w(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function C(e,t,n){var r=e.display;this.viewport=t;this.visible=v(r,e.doc,t);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldViewFrom=r.viewFrom;this.oldViewTo=r.viewTo;this.oldScrollerWidth=r.scroller.clientWidth;this.force=n;this.dims=_(e)}function S(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden){mn(e);return!1}if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&0==xn(e))return!1;if(b(e)){mn(e);t.dims=_(e)}var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom));n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo));if(va){o=ti(e.doc,o);a=ni(e.doc,a)}var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;bn(e,o,a);n.viewOffset=Pi(Ei(e.doc,n.viewFrom));e.display.mover.style.top=n.viewOffset+"px";var l=xn(e);if(!s&&0==l&&!t.force&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Lo();l>4&&(n.lineDiv.style.display="none");M(e,n.updateLineNumbers,t.dims);l>4&&(n.lineDiv.style.display="");u&&Lo()!=u&&u.offsetHeight&&u.focus();To(n.cursorDiv);To(n.selectionDiv);if(s){n.lastWrapHeight=t.wrapperHeight;n.lastWrapWidth=t.wrapperWidth;wt(e,400)}n.updateLineNumbers=null;return!0}function T(e,t){for(var n=t.force,r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldScrollerWidth!=e.display.scroller.clientWidth)n=!0;else{n=!1;r&&null!=r.top&&(r={top:Math.min(e.doc.height+Dt(e.display)-hs-e.display.scroller.clientHeight,r.top)});t.visible=v(e.display,e.doc,r);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}if(!S(e,t))break;A(e);var o=g(e);vt(e);D(e,o);m(e,o)}io(e,"update",e);(e.display.viewFrom!=t.oldViewFrom||e.display.viewTo!=t.oldViewTo)&&io(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo)}function k(e,t){var n=new C(e,t);if(S(e,n)){A(e);T(e,n);var r=g(e);vt(e);D(e,r);m(e,r)}}function D(e,t){e.display.sizer.style.minHeight=e.display.heightForcer.style.top=t.docHeight+"px";e.display.gutters.style.height=Math.max(t.docHeight,t.clientHeight-hs)+"px"}function L(e,t){if(e.display.sizer.offsetWidth+e.display.gutters.offsetWidth<e.display.scroller.clientWidth-1){e.display.sizer.style.minHeight=e.display.heightForcer.style.top="0px";e.display.gutters.style.height=t.docHeight+"px"}}function A(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(Zo&&8>ea){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n;n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var l=o.line.height-i;2>i&&(i=Yt(t));if(l>.001||-.001>l){Hi(o.line,i);N(o.line);if(o.rest)for(var u=0;u<o.rest.length;u++)N(o.rest[u])}}}}function N(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function _(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i;r[e.options.gutters[a]]=o.clientWidth}return{fixedPos:w(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function M(e,t,n){function r(t){var n=t.nextSibling;ta&&fa&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t);return n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,s=a.firstChild,l=i.view,u=i.viewFrom,c=0;c<l.length;c++){var f=l[c];if(f.hidden);else if(f.node){for(;s!=f.node;)s=r(s);var d=o&&null!=t&&u>=t&&f.lineNumber;if(f.changes){go(f.changes,"gutter")>-1&&(d=!1);E(e,f,u,n)}if(d){To(f.lineNumber);f.lineNumber.appendChild(document.createTextNode(x(e.options,u)))}s=f.node.nextSibling}else{var h=W(e,f,u,n);a.insertBefore(h,s)}u+=f.size}for(;s;)s=r(s)}function E(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?O(e,t):"gutter"==o?P(e,t,n,r):"class"==o?F(t):"widget"==o&&R(t,r)}t.changes=null}function j(e){if(e.node==e.text){e.node=So("div",null,null,"position: relative");e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text);e.node.appendChild(e.text);Zo&&8>ea&&(e.node.style.zIndex=2)}return e.node}function I(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;t&&(t+=" CodeMirror-linebackground");if(e.background)if(t)e.background.className=t;else{e.background.parentNode.removeChild(e.background);e.background=null}else if(t){var n=j(e);e.background=n.insertBefore(So("div",null,t),n.firstChild)}}function H(e,t){var n=e.display.externalMeasured;if(n&&n.line==t.line){e.display.externalMeasured=null;t.measure=n.measure;return n.built}return bi(e,t)}function O(e,t){var n=t.text.className,r=H(e,t);t.text==t.node&&(t.node=r.pre);t.text.parentNode.replaceChild(r.pre,t.text);t.text=r.pre;if(r.bgClass!=t.bgClass||r.textClass!=t.textClass){t.bgClass=r.bgClass;t.textClass=r.textClass;F(t)}else n&&(t.text.className=n)}function F(e){I(e);e.line.wrapClass?j(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function P(e,t,n,r){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=j(t),a=t.gutter=o.insertBefore(So("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.text);t.line.gutterClass&&(a.className+=" "+t.line.gutterClass);!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(So("div",x(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px")));if(i)for(var s=0;s<e.options.gutters.length;++s){var l=e.options.gutters[s],u=i.hasOwnProperty(l)&&i[l];u&&a.appendChild(So("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function R(e,t){e.alignable&&(e.alignable=null);for(var n,r=e.node.firstChild;r;r=n){var n=r.nextSibling;"CodeMirror-linewidget"==r.className&&e.node.removeChild(r)}z(e,t)}function W(e,t,n,r){var i=H(e,t);t.text=t.node=i.pre;i.bgClass&&(t.bgClass=i.bgClass);i.textClass&&(t.textClass=i.textClass);F(t);P(e,t,n,r);z(t,r);return t.node}function z(e,t){B(e.line,e,t,!0);if(e.rest)for(var n=0;n<e.rest.length;n++)B(e.rest[n],e,t,!1)}function B(e,t,n,r){if(e.widgets)for(var i=j(t),o=0,a=e.widgets;o<a.length;++o){var s=a[o],l=So("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||(l.ignoreEvents=!0);q(s,l,t,n);r&&s.above?i.insertBefore(l,t.gutter||t.text):i.appendChild(l);io(s,"redraw")}}function q(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px";if(!e.coverGutter){i-=r.gutterTotalWidth;t.style.paddingLeft=r.gutterTotalWidth+"px"}t.style.width=i+"px"}if(e.coverGutter){t.style.zIndex=5;t.style.position="relative";e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px")}}function U(e){return ya(e.line,e.ch)}function V(e,t){return ba(e,t)<0?t:e}function G(e,t){return ba(e,t)<0?e:t}function $(e,t){this.ranges=e;this.primIndex=t}function X(e,t){this.anchor=e;this.head=t}function J(e,t){var n=e[t];e.sort(function(e,t){return ba(e.from(),t.from())});t=go(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(ba(o.to(),i.from())>=0){var a=G(o.from(),i.from()),s=V(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t;e.splice(--r,2,new X(l?s:a,l?a:s))}}return new $(e,t)}function Y(e,t){return new $([new X(e,t||e)],0)}function K(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Q(e,t){if(t.line<e.first)return ya(e.first,0);var n=e.first+e.size-1;return t.line>n?ya(n,Ei(e,n).text.length):Z(t,Ei(e,t.line).text.length)}function Z(e,t){var n=e.ch;return null==n||n>t?ya(e.line,t):0>n?ya(e.line,0):e}function et(e,t){return t>=e.first&&t<e.first+e.size}function tt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Q(e,t[r]);return n}function nt(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=ba(n,i)<0;if(o!=ba(r,i)<0){i=n;n=r}else o!=ba(n,r)<0&&(n=r)}return new X(i,n)}return new X(r||n,n)}function rt(e,t,n,r){ut(e,new $([nt(e,e.sel.primary(),t,n)],0),r)}function it(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=nt(e,e.sel.ranges[i],t[i],null);var o=J(r,e.sel.primIndex);ut(e,o,n)}function ot(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n;ut(e,J(i,e.sel.primIndex),r)}function at(e,t,n,r){ut(e,Y(t,n),r)}function st(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new X(Q(e,t[n].anchor),Q(e,t[n].head))}};fs(e,"beforeSelectionChange",e,n);e.cm&&fs(e.cm,"beforeSelectionChange",e.cm,n);return n.ranges!=t.ranges?J(n.ranges,n.ranges.length-1):t}function lt(e,t,n){var r=e.history.done,i=po(r);if(i&&i.ranges){r[r.length-1]=t;ct(e,t,n)}else ut(e,t,n)}function ut(e,t,n){ct(e,t,n);Gi(e,e.sel,e.cm?e.cm.curOp.id:0/0,n)}function ct(e,t,n){(lo(e,"beforeSelectionChange")||e.cm&&lo(e.cm,"beforeSelectionChange"))&&(t=st(e,t));var r=n&&n.bias||(ba(t.primary().head,e.sel.primary().head)<0?-1:1);ft(e,ht(e,t,r,!0));n&&n.scroll===!1||!e.cm||br(e.cm)}function ft(e,t){if(!t.equals(e.sel)){e.sel=t;if(e.cm){e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0;so(e.cm)}io(e,"cursorActivity",e)}}function dt(e){ft(e,ht(e,e.sel,null,!1),gs)}function ht(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=pt(e,a.anchor,n,r),l=pt(e,a.head,n,r);if(i||s!=a.anchor||l!=a.head){i||(i=t.ranges.slice(0,o));i[o]=new X(s,l)}}return i?J(i,t.primIndex):t}function pt(e,t,n,r){var i=!1,o=t,a=n||1;e.cantEdit=!1;e:for(;;){var s=Ei(e,o.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var u=s.markedSpans[l],c=u.marker;if((null==u.from||(c.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(c.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(r){fs(c,"beforeCursorEnter");if(c.explicitlyCleared){if(s.markedSpans){--l;continue}break}}if(!c.atomic)continue;var f=c.find(0>a?-1:1);if(0==ba(f,o)){f.ch+=a;f.ch<0?f=f.line>e.first?Q(e,ya(f.line-1)):null:f.ch>s.text.length&&(f=f.line<e.first+e.size-1?ya(f.line+1,0):null);if(!f){if(i){if(!r)return pt(e,t,n,!0);e.cantEdit=!0;return ya(e.first,0)}i=!0;f=t;a=-a}}o=f;continue e}}return o}}function gt(e){for(var t=e.display,n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){var s=n.sel.ranges[a],l=s.empty();(l||e.options.showCursorWhenSelecting)&&yt(e,s,i);l||bt(e,s,o)}if(e.options.moveInputWithCursor){var u=Vt(e,n.sel.primary().head,"div"),c=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,u.top+f.top-c.top));r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,u.left+f.left-c.left))}return r}function mt(e,t){ko(e.display.cursorDiv,t.cursors);ko(e.display.selectionDiv,t.selection);if(null!=t.teTop){e.display.inputDiv.style.top=t.teTop+"px";e.display.inputDiv.style.left=t.teLeft+"px"}}function vt(e){mt(e,gt(e))}function yt(e,t,n){var r=Vt(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(So("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px";i.style.top=r.top+"px";i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px";if(r.other){var o=n.appendChild(So("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=r.other.left+"px";o.style.top=r.other.top+"px";o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function bt(e,t,n){function r(e,t,n,r){0>t&&(t=0);t=Math.round(t);r=Math.round(r);s.appendChild(So("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?c-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return Ut(e,ya(t,n),"div",f,r)}var s,l,f=Ei(a,t),d=f.text.length;Fo(Ri(f),n||0,null==i?d:i,function(e,t,a){var f,h,p,g=o(e,"left");if(e==t){f=g;h=p=g.left}else{f=o(t-1,"right");if("rtl"==a){var m=g;g=f;f=m}h=g.left;p=f.right}null==n&&0==e&&(h=u);if(f.top-g.top>3){r(h,g.top,null,g.bottom);h=u;g.bottom<f.top&&r(h,g.bottom,null,f.top)}null==i&&t==d&&(p=c);(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g);(!l||f.bottom>l.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f);u+1>h&&(h=u);r(h,f.top,p-h,f.bottom)});return{start:s,end:l}}var o=e.display,a=e.doc,s=document.createDocumentFragment(),l=Lt(e.display),u=l.left,c=o.lineSpace.offsetWidth-l.right,f=t.from(),d=t.to();if(f.line==d.line)i(f.line,f.ch,d.ch);else{var h=Ei(a,f.line),p=Ei(a,d.line),g=Zr(h)==Zr(p),m=i(f.line,f.ch,g?h.text.length+1:null).end,v=i(d.line,g?0:null,d.ch).start;if(g)if(m.top<v.top-2){r(m.right,m.top,null,m.bottom);r(u,v.top,v.left,v.bottom)}else r(m.right,m.top,v.left-m.right,m.bottom);m.bottom<v.top&&r(u,m.bottom,null,v.top)}n.appendChild(s)}function xt(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="";e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function wt(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,bo(Ct,e))}function Ct(e){var t=e.doc;t.frontier<t.first&&(t.frontier=t.first);if(!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=za(t.mode,Tt(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=gi(e,o,r,!0);o.styles=s.styles;var l=o.styleClasses,u=s.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!c&&f<a.length;++f)c=a[f]!=o.styles[f];c&&i.push(t.frontier);o.stateAfter=za(t.mode,r)}else{vi(e,o.text,r);o.stateAfter=t.frontier%5==0?za(t.mode,r):null}++t.frontier;if(+new Date>n){wt(e,e.options.workDelay);return!0}});i.length&&ln(e,function(){for(var t=0;t<i.length;t++)gn(e,i[t],"text")})}}function St(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Ei(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var u=ys(l.text,null,e.options.tabSize);if(null==i||r>u){i=s-1;r=u}}return i}function Tt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=St(e,t,n),a=o>r.first&&Ei(r,o-1).stateAfter;a=a?za(r.mode,a):Ba(r.mode);r.iter(o,t,function(n){vi(e,n.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=s?za(r.mode,a):null;++o});n&&(r.frontier=o);return a}function kt(e){return e.lineSpace.offsetTop}function Dt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ko(e.measure,So("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r);return r}function At(e,t,n){var r=e.options.lineWrapping,i=r&&e.display.scroller.clientWidth;if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Nt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(Oi(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function _t(e,t){t=Zr(t);var n=Oi(t),r=e.display.externalMeasured=new dn(e.doc,t,n);r.lineN=n;var i=r.built=bi(e,r);r.text=i.pre;ko(e.display.lineMeasure,i.pre);return r}function Mt(e,t,n,r){return It(e,jt(e,t),n,r)}function Et(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[vn(e,t)]; var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function jt(e,t){var n=Oi(t),r=Et(e,n);r&&!r.text?r=null:r&&r.changes&&E(e,r,n,_(e));r||(r=_t(e,t));var i=Nt(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function It(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");if(t.cache.hasOwnProperty(a))o=t.cache[a];else{t.rect||(t.rect=t.view.text.getBoundingClientRect());if(!t.hasHeights){At(e,t.view,t.rect);t.hasHeights=!0}o=Ht(e,t,n,r);o.bogus||(t.cache[a]=o)}return{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Ht(e,t,n,r){for(var i,o,a,s,l=t.map,u=0;u<l.length;u+=3){var c=l[u],f=l[u+1];if(c>n){o=0;a=1;s="left"}else if(f>n){o=n-c;a=o+1}else if(u==l.length-3||n==f&&l[u+3]>n){a=f-c;o=a-1;n>=f&&(s="right")}if(null!=o){i=l[u+2];c==f&&r==(i.insertLeft?"left":"right")&&(s=r);if("left"==r&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;){i=l[(u-=3)+2];s="left"}if("right"==r&&o==f-c)for(;u<l.length-3&&l[u+3]==l[u+4]&&!l[u+5].insertLeft;){i=l[(u+=3)+2];s="right"}break}}var d;if(3==i.nodeType){for(var u=0;4>u;u++){for(;o&&Co(t.line.text.charAt(c+o));)--o;for(;f>c+a&&Co(t.line.text.charAt(c+a));)++a;if(Zo&&9>ea&&0==o&&a==f-c)d=i.parentNode.getBoundingClientRect();else if(Zo&&e.options.lineWrapping){var h=ws(i,o,a).getClientRects();d=h.length?h["right"==r?h.length-1:0]:Sa}else d=ws(i,o,a).getBoundingClientRect()||Sa;if(d.left||d.right||0==o)break;a=o;o-=1;s="right"}Zo&&11>ea&&(d=Ot(e.display.measure,d))}else{o>0&&(s=r="right");var h;d=e.options.lineWrapping&&(h=i.getClientRects()).length>1?h["right"==r?h.length-1:0]:i.getBoundingClientRect()}if(Zo&&9>ea&&!o&&(!d||!d.left&&!d.right)){var p=i.parentNode.getClientRects()[0];d=p?{left:p.left,right:p.left+Kt(e.display),top:p.top,bottom:p.bottom}:Sa}for(var g=d.top-t.rect.top,m=d.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,u=0;u<y.length-1&&!(v<y[u]);u++);var b=u?y[u-1]:0,x=y[u],w={left:("right"==s?d.right:d.left)-t.rect.left,right:("left"==s?d.left:d.right)-t.rect.left,top:b,bottom:x};d.left||d.right||(w.bogus=!0);if(!e.options.singleCursorHeightPerLine){w.rtop=g;w.rbottom=m}return w}function Ot(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Oo(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Ft(e){if(e.measure){e.measure.cache={};e.measure.heights=null;if(e.rest)for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}}function Pt(e){e.display.externalMeasure=null;To(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ft(e.display.view[t])}function Rt(e){Pt(e);e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null;e.options.lineWrapping||(e.display.maxLineChanged=!0);e.display.lineNumChars=null}function Wt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function zt(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Bt(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=ai(t.widgets[i]);n.top+=o;n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Pi(t);"local"==r?a+=kt(e.display):a-=e.display.viewOffset;if("page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:zt());var l=s.left+("window"==r?0:Wt());n.left+=l;n.right+=l}n.top+=a;n.bottom+=a;return n}function qt(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n){r-=Wt();i-=zt()}else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left;i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Ut(e,t,n,r,i){r||(r=Ei(e.doc,t.line));return Bt(e,r,Mt(e,r,t.ch,i),n)}function Vt(e,t,n,r,i,o){function a(t,a){var s=It(e,i,t,a?"right":"left",o);a?s.left=s.right:s.right=s.left;return Bt(e,r,s,n)}function s(e,t){var n=l[t],r=n.level%2;if(e==Po(n)&&t&&n.level<l[t-1].level){n=l[--t];e=Ro(n)-(n.level%2?0:1);r=!0}else if(e==Ro(n)&&t<l.length-1&&n.level<l[t+1].level){n=l[++t];e=Po(n)-n.level%2;r=!1}return r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Ei(e.doc,t.line);i||(i=jt(e,r));var l=Ri(r),u=t.ch;if(!l)return a(u);var c=Go(l,u),f=s(u,c);null!=Fs&&(f.other=s(u,Fs));return f}function Gt(e,t){var n=0,t=Q(e.doc,t);e.options.lineWrapping||(n=Kt(e.display)*t.ch);var r=Ei(e.doc,t.line),i=Pi(r)+kt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function $t(e,t,n,r){var i=ya(e,t);i.xRel=r;n&&(i.outside=!0);return i}function Xt(e,t,n){var r=e.doc;n+=e.display.viewOffset;if(0>n)return $t(r.first,0,!0,-1);var i=Fi(r,n),o=r.first+r.size-1;if(i>o)return $t(r.first+r.size-1,Ei(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Ei(r,i);;){var s=Jt(e,a,i,t,n),l=Kr(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=Oi(a=u.to.line)}}function Jt(e,t,n,r,i){function o(r){var i=Vt(e,ya(n,r),"line",t,u);s=!0;if(a>i.bottom)return i.left-l;if(a<i.top)return i.left+l;s=!1;return i.left}var a=i-Pi(t),s=!1,l=2*e.display.wrapper.clientWidth,u=jt(e,t),c=Ri(t),f=t.text.length,d=Wo(t),h=zo(t),p=o(d),g=s,m=o(h),v=s;if(r>m)return $t(n,h,v,1);for(;;){if(c?h==d||h==Xo(t,d,1):1>=h-d){for(var y=p>r||m-r>=r-p?d:h,b=r-(y==d?p:m);Co(t.text.charAt(y));)++y;var x=$t(n,y,y==d?g:v,-1>b?-1:b>1?1:0);return x}var w=Math.ceil(f/2),C=d+w;if(c){C=d;for(var S=0;w>S;++S)C=Xo(t,C,1)}var T=o(C);if(T>r){h=C;m=T;(v=s)&&(m+=1e3);f=w}else{d=C;p=T;g=s;f-=w}}}function Yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==xa){xa=So("pre");for(var t=0;49>t;++t){xa.appendChild(document.createTextNode("x"));xa.appendChild(So("br"))}xa.appendChild(document.createTextNode("x"))}ko(e.measure,xa);var n=xa.offsetHeight/50;n>3&&(e.cachedTextHeight=n);To(e.measure);return n||1}function Kt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=So("span","xxxxxxxxxx"),n=So("pre",[t]);ko(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;i>2&&(e.cachedCharWidth=i);return i||10}function Qt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++ka};Ta?Ta.ops.push(e.curOp):e.curOp.ownsGroup=Ta={ops:[e.curOp],delayedCallbacks:[]}}function Zt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<t.length)}function en(e){var t=e.curOp,n=t.ownsGroup;if(n)try{Zt(n)}finally{Ta=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;tn(n)}}function tn(e){for(var t=e.ops,n=0;n<t.length;n++)nn(t[n]);for(var n=0;n<t.length;n++)rn(t[n]);for(var n=0;n<t.length;n++)on(t[n]);for(var n=0;n<t.length;n++)an(t[n]);for(var n=0;n<t.length;n++)sn(t[n])}function nn(e){var t=e.cm,n=t.display;e.updateMaxLine&&d(t);e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping;e.update=e.mustUpdate&&new C(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function rn(e){e.updatedDisplay=e.mustUpdate&&S(e.cm,e.update)}function on(e){var t=e.cm,n=t.display;e.updatedDisplay&&A(t);e.barMeasure=g(t);if(n.maxLineChanged&&!t.options.lineWrapping){e.adjustWidthTo=Mt(t,n.maxLine,n.maxLine.text.length).left+3;e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo+hs-n.scroller.clientWidth)}(e.updatedDisplay||e.selectionChanged)&&(e.newSelectionNodes=gt(t))}function an(e){var t=e.cm;if(null!=e.adjustWidthTo){t.display.sizer.style.minWidth=e.adjustWidthTo+"px";e.maxScrollLeft<t.doc.scrollLeft&&zn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0);t.display.maxLineChanged=!1}e.newSelectionNodes&&mt(t,e.newSelectionNodes);e.updatedDisplay&&D(t,e.barMeasure);(e.updatedDisplay||e.startHeight!=t.doc.height)&&m(t,e.barMeasure);e.selectionChanged&&xt(t);t.state.focused&&e.updateInput&&Tn(t,e.typing)}function sn(e){var t=e.cm,n=t.display,r=t.doc;null!=e.adjustWidthTo&&Math.abs(e.barMeasure.scrollWidth-t.display.scroller.scrollWidth)>1&&m(t);e.updatedDisplay&&T(t,e.update);null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null);if(null!=e.scrollTop&&(n.scroller.scrollTop!=e.scrollTop||e.forceScroll)){var i=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop));n.scroller.scrollTop=n.scrollbarV.scrollTop=r.scrollTop=i}if(null!=e.scrollLeft&&(n.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)){var o=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft));n.scroller.scrollLeft=n.scrollbarH.scrollLeft=r.scrollLeft=o;y(t)}if(e.scrollToPos){var a=gr(t,Q(r,e.scrollToPos.from),Q(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&pr(t,a)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var u=0;u<s.length;++u)s[u].lines.length||fs(s[u],"hide");if(l)for(var u=0;u<l.length;++u)l[u].lines.length&&fs(l[u],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop);if(e.updatedDisplay&&ta){t.options.lineWrapping&&L(t,e.barMeasure);e.barMeasure.scrollWidth>e.barMeasure.clientWidth&&e.barMeasure.scrollWidth<e.barMeasure.clientWidth+1&&!p(t)&&m(t)}e.changeObjs&&fs(t,"changes",t,e.changeObjs)}function ln(e,t){if(e.curOp)return t();Qt(e);try{return t()}finally{en(e)}}function un(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Qt(e);try{return t.apply(e,arguments)}finally{en(e)}}}function cn(e){return function(){if(this.curOp)return e.apply(this,arguments);Qt(this);try{return e.apply(this,arguments)}finally{en(this)}}}function fn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Qt(t);try{return e.apply(this,arguments)}finally{en(t)}}}function dn(e,t,n){this.line=t;this.rest=ei(t);this.size=this.rest?Oi(po(this.rest))-n+1:1;this.node=this.text=null;this.hidden=ri(e,t)}function hn(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new dn(e.doc,Ei(e.doc,o),o);r=o+a.size;i.push(a)}return i}function pn(e,t,n,r){null==t&&(t=e.doc.first);null==n&&(n=e.doc.first+e.doc.size);r||(r=0);var i=e.display;r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t);e.curOp.viewChanged=!0;if(t>=i.viewTo)va&&ti(e.doc,t)<i.viewTo&&mn(e);else if(n<=i.viewFrom)if(va&&ni(e.doc,n+r)>i.viewFrom)mn(e);else{i.viewFrom+=r;i.viewTo+=r}else if(t<=i.viewFrom&&n>=i.viewTo)mn(e);else if(t<=i.viewFrom){var o=yn(e,n,n+r,1);if(o){i.view=i.view.slice(o.index);i.viewFrom=o.lineN;i.viewTo+=r}else mn(e)}else if(n>=i.viewTo){var o=yn(e,t,t,-1);if(o){i.view=i.view.slice(0,o.index);i.viewTo=o.lineN}else mn(e)}else{var a=yn(e,t,t,-1),s=yn(e,n,n+r,1);if(a&&s){i.view=i.view.slice(0,a.index).concat(hn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index));i.viewTo+=r}else mn(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function gn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null);if(!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[vn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==go(a,n)&&a.push(n)}}}function mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first;e.display.view=[];e.display.viewOffset=0}function vn(e,t){if(t>=e.display.viewTo)return null;t-=e.display.viewFrom;if(0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++){t-=n[r].size;if(0>t)return r}}function yn(e,t,n,r){var i,o=vn(e,t),a=e.display.view;if(!va||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=0,l=e.display.viewFrom;o>s;s++)l+=a[s].size;if(l!=t){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-t;o++}else i=l-t;t+=i;n+=i}for(;ti(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size;o+=r}return{index:o,lineN:n}}function bn(e,t,n){var r=e.display,i=r.view;if(0==i.length||t>=r.viewTo||n<=r.viewFrom){r.view=hn(e,t,n);r.viewFrom=t}else{r.viewFrom>t?r.view=hn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(vn(e,t)));r.viewFrom=t;r.viewTo<n?r.view=r.view.concat(hn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,vn(e,n)))}r.viewTo=n}function xn(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function wn(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,function(){Sn(e);e.state.focused&&wn(e)})}function Cn(e){function t(){var r=Sn(e);if(r||n){e.display.pollingFast=!1;wn(e)}else{n=!0;e.display.poll.set(60,t)}}var n=!1;e.display.pollingFast=!0;e.display.poll.set(20,t)}function Sn(e){var t=e.display.input,n=e.display.prevInput,r=e.doc;if(!e.state.focused||js(t)&&!n||Ln(e)||e.options.disableInput||e.state.keySeq)return!1;if(e.state.pasteIncoming&&e.state.fakedLastChar){t.value=t.value.substring(0,t.value.length-1);e.state.fakedLastChar=!1}var i=t.value;if(i==n&&!e.somethingSelected())return!1;if(Zo&&ea>=9&&e.display.inputHasSelection===i||fa&&/[\uf700-\uf7ff]/.test(i)){Tn(e);return!1}var o=!e.curOp;o&&Qt(e);e.display.shift=!1;8203!=i.charCodeAt(0)||r.sel!=e.display.selForContextMenu||n||(n="​");for(var a=0,s=Math.min(n.length,i.length);s>a&&n.charCodeAt(a)==i.charCodeAt(a);)++a;var l=i.slice(a),u=Es(l),c=null;e.state.pasteIncoming&&r.sel.ranges.length>1&&(Da&&Da.join("\n")==l?c=r.sel.ranges.length%Da.length==0&&mo(Da,Es):u.length==r.sel.ranges.length&&(c=mo(u,function(e){return[e]})));for(var f=r.sel.ranges.length-1;f>=0;f--){var d=r.sel.ranges[f],h=d.from(),p=d.to();a<n.length?h=ya(h.line,h.ch-(n.length-a)):e.state.overwrite&&d.empty()&&!e.state.pasteIncoming&&(p=ya(p.line,Math.min(Ei(r,p.line).text.length,p.ch+po(u).length)));var g=e.curOp.updateInput,m={from:h,to:p,text:c?c[f%c.length]:u,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};sr(e.doc,m);io(e,"inputRead",e,m);if(l&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&d.head.ch<100&&(!f||r.sel.ranges[f-1].head.line!=d.head.line)){var v=e.getModeAt(d.head),y=Ea(m);if(v.electricChars){for(var b=0;b<v.electricChars.length;b++)if(l.indexOf(v.electricChars.charAt(b))>-1){wr(e,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Ei(r,y.line).text.slice(0,y.ch))&&wr(e,y.line,"smart")}}br(e);e.curOp.updateInput=g;e.curOp.typing=!0;i.length>1e3||i.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=i;o&&en(e);e.state.pasteIncoming=e.state.cutIncoming=!1;return!0}function Tn(e,t){var n,r,i=e.doc;if(e.somethingSelected()){e.display.prevInput="";var o=i.sel.primary();n=Is&&(o.to().line-o.from().line>100||(r=e.getSelection()).length>1e3);var a=n?"-":r||e.getSelection();e.display.input.value=a;e.state.focused&&xs(e.display.input);Zo&&ea>=9&&(e.display.inputHasSelection=a)}else if(!t){e.display.prevInput=e.display.input.value="";Zo&&ea>=9&&(e.display.inputHasSelection=null)}e.display.inaccurateSelection=n}function kn(e){"nocursor"==e.options.readOnly||ca&&Lo()==e.display.input||e.display.input.focus()}function Dn(e){if(!e.state.focused){kn(e);Qn(e)}}function Ln(e){return e.options.readOnly||e.doc.cantEdit}function An(e){function t(){e.state.focused&&setTimeout(bo(kn,e),0)}function n(t){ao(e,t)||ls(t)}function r(t){if(e.somethingSelected()){Da=e.getSelections();if(i.inaccurateSelection){i.prevInput="";i.inaccurateSelection=!1;i.input.value=Da.join("\n");xs(i.input)}}else{for(var n=[],r=[],o=0;o<e.doc.sel.ranges.length;o++){var a=e.doc.sel.ranges[o].head.line,s={anchor:ya(a,0),head:ya(a+1,0)};r.push(s);n.push(e.getRange(s.anchor,s.head))}if("cut"==t.type)e.setSelections(r,null,gs);else{i.prevInput="";i.input.value=n.join("\n");xs(i.input)}Da=n}"cut"==t.type&&(e.state.cutIncoming=!0)}var i=e.display;us(i.scroller,"mousedown",un(e,En));Zo&&11>ea?us(i.scroller,"dblclick",un(e,function(t){if(!ao(e,t)){var n=Mn(e,t);if(n&&!Fn(e,t)&&!_n(e.display,t)){as(t);var r=e.findWordAt(n);rt(e.doc,r.anchor,r.head)}}})):us(i.scroller,"dblclick",function(t){ao(e,t)||as(t)});us(i.lineSpace,"selectstart",function(e){_n(i,e)||as(e)});ga||us(i.scroller,"contextmenu",function(t){er(e,t)});us(i.scroller,"scroll",function(){if(i.scroller.clientHeight){Wn(e,i.scroller.scrollTop);zn(e,i.scroller.scrollLeft,!0);fs(e,"scroll",e)}});us(i.scrollbarV,"scroll",function(){i.scroller.clientHeight&&Wn(e,i.scrollbarV.scrollTop)});us(i.scrollbarH,"scroll",function(){i.scroller.clientHeight&&zn(e,i.scrollbarH.scrollLeft)});us(i.scroller,"mousewheel",function(t){Bn(e,t)});us(i.scroller,"DOMMouseScroll",function(t){Bn(e,t)});us(i.scrollbarH,"mousedown",t);us(i.scrollbarV,"mousedown",t);us(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0});us(i.input,"keyup",function(t){Yn.call(e,t)});us(i.input,"input",function(){Zo&&ea>=9&&e.display.inputHasSelection&&(e.display.inputHasSelection=null);Cn(e)});us(i.input,"keydown",un(e,Xn));us(i.input,"keypress",un(e,Kn));us(i.input,"focus",bo(Qn,e));us(i.input,"blur",bo(Zn,e));if(e.options.dragDrop){us(i.scroller,"dragstart",function(t){Rn(e,t)});us(i.scroller,"dragenter",n);us(i.scroller,"dragover",n);us(i.scroller,"drop",un(e,Pn))}us(i.scroller,"paste",function(t){if(!_n(i,t)){e.state.pasteIncoming=!0;kn(e);Cn(e)}});us(i.input,"paste",function(){if(ta&&!e.state.fakedLastChar&&!(new Date-e.state.lastMiddleDown<200)){var t=i.input.selectionStart,n=i.input.selectionEnd;i.input.value+="$";i.input.selectionEnd=n;i.input.selectionStart=t;e.state.fakedLastChar=!0}e.state.pasteIncoming=!0;Cn(e)});us(i.input,"cut",r);us(i.input,"copy",r);aa&&us(i.sizer,"mouseup",function(){Lo()==i.input&&i.input.blur();kn(e)})}function Nn(e){var t=e.display;if(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth){t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;e.setSize()}}function _n(e,t){for(var n=no(t);n!=e.wrapper;n=n.parentNode)if(!n||n.ignoreEvents||n.parentNode==e.sizer&&n!=e.mover)return!0}function Mn(e,t,n,r){var i=e.display;if(!n){var o=no(t);if(o==i.scrollbarH||o==i.scrollbarV||o==i.scrollbarFiller||o==i.gutterFiller)return null}var a,s,l=i.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left;s=t.clientY-l.top}catch(t){return null}var u,c=Xt(e,a,s);if(r&&1==c.xRel&&(u=Ei(e.doc,c.line).text).length==c.ch){var f=ys(u,u.length,e.options.tabSize)-u.length;c=ya(c.line,Math.max(0,Math.round((a-Lt(e.display).left)/Kt(e.display))-f))}return c}function En(e){if(!ao(this,e)){var t=this,n=t.display;n.shift=e.shiftKey;if(_n(n,e)){if(!ta){n.scroller.draggable=!1;setTimeout(function(){n.scroller.draggable=!0},100)}}else if(!Fn(t,e)){var r=Mn(t,e);window.focus();switch(ro(e)){case 1:r?jn(t,e,r):no(e)==n.scroller&&as(e);break;case 2:ta&&(t.state.lastMiddleDown=+new Date);r&&rt(t.doc,r);setTimeout(bo(kn,t),20);as(e);break;case 3:ga&&er(t,e)}}}}function jn(e,t,n){setTimeout(bo(Dn,e),0);var r,i=+new Date;if(Ca&&Ca.time>i-400&&0==ba(Ca.pos,n))r="triple";else if(wa&&wa.time>i-400&&0==ba(wa.pos,n)){r="double";Ca={time:i,pos:n}}else{r="single";wa={time:i,pos:n}}var o=e.doc.sel,a=fa?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ms&&!Ln(e)&&"single"==r&&o.contains(n)>-1&&o.somethingSelected()?In(e,t,n,a):Hn(e,t,n,r,a)}function In(e,t,n,r){var i=e.display,o=un(e,function(a){ta&&(i.scroller.draggable=!1);e.state.draggingText=!1;cs(document,"mouseup",o);cs(i.scroller,"drop",o);if(Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10){as(a);r||rt(e.doc,n);kn(e);Zo&&9==ea&&setTimeout(function(){document.body.focus();kn(e)},20)}});ta&&(i.scroller.draggable=!0);e.state.draggingText=o;i.scroller.dragDrop&&i.scroller.dragDrop();us(document,"mouseup",o);us(i.scroller,"drop",o)}function Hn(e,t,n,r,i){function o(t){if(0!=ba(g,t)){g=t;if("rect"==r){for(var i=[],o=e.options.tabSize,a=ys(Ei(u,n.line).text,n.ch,o),s=ys(Ei(u,t.line).text,t.ch,o),l=Math.min(a,s),h=Math.max(a,s),p=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=p;p++){var v=Ei(u,p).text,y=fo(v,l,o);l==h?i.push(new X(ya(p,y),ya(p,y))):v.length>y&&i.push(new X(ya(p,y),ya(p,fo(v,h,o))))}i.length||i.push(new X(n,n));ut(u,J(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1});e.scrollIntoView(t)}else{var b=c,x=b.anchor,w=t;if("single"!=r){if("double"==r)var C=e.findWordAt(t);else var C=new X(ya(t.line,0),Q(u,ya(t.line+1,0)));if(ba(C.anchor,x)>0){w=C.head;x=G(b.from(),C.anchor)}else{w=C.anchor;x=V(b.to(),C.head)}}var i=d.ranges.slice(0);i[f]=new X(Q(u,x),w);ut(u,J(i,f),ms)}}}function a(t){var n=++y,i=Mn(e,t,!0,"rect"==r);if(i)if(0!=ba(i,g)){Dn(e);o(i);var s=v(l,u);(i.line>=s.to||i.line<s.from)&&setTimeout(un(e,function(){y==n&&a(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(un(e,function(){if(y==n){l.scroller.scrollTop+=c;a(t)}}),50)}}function s(t){y=1/0;as(t);kn(e);cs(document,"mousemove",b);cs(document,"mouseup",x);u.history.lastSelOrigin=null}var l=e.display,u=e.doc;as(t);var c,f,d=u.sel;if(i&&!t.shiftKey){f=u.sel.contains(n);c=f>-1?u.sel.ranges[f]:new X(n,n)}else c=u.sel.primary();if(t.altKey){r="rect";i||(c=new X(n,n));n=Mn(e,t,!0,!0);f=-1}else if("double"==r){var h=e.findWordAt(n);c=e.display.shift||u.extend?nt(u,c,h.anchor,h.head):h}else if("triple"==r){var p=new X(ya(n.line,0),Q(u,ya(n.line+1,0)));c=e.display.shift||u.extend?nt(u,c,p.anchor,p.head):p}else c=nt(u,c,n);if(i)if(f>-1)ot(u,f,c,ms);else{f=u.sel.ranges.length;ut(u,J(u.sel.ranges.concat([c]),f),{scroll:!1,origin:"*mouse"})}else{f=0;ut(u,new $([c],0),ms);d=u.sel}var g=n,m=l.wrapper.getBoundingClientRect(),y=0,b=un(e,function(e){ro(e)?a(e):s(e)}),x=un(e,s);us(document,"mousemove",b);us(document,"mouseup",x)}function On(e,t,n,r,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&as(t);var s=e.display,l=s.lineDiv.getBoundingClientRect();if(a>l.bottom||!lo(e,n))return to(t);a-=l.top-s.viewOffset;for(var u=0;u<e.options.gutters.length;++u){var c=s.gutters.childNodes[u];if(c&&c.getBoundingClientRect().right>=o){var f=Fi(e.doc,a),d=e.options.gutters[u];i(e,n,e,f,d,t);return to(t)}}}function Fn(e,t){return On(e,t,"gutterClick",!0,io)}function Pn(e){var t=this;if(!ao(t,e)&&!_n(t.display,e)){as(e);Zo&&(La=+new Date);var n=Mn(t,e,!0),r=e.dataTransfer.files;if(n&&!Ln(t))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(e,r){var s=new FileReader;s.onload=un(t,function(){o[r]=s.result;if(++a==i){n=Q(t.doc,n);var e={from:n,to:n,text:Es(o.join("\n")),origin:"paste"};sr(t.doc,e);lt(t.doc,Y(n,Ea(e)))}});s.readAsText(e)},l=0;i>l;++l)s(r[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e);setTimeout(bo(kn,t),20);return}try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(fa?e.metaKey:e.ctrlKey))var u=t.listSelections();ct(t.doc,Y(n,n));if(u)for(var l=0;l<u.length;++l)hr(t.doc,"",u[l].anchor,u[l].head,"drag");t.replaceSelection(o,"around","paste");kn(t)}}catch(e){}}}}function Rn(e,t){if(Zo&&(!e.state.draggingText||+new Date-La<100))ls(t);else if(!ao(e,t)&&!_n(e.display,t)){t.dataTransfer.setData("Text",e.getSelection());if(t.dataTransfer.setDragImage&&!oa){var n=So("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(ia){n.width=n.height=1;e.display.wrapper.appendChild(n);n._top=n.offsetTop}t.dataTransfer.setDragImage(n,0,0);ia&&n.parentNode.removeChild(n)}}}function Wn(e,t){if(!(Math.abs(e.doc.scrollTop-t)<2)){e.doc.scrollTop=t;Yo||k(e,{top:t});e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t);e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t);Yo&&k(e);wt(e,100)}}function zn(e,t,n){if(!(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth);e.doc.scrollLeft=t;y(e);e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t);e.display.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t)}}function Bn(e,t){var n=t.wheelDeltaX,r=t.wheelDeltaY;null==n&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(n=t.detail);null==r&&t.detail&&t.axis==t.VERTICAL_AXIS?r=t.detail:null==r&&(r=t.wheelDelta);var i=e.display,o=i.scroller;if(n&&o.scrollWidth>o.clientWidth||r&&o.scrollHeight>o.clientHeight){if(r&&fa&&ta)e:for(var a=t.target,s=i.view;a!=o;a=a.parentNode)for(var l=0;l<s.length;l++)if(s[l].node==a){e.display.currentWheelTarget=a;break e}if(!n||Yo||ia||null==Na){if(r&&null!=Na){var u=r*Na,c=e.doc.scrollTop,f=c+i.wrapper.clientHeight;0>u?c=Math.max(0,c+u-50):f=Math.min(e.doc.height,f+u+50);k(e,{top:c,bottom:f})}if(20>Aa)if(null==i.wheelStartX){i.wheelStartX=o.scrollLeft;i.wheelStartY=o.scrollTop;i.wheelDX=n;i.wheelDY=r;setTimeout(function(){if(null!=i.wheelStartX){var e=o.scrollLeft-i.wheelStartX,t=o.scrollTop-i.wheelStartY,n=t&&i.wheelDY&&t/i.wheelDY||e&&i.wheelDX&&e/i.wheelDX;i.wheelStartX=i.wheelStartY=null;if(n){Na=(Na*Aa+n)/(Aa+1);++Aa}}},200)}else{i.wheelDX+=n;i.wheelDY+=r}}else{r&&Wn(e,Math.max(0,Math.min(o.scrollTop+r*Na,o.scrollHeight-o.clientHeight)));zn(e,Math.max(0,Math.min(o.scrollLeft+n*Na,o.scrollWidth-o.clientWidth)));as(t);i.wheelStartX=null}}}function qn(e,t,n){if("string"==typeof t){t=qa[t];if(!t)return!1}e.display.pollingFast&&Sn(e)&&(e.display.pollingFast=!1);var r=e.display.shift,i=!1;try{Ln(e)&&(e.state.suppressEdits=!0);n&&(e.display.shift=!1);i=t(e)!=ps}finally{e.display.shift=r;e.state.suppressEdits=!1}return i}function Un(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Va(t,e.state.keyMaps[r],n);if(i)return i}return e.options.extraKeys&&Va(t,e.options.extraKeys,n)||Va(t,e.options.keyMap,n)}function Vn(e,t,n,r){var i=e.state.keySeq;if(i){if(Ga(t))return"handled";_a.set(50,function(){if(e.state.keySeq==i){e.state.keySeq=null;Tn(e)}});t=i+" "+t}var o=Un(e,t,r);"multi"==o&&(e.state.keySeq=t);"handled"==o&&io(e,"keyHandled",e,t,n);if("handled"==o||"multi"==o){as(n);xt(e)}if(i&&!o&&/\'$/.test(t)){as(n);return!0}return!!o}function Gn(e,t){var n=$a(t,!0);return n?t.shiftKey&&!e.state.keySeq?Vn(e,"Shift-"+n,t,function(t){return qn(e,t,!0)})||Vn(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?qn(e,t):void 0}):Vn(e,n,t,function(t){return qn(e,t)}):!1}function $n(e,t,n){return Vn(e,"'"+n+"'",t,function(t){return qn(e,t,!0)})}function Xn(e){var t=this;Dn(t);if(!ao(t,e)){Zo&&11>ea&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=Gn(t,e);if(ia){Ma=r?n:null;!r&&88==n&&!Is&&(fa?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")}18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||Jn(t)}}function Jn(e){function t(e){if(18==e.keyCode||!e.altKey){As(n,"CodeMirror-crosshair");cs(document,"keyup",t);cs(document,"mouseover",t)}}var n=e.display.lineDiv;Ns(n,"CodeMirror-crosshair");us(document,"keyup",t);us(document,"mouseover",t)}function Yn(e){16==e.keyCode&&(this.doc.sel.shift=!1);ao(this,e)}function Kn(e){var t=this;if(!(ao(t,e)||e.ctrlKey&&!e.altKey||fa&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(ia&&n==Ma){Ma=null;as(e)}else if(!(ia&&(!e.which||e.which<10)||aa)||!Gn(t,e)){var i=String.fromCharCode(null==r?n:r);if(!$n(t,e,i)){Zo&&ea>=9&&(t.display.inputHasSelection=null);Cn(t)}}}}function Qn(e){if("nocursor"!=e.options.readOnly){if(!e.state.focused){fs(e,"focus",e);e.state.focused=!0;Ns(e.display.wrapper,"CodeMirror-focused");if(!e.curOp&&e.display.selForContextMenu!=e.doc.sel){Tn(e);ta&&setTimeout(bo(Tn,e,!0),0)}}wn(e);xt(e)}}function Zn(e){if(e.state.focused){fs(e,"blur",e);e.state.focused=!1;As(e.display.wrapper,"CodeMirror-focused")}clearInterval(e.display.blinker);setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function er(e,t){function n(){if(null!=i.input.selectionStart){var t=e.somethingSelected(),n=i.input.value="​"+(t?i.input.value:"");i.prevInput=t?"":"​";i.input.selectionStart=1;i.input.selectionEnd=n.length;i.selForContextMenu=e.doc.sel}}function r(){i.inputDiv.style.position="relative";i.input.style.cssText=l;Zo&&9>ea&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=a);wn(e);if(null!=i.input.selectionStart){(!Zo||Zo&&9>ea)&&n();var t=0,r=function(){i.selForContextMenu==e.doc.sel&&0==i.input.selectionStart?un(e,qa.selectAll)(e):t++<10?i.detectingSelectAll=setTimeout(r,500):Tn(e)};i.detectingSelectAll=setTimeout(r,200)}}if(!ao(e,t,"contextmenu")){var i=e.display;if(!_n(i,t)&&!tr(e,t)){var o=Mn(e,t),a=i.scroller.scrollTop;if(o&&!ia){var s=e.options.resetSelectionOnContextMenu;s&&-1==e.doc.sel.contains(o)&&un(e,ut)(e.doc,Y(o),gs);var l=i.input.style.cssText;i.inputDiv.style.position="absolute";i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(Zo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(ta)var u=window.scrollY;kn(e);ta&&window.scrollTo(null,u);Tn(e);e.somethingSelected()||(i.input.value=i.prevInput=" ");i.selForContextMenu=e.doc.sel;clearTimeout(i.detectingSelectAll);Zo&&ea>=9&&n();if(ga){ls(t);var c=function(){cs(window,"mouseup",c);setTimeout(r,20)};us(window,"mouseup",c)}else setTimeout(r,50)}}}}function tr(e,t){return lo(e,"gutterContextMenu")?On(e,t,"gutterContextMenu",!1,fs):!1}function nr(e,t){if(ba(e,t.from)<0)return e;if(ba(e,t.to)<=0)return Ea(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;e.line==t.to.line&&(r+=Ea(t).ch-t.to.ch);return ya(n,r)}function rr(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new X(nr(i.anchor,t),nr(i.head,t)))}return J(n,e.sel.primIndex)}function ir(e,t,n){return e.line==t.line?ya(n.line,e.ch-t.ch+n.ch):ya(n.line+(e.line-t.line),e.ch)}function or(e,t,n){for(var r=[],i=ya(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=ir(s.from,i,o),u=ir(Ea(s),i,o);i=s.to;o=u;if("around"==n){var c=e.sel.ranges[a],f=ba(c.head,c.anchor)<0;r[a]=new X(f?u:l,f?l:u)}else r[a]=new X(l,l)}return new $(r,e.sel.primIndex)}function ar(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};n&&(r.update=function(t,n,r,i){t&&(this.from=Q(e,t));n&&(this.to=Q(e,n));r&&(this.text=r);void 0!==i&&(this.origin=i)});fs(e,"beforeChange",e,r);e.cm&&fs(e.cm,"beforeChange",e.cm,r);return r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function sr(e,t,n){if(e.cm){if(!e.cm.curOp)return un(e.cm,sr)(e,t,n);if(e.cm.state.suppressEdits)return}if(lo(e,"beforeChange")||e.cm&&lo(e.cm,"beforeChange")){t=ar(e,t,!0);if(!t)return}var r=ma&&!n&&qr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)lr(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else lr(e,t)}function lr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ba(t.from,t.to)){var n=rr(e,t);Ui(e,t,n,e.cm?e.cm.curOp.id:0/0);fr(e,t,n,Wr(e,t));var r=[];_i(e,function(e,n){if(!n&&-1==go(r,e.history)){eo(e.history,t);r.push(e.history)}fr(e,t,null,Wr(e,t))})}}function ur(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,l=0;l<a.length;l++){r=a[l];if(n?r.ranges&&!r.equals(e.sel):!r.ranges)break}if(l!=a.length){i.lastOrigin=i.lastSelOrigin=null;for(;;){r=a.pop();if(!r.ranges)break;$i(r,s);if(n&&!r.equals(e.sel)){ut(e,r,{clearRedo:!1});return}o=r}var u=[];$i(o,s);s.push({changes:u,generation:i.generation});i.generation=r.generation||++i.maxGeneration;for(var c=lo(e,"beforeChange")||e.cm&&lo(e.cm,"beforeChange"),l=r.changes.length-1;l>=0;--l){var f=r.changes[l];f.origin=t;if(c&&!ar(e,f,!1)){a.length=0;return}u.push(zi(e,f));var d=l?rr(e,f):po(a);fr(e,f,d,Br(e,f));!l&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Ea(f)});var h=[];_i(e,function(e,t){if(!t&&-1==go(h,e.history)){eo(e.history,f); h.push(e.history)}fr(e,f,null,Br(e,f))})}}}}function cr(e,t){if(0!=t){e.first+=t;e.sel=new $(mo(e.sel.ranges,function(e){return new X(ya(e.anchor.line+t,e.anchor.ch),ya(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){pn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)gn(e.cm,r,"gutter")}}}function fr(e,t,n,r){if(e.cm&&!e.cm.curOp)return un(e.cm,fr)(e,t,n,r);if(t.to.line<e.first)cr(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);cr(e,i);t={from:ya(e.first,0),to:ya(t.to.line+i,t.to.ch),text:[po(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ya(o,Ei(e,o).text.length),text:[t.text[0]],origin:t.origin});t.removed=ji(e,t.from,t.to);n||(n=rr(e,t));e.cm?dr(e.cm,t,r):Li(e,t,r);ct(e,n,gs)}}function dr(e,t,n){var r=e.doc,i=e.display,a=t.from,s=t.to,l=!1,u=a.line;if(!e.options.lineWrapping){u=Oi(Zr(Ei(r,a.line)));r.iter(u,s.line+1,function(e){if(e==i.maxLine){l=!0;return!0}})}r.sel.contains(t.from,t.to)>-1&&so(e);Li(r,t,n,o(e));if(!e.options.lineWrapping){r.iter(u,a.line+t.text.length,function(e){var t=f(e);if(t>i.maxLineLength){i.maxLine=e;i.maxLineLength=t;i.maxLineChanged=!0;l=!1}});l&&(e.curOp.updateMaxLine=!0)}r.frontier=Math.min(r.frontier,a.line);wt(e,400);var c=t.text.length-(s.line-a.line)-1;a.line!=s.line||1!=t.text.length||Di(e.doc,t)?pn(e,a.line,s.line+1,c):gn(e,a.line,"text");var d=lo(e,"changes"),h=lo(e,"change");if(h||d){var p={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&io(e,"change",e,p);d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function hr(e,t,n,r,i){r||(r=n);if(ba(r,n)<0){var o=r;r=n;n=o}"string"==typeof t&&(t=Es(t));sr(e,{from:n,to:r,text:t,origin:i})}function pr(e,t){if(!ao(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(null!=i&&!la){var o=So("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-kt(e.display))+"px; height: "+(t.bottom-t.top+hs)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o);o.scrollIntoView(i);e.display.lineSpace.removeChild(o)}}}function gr(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=Vt(e,t),s=n&&n!=t?Vt(e,n):a,l=vr(e,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=l.scrollTop){Wn(e,l.scrollTop);Math.abs(e.doc.scrollTop-u)>1&&(o=!0)}if(null!=l.scrollLeft){zn(e,l.scrollLeft);Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)}if(!o)return a}}function mr(e,t,n,r,i){var o=vr(e,t,n,r,i);null!=o.scrollTop&&Wn(e,o.scrollTop);null!=o.scrollLeft&&zn(e,o.scrollLeft)}function vr(e,t,n,r,i){var o=e.display,a=Yt(e.display);0>n&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=o.scroller.clientHeight-hs,u={};i-n>l&&(i=n+l);var c=e.doc.height+Dt(o),f=a>n,d=i>c-a;if(s>n)u.scrollTop=f?0:n;else if(i>s+l){var h=Math.min(n,(d?c:i)-l);h!=s&&(u.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=o.scroller.clientWidth-hs-o.gutters.offsetWidth,m=r-t>g;m&&(r=t+g);10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(m?0:10)):r>g+p-3&&(u.scrollLeft=r+(m?0:10)-g);return u}function yr(e,t,n){(null!=t||null!=n)&&xr(e);null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t);null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function br(e){xr(e);var t=e.getCursor(),n=t,r=t;if(!e.options.lineWrapping){n=t.ch?ya(t.line,t.ch-1):t;r=ya(t.line,t.ch+1)}e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Gt(e,t.from),r=Gt(e,t.to),i=vr(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function wr(e,t,n,r){var i,o=e.doc;null==n&&(n="add");"smart"==n&&(o.mode.indent?i=Tt(e,t):n="prev");var a=e.options.tabSize,s=Ei(o,t),l=ys(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n){u=o.mode.indent(i,s.text.slice(c.length),s.text);if(u==ps||u>150){if(!r)return;n="prev"}}}else{u=0;n="not"}"prev"==n?u=t>o.first?ys(Ei(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n);u=Math.max(0,u);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/a);h;--h){d+=a;f+=" "}u>d&&(f+=ho(u-d));if(f!=c)hr(o,f,ya(t,0),ya(t,c.length),"+input");else for(var h=0;h<o.sel.ranges.length;h++){var p=o.sel.ranges[h];if(p.head.line==t&&p.head.ch<c.length){var d=ya(t,c.length);ot(o,h,new X(d,d));break}}s.stateAfter=null}function Cr(e,t,n,r){var i=t,o=t;"number"==typeof t?o=Ei(e,K(e,t)):i=Oi(t);if(null==i)return null;r(o,i)&&e.cm&&gn(e.cm,i,n);return o}function Sr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ba(o.from,po(r).to)<=0;){var a=r.pop();if(ba(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ln(e,function(){for(var t=r.length-1;t>=0;t--)hr(e.doc,"",r[t].from,r[t].to,"+delete");br(e)})}function Tr(e,t,n,r,i){function o(){var t=s+n;if(t<e.first||t>=e.first+e.size)return f=!1;s=t;return c=Ei(e,t)}function a(e){var t=(i?Xo:Jo)(c,l,n,!0);if(null==t){if(e||!o())return f=!1;l=i?(0>n?zo:Wo)(c):0>n?c.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,u=n,c=Ei(e,s),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(0>n)||a(!g);g=!1){var m=c.text.charAt(l)||"\n",v=xo(m,p)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";!h||g||v||(v="s");if(d&&d!=v){if(0>n){n=1;a()}break}v&&(d=v);if(n>0&&!a(!g))break}var y=pt(e,ya(s,l),u,!0);f||(y.hitSide=!0);return y}function kr(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(s-(0>n?1.5:.5)*Yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var l=Xt(e,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function Dr(t,n,r,i){e.defaults[t]=n;r&&(Ia[t]=i?function(e,t,n){n!=Ha&&r(e,t,n)}:r)}function Lr(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}t&&(e="Alt-"+e);n&&(e="Ctrl-"+e);i&&(e="Cmd-"+e);r&&(e="Shift-"+e);return e}function Ar(e){return"string"==typeof e?Ua[e]:e}function Nr(e,t,n,r,i){if(r&&r.shared)return _r(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return un(e.cm,Nr)(e,t,n,r,i);var o=new Ja(e,i),a=ba(t,n);r&&yo(r,o,!1);if(a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith){o.collapsed=!0;o.widgetNode=So("span",[o.replacedWith],"CodeMirror-widget");r.handleMouseEvents||(o.widgetNode.ignoreEvents=!0);r.insertLeft&&(o.widgetNode.insertLeft=!0)}if(o.collapsed){if(Qr(e,t.line,t,n,o)||t.line!=n.line&&Qr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");va=!0}o.addToHistory&&Ui(e,{from:t,to:n,origin:"markText"},e.sel,0/0);var s,l=t.line,u=e.cm;e.iter(l,n.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&Zr(e)==u.display.maxLine&&(s=!0);o.collapsed&&l!=t.line&&Hi(e,0);Fr(e,new Ir(o,l==t.line?t.ch:null,l==n.line?n.ch:null));++l});o.collapsed&&e.iter(t.line,n.line+1,function(t){ri(e,t)&&Hi(t,0)});o.clearOnEnter&&us(o,"beforeCursorEnter",function(){o.clear()});if(o.readOnly){ma=!0;(e.history.done.length||e.history.undone.length)&&e.clearHistory()}if(o.collapsed){o.id=++Ya;o.atomic=!0}if(u){s&&(u.curOp.updateMaxLine=!0);if(o.collapsed)pn(u,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle)for(var c=t.line;c<=n.line;c++)gn(u,c,"text");o.atomic&&dt(u.doc);io(u,"markerAdded",u,o)}return o}function _r(e,t,n,r,i){r=yo(r);r.shared=!1;var o=[Nr(e,t,n,r,i)],a=o[0],s=r.widgetNode;_i(e,function(e){s&&(r.widgetNode=s.cloneNode(!0));o.push(Nr(e,Q(e,t),Q(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=po(o)});return new Ka(o,a)}function Mr(e){return e.findMarks(ya(e.first,0),e.clipPos(ya(e.lastLine())),function(e){return e.parent})}function Er(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ba(o,a)){var s=Nr(e,o,a,r.primary,r.primary.type);r.markers.push(s);s.parent=r}}}function jr(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];_i(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];if(-1==go(r,o.doc)){o.parent=null;n.markers.splice(i--,1)}}}}function Ir(e,t,n){this.marker=e;this.from=t;this.to=n}function Hr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Or(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Fr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t];t.marker.attachLine(e)}function Pr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Ir(a,o.from,l?null:o.to))}}return r}function Rr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Ir(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Wr(e,t){var n=et(e,t.from.line)&&Ei(e,t.from.line).markedSpans,r=et(e,t.to.line)&&Ei(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ba(t.from,t.to),s=Pr(n,i,a),l=Rr(r,o,a),u=1==t.text.length,c=po(t.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null==d.to){var h=Hr(l,d.marker);h?u&&(d.to=null==h.to?null:h.to+c):d.to=i}}if(l)for(var f=0;f<l.length;++f){var d=l[f];null!=d.to&&(d.to+=c);if(null==d.from){var h=Hr(s,d.marker);if(!h){d.from=c;u&&(s||(s=[])).push(d)}}else{d.from+=c;u&&(s||(s=[])).push(d)}}s&&(s=zr(s));l&&l!=s&&(l=zr(l));var p=[s];if(!u){var g,m=t.text.length-2;if(m>0&&s)for(var f=0;f<s.length;++f)null==s[f].to&&(g||(g=[])).push(new Ir(s[f].marker,null,null));for(var f=0;m>f;++f)p.push(g);p.push(l)}return p}function zr(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Br(e,t){var n=Yi(e,t),r=Wr(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function qr(e,t,n){var r=null;e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=go(r,n)||(r||(r=[])).push(n)}});if(!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(ba(u.to,s.from)<0||ba(u.from,s.to)>0)){var c=[l,1],f=ba(u.from,s.from),d=ba(u.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from});(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to});i.splice.apply(i,c);l+=c.length-1}}return i}function Ur(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Vr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Gr(e){return e.inclusiveLeft?-1:0}function $r(e){return e.inclusiveRight?1:0}function Xr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ba(r.from,i.from)||Gr(e)-Gr(t);if(o)return-o;var a=ba(r.to,i.to)||$r(e)-$r(t);return a?a:t.id-e.id}function Jr(e,t){var n,r=va&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o){i=r[o];i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||Xr(n,i.marker)<0)&&(n=i.marker)}return n}function Yr(e){return Jr(e,!0)}function Kr(e){return Jr(e,!1)}function Qr(e,t,n,r,i){var o=Ei(e,t),a=va&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=ba(u.from,n)||Gr(l.marker)-Gr(i),f=ba(u.to,r)||$r(l.marker)-$r(i);if(!(c>=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(ba(u.to,n)>0||l.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(ba(u.from,r)<0||l.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function Zr(e){for(var t;t=Yr(e);)e=t.find(-1,!0).line;return e}function ei(e){for(var t,n;t=Kr(e);){e=t.find(1,!0).line;(n||(n=[])).push(e)}return n}function ti(e,t){var n=Ei(e,t),r=Zr(n);return n==r?t:Oi(r)}function ni(e,t){if(t>e.lastLine())return t;var n,r=Ei(e,t);if(!ri(e,r))return t;for(;n=Kr(r);)r=n.find(1,!0).line;return Oi(r)+1}function ri(e,t){var n=va&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i){r=n[i];if(r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ii(e,t,r))return!0}}}function ii(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return ii(e,r.line,Hr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o){i=t.markedSpans[o];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ii(e,t,i))return!0}}function oi(e,t,n){Pi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&yr(e,null,n)}function ai(e){if(null!=e.height)return e.height;if(!Do(document.body,e.node)){var t="position: relative;";e.coverGutter&&(t+="margin-left: -"+e.cm.getGutterElement().offsetWidth+"px;");ko(e.cm.display.measure,So("div",[e.node],null,t))}return e.height=e.node.offsetHeight}function si(e,t,n,r){var i=new Qa(e,n,r);i.noHScroll&&(e.display.alignWidgets=!0);Cr(e.doc,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i);i.line=t;if(!ri(e.doc,t)){var r=Pi(t)<e.doc.scrollTop;Hi(t,t.height+ai(i));r&&yr(e,null,i.height);e.curOp.forceUpdate=!0}return!0});return i}function li(e,t,n,r){e.text=t;e.stateAfter&&(e.stateAfter=null);e.styles&&(e.styles=null);null!=e.order&&(e.order=null);Ur(e);Vr(e,n);var i=r?r(e):1;i!=e.height&&Hi(e,i)}function ui(e){e.parent=null;Ur(e)}function ci(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function fi(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function di(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function hi(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?za(a.mode,c):c}}var o,a=e.doc,s=a.mode;t=Q(a,t);var l,u=Ei(a,t.line),c=Tt(e,t.line,n),f=new Xa(u.text,e.options.tabSize);r&&(l=[]);for(;(r||f.pos<t.ch)&&!f.eol();){f.start=f.pos;o=di(s,f,c);r&&l.push(i(!0))}return r?l:i()}function pi(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,u=0,c=null,f=new Xa(t,e.options.tabSize),d=e.options.addModeClass&&[null];""==t&&ci(fi(n,r),o);for(;!f.eol();){if(f.pos>e.options.maxHighlightLength){s=!1;a&&vi(e,t,r,f.pos);f.pos=t.length;l=null}else l=ci(di(n,f,r,d),o);if(d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||c!=l){u<f.start&&i(f.start,c);u=f.start;c=l}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e4);i(p,c);u=p}}function gi(e,t,n,r){var i=[e.state.modeGen],o={};pi(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var s=e.state.overlays[a],l=1,u=0;pi(e,t.text,s.mode,!0,function(e,t){for(var n=l;e>u;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r);l+=2;u=Math.min(e,r)}if(t)if(s.opaque){i.splice(n,l-n,e,"cm-overlay "+t);l=n+2}else for(;l>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mi(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=gi(e,t,t.stateAfter=Tt(e,Oi(t)));t.styles=r.styles;r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null);n===e.doc.frontier&&e.doc.frontier++}return t.styles}function vi(e,t,n,r){var i=e.doc.mode,o=new Xa(t,e.options.tabSize);o.start=o.pos=r||0;""==t&&fi(i,n);for(;!o.eol()&&o.pos<=e.options.maxHighlightLength;){di(i,o,n);o.start=o.pos}}function yi(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ts:es;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function bi(e,t){var n=So("span",null,null,ta?"padding-right: .1px":null),r={pre:So("pre",[n]),content:n,col:0,pos:0,cm:e};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0;r.addToken=wi;(Zo||ta)&&e.getOption("lineWrapping")&&(r.addToken=Ci(r.addToken));Ho(e.display.measure)&&(o=Ri(a))&&(r.addToken=Si(r.addToken,o));r.map=[];var s=t!=e.display.externalMeasured&&Oi(a);ki(a,r,mi(e,a,s));if(a.styleClasses){a.styleClasses.bgClass&&(r.bgClass=No(a.styleClasses.bgClass,r.bgClass||""));a.styleClasses.textClass&&(r.textClass=No(a.styleClasses.textClass,r.textClass||""))}0==r.map.length&&r.map.push(0,0,r.content.appendChild(Io(e.display.measure)));if(0==i){t.measure.map=r.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(r.map);(t.measure.caches||(t.measure.caches=[])).push({})}}ta&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack");fs(e,"renderLine",e,t.line,r.pre);r.pre.className&&(r.textClass=No(r.pre.className,r.textClass||""));return r}function xi(e){var t=So("span","•","cm-invalidchar");t.title="\\u"+e.charCodeAt(0).toString(16);return t}function wi(e,t,n,r,i,o){if(t){var a=e.cm.options.specialChars,s=!1;if(a.test(t))for(var l=document.createDocumentFragment(),u=0;;){a.lastIndex=u;var c=a.exec(t),f=c?c.index-u:t.length-u;if(f){var d=document.createTextNode(t.slice(u,u+f));l.appendChild(Zo&&9>ea?So("span",[d]):d);e.map.push(e.pos,e.pos+f,d);e.col+=f;e.pos+=f}if(!c)break;u+=f+1;if(" "==c[0]){var h=e.cm.options.tabSize,p=h-e.col%h,d=l.appendChild(So("span",ho(p),"cm-tab"));e.col+=p}else{var d=e.cm.options.specialCharPlaceholder(c[0]);l.appendChild(Zo&&9>ea?So("span",[d]):d);e.col+=1}e.map.push(e.pos,e.pos+1,d);e.pos++}else{e.col+=t.length;var l=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,l);Zo&&9>ea&&(s=!0);e.pos+=t.length}if(n||r||i||s){var g=n||"";r&&(g+=r);i&&(g+=i);var m=So("span",[l],g);o&&(m.title=o);return e.content.appendChild(m)}e.content.appendChild(l)}}function Ci(e){function t(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";t+=" ";return t}return function(n,r,i,o,a,s){e(n,r.replace(/ {3,}/g,t),i,o,a,s)}}function Si(e,t){return function(n,r,i,o,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,u=l+r.length;;){for(var c=0;c<t.length;c++){var f=t[c];if(f.to>l&&f.from<=l)break}if(f.to>=u)return e(n,r,i,o,a,s);e(n,r.slice(0,f.to-l),i,o,null,s);o=null;r=r.slice(f.to-l);l=f.to}}}function Ti(e,t,n,r){var i=!r&&n.widgetNode;if(i){e.map.push(e.pos,e.pos+t,i);e.content.appendChild(i)}e.pos+=t}function ki(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,f,d=i.length,h=0,p=1,g="",m=0;;){if(m==h){s=l=u=c="";f=null;m=1/0;for(var v=[],y=0;y<r.length;++y){var b=r[y],x=b.marker;if(b.from<=h&&(null==b.to||b.to>h)){if(null!=b.to&&m>b.to){m=b.to;l=""}x.className&&(s+=" "+x.className);x.startStyle&&b.from==h&&(u+=" "+x.startStyle);x.endStyle&&b.to==m&&(l+=" "+x.endStyle);x.title&&!c&&(c=x.title);x.collapsed&&(!f||Xr(f.marker,x)<0)&&(f=b)}else b.from>h&&m>b.from&&(m=b.from);"bookmark"==x.type&&b.from==h&&x.widgetNode&&v.push(x)}if(f&&(f.from||0)==h){Ti(t,(null==f.to?d+1:f.to)-h,f.marker,null==f.from);if(null==f.to)return}if(!f&&v.length)for(var y=0;y<v.length;++y)Ti(t,0,v[y])}if(h>=d)break;for(var w=Math.min(d,m);;){if(g){var C=h+g.length;if(!f){var S=C>w?g.slice(0,w-h):g;t.addToken(t,S,a?a+s:s,u,h+S.length==m?l:"",c)}if(C>=w){g=g.slice(w-h);h=w;break}h=C;u=""}g=i.slice(o,o=n[p++]);a=yi(n[p++],t.cm.options)}}else for(var p=1;p<n.length;p+=2)t.addToken(t,i.slice(o,o=n[p]),yi(n[p+1],t.cm.options))}function Di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==po(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Li(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){li(e,n,i,r);io(e,"change",e,t)}var a=t.from,s=t.to,l=t.text,u=Ei(e,a.line),c=Ei(e,s.line),f=po(l),d=i(l.length-1),h=s.line-a.line;if(Di(e,t)){for(var p=0,g=[];p<l.length-1;++p)g.push(new Za(l[p],i(p),r));o(c,c.text,d);h&&e.remove(a.line,h);g.length&&e.insert(a.line,g)}else if(u==c)if(1==l.length)o(u,u.text.slice(0,a.ch)+f+u.text.slice(s.ch),d);else{for(var g=[],p=1;p<l.length-1;++p)g.push(new Za(l[p],i(p),r));g.push(new Za(f+u.text.slice(s.ch),d,r));o(u,u.text.slice(0,a.ch)+l[0],i(0));e.insert(a.line+1,g)}else if(1==l.length){o(u,u.text.slice(0,a.ch)+l[0]+c.text.slice(s.ch),i(0));e.remove(a.line+1,h)}else{o(u,u.text.slice(0,a.ch)+l[0],i(0));o(c,f+c.text.slice(s.ch),d);for(var p=1,g=[];p<l.length-1;++p)g.push(new Za(l[p],i(p),r));h>1&&e.remove(a.line+1,h-1);e.insert(a.line+1,g)}io(e,"change",e,t)}function Ai(e){this.lines=e;this.parent=null;for(var t=0,n=0;t<e.length;++t){e[t].parent=this;n+=e[t].height}this.height=n}function Ni(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize();n+=i.height;i.parent=this}this.size=t;this.height=n;this.parent=null}function _i(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;if(!n||l){t(s.doc,l);r(s.doc,e,l)}}}}r(e,null,!0)}function Mi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t;t.cm=e;a(e);n(e);e.options.lineWrapping||d(e);e.options.mode=t.modeOption;pn(e)}function Ei(e,t){t-=e.first;if(0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function ji(e,t,n){var r=[],i=t.line;e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch));i==t.line&&(o=o.slice(t.ch));r.push(o);++i});return r}function Ii(e,t,n){var r=[];e.iter(t,n,function(e){r.push(e.text)});return r}function Hi(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Oi(e){if(null==e.parent)return null;for(var t=e.parent,n=go(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Fi(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o;n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],s=a.height;if(s>t)break;t-=s}return n+r}function Pi(e){e=Zr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function Ri(e){var t=e.order;null==t&&(t=e.order=Ps(e.text));return t}function Wi(e){this.done=[];this.undone=[];this.undoDepth=1/0;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=e||1}function zi(e,t){var n={from:U(t.from),to:Ea(t),text:ji(e,t.from,t.to)};Xi(e,n,t.from.line,t.to.line+1);_i(e,function(e){Xi(e,n,t.from.line,t.to.line+1)},!0);return n}function Bi(e){for(;e.length;){var t=po(e);if(!t.ranges)break;e.pop()}}function qi(e,t){if(t){Bi(e.done);return po(e.done)}if(e.done.length&&!po(e.done).ranges)return po(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges){e.done.pop();return po(e.done)}}function Ui(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=qi(i,i.lastOp==r))){var s=po(o.changes);0==ba(t.from,t.to)&&0==ba(t.from,s.to)?s.to=Ea(t):o.changes.push(zi(e,t))}else{var l=po(i.done);l&&l.ranges||$i(e.sel,i.done);o={changes:[zi(e,t)],generation:i.generation};i.done.push(o);for(;i.done.length>i.undoDepth;){i.done.shift();i.done[0].ranges||i.done.shift()}}i.done.push(n);i.generation=++i.maxGeneration;i.lastModTime=i.lastSelTime=a;i.lastOp=i.lastSelOp=r;i.lastOrigin=i.lastSelOrigin=t.origin;s||fs(e,"historyAdded")}function Vi(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Gi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Vi(e,o,po(i.done),t))?i.done[i.done.length-1]=t:$i(t,i.done);i.lastSelTime=+new Date;i.lastSelOrigin=o;i.lastSelOp=n;r&&r.clearRedo!==!1&&Bi(i.undone)}function $i(e,t){var n=po(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Xi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans);++o})}function Ji(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Yi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(Ji(n[r]));return i}function Ki(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?$.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var u,c=a[l];s.push({from:c.from,to:c.to,text:c.text});if(t)for(var f in c)if((u=f.match(/^spans_(\d+)$/))&&go(t,Number(u[1]))>-1){po(s)[f]=c[f];delete c[f]}}}}return i}function Qi(e,t,n,r){if(n<e.line)e.line+=r;else if(t<e.line){e.line=t;e.ch=0}}function Zi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){if(!o.copied){o=e[i]=o.deepCopy();o.copied=!0}for(var s=0;s<o.ranges.length;s++){Qi(o.ranges[s].anchor,t,n,r);Qi(o.ranges[s].head,t,n,r)}}else{for(var s=0;s<o.changes.length;++s){var l=o.changes[s];if(n<l.from.line){l.from=ya(l.from.line+r,l.from.ch);l.to=ya(l.to.line+r,l.to.ch)}else if(t<=l.to.line){a=!1;break}}if(!a){e.splice(0,i+1);i=0}}}}function eo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Zi(e.done,n,r,i);Zi(e.undone,n,r,i)}function to(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function no(e){return e.target||e.srcElement}function ro(e){var t=e.which;null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2));fa&&e.ctrlKey&&1==t&&(t=3);return t}function io(e,t){function n(e){return function(){e.apply(null,o)}}var r=e._handlers&&e._handlers[t];if(r){var i,o=Array.prototype.slice.call(arguments,2);if(Ta)i=Ta.delayedCallbacks;else if(ds)i=ds;else{i=ds=[];setTimeout(oo,0)}for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function oo(){var e=ds;ds=null;for(var t=0;t<e.length;++t)e[t]()}function ao(e,t,n){"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}});fs(e,n||t.type,e,t);return to(t)||t.codemirrorIgnore}function so(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==go(n,t[r])&&n.push(t[r])}function lo(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function uo(e){e.prototype.on=function(e,t){us(this,e,t)};e.prototype.off=function(e,t){cs(this,e,t)}}function co(){this.id=null}function fo(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);i+=o-r;i+=n-i%n;r=o+1;if(i>=t)return r}}function ho(e){for(;bs.length<=e;)bs.push(po(bs)+" ");return bs[e]}function po(e){return e[e.length-1]}function go(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function mo(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function vo(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e;n=new r}t&&yo(t,n);return n}function yo(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function bo(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function xo(e,t){return t?t.source.indexOf("\\w")>-1&&Ss(e)?!0:t.test(e):Ss(e)}function wo(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Co(e){return e.charCodeAt(0)>=768&&Ts.test(e)}function So(e,t,n,r){var i=document.createElement(e);n&&(i.className=n);r&&(i.style.cssText=r);if("string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function To(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ko(e,t){return To(e).appendChild(t)}function Do(e,t){if(e.contains)return e.contains(t);for(;t=t.parentNode;)if(t==e)return!0}function Lo(){return document.activeElement}function Ao(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function No(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Ao(n[r]).test(t)&&(t+=" "+n[r]);return t}function _o(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Mo(){if(!_s){Eo();_s=!0}}function Eo(){var e;us(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null;ks=null;_o(Nn)},100))});us(window,"blur",function(){_o(Zn)})}function jo(e){if(null!=ks)return ks;var t=So("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");ko(e,t);t.offsetWidth&&(ks=t.offsetHeight-t.clientHeight);return ks||0}function Io(e){if(null==Ds){var t=So("span","​");ko(e,So("span",[t,document.createTextNode("x")]));0!=e.firstChild.offsetHeight&&(Ds=t.offsetWidth<=1&&t.offsetHeight>2&&!(Zo&&8>ea))}return Ds?So("span","​"):So("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Ho(e){if(null!=Ls)return Ls;var t=ko(e,document.createTextNode("AخA")),n=ws(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=ws(t,1,2).getBoundingClientRect();return Ls=r.right-n.right<3}function Oo(e){if(null!=Hs)return Hs;var t=ko(e,So("span","x")),n=t.getBoundingClientRect(),r=ws(t,0,1).getBoundingClientRect();return Hs=Math.abs(n.left-r.left)>1}function Fo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];if(a.from<n&&a.to>t||t==n&&a.to==t){r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr");i=!0}}i||r(t,n,"ltr")}function Po(e){return e.level%2?e.to:e.from}function Ro(e){return e.level%2?e.from:e.to}function Wo(e){var t=Ri(e);return t?Po(t[0]):0}function zo(e){var t=Ri(e);return t?Ro(po(t)):e.text.length}function Bo(e,t){var n=Ei(e.doc,t),r=Zr(n);r!=n&&(t=Oi(r));var i=Ri(r),o=i?i[0].level%2?zo(r):Wo(r):0;return ya(t,o)}function qo(e,t){for(var n,r=Ei(e.doc,t);n=Kr(r);){r=n.find(1,!0).line;t=null}var i=Ri(r),o=i?i[0].level%2?Wo(r):zo(r):r.text.length;return ya(null==t?Oi(r):t,o)}function Uo(e,t){var n=Bo(e,t.line),r=Ei(e.doc,n.line),i=Ri(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ya(n.line,a?0:o)}return n}function Vo(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function Go(e,t){Fs=null; for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n){if(Vo(e,i.level,e[n].level)){i.from!=i.to&&(Fs=n);return r}i.from!=i.to&&(Fs=r);return n}n=r}}return n}function $o(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Co(e.text.charAt(t)));return t}function Xo(e,t,n,r){var i=Ri(e);if(!i)return Jo(e,t,n,r);for(var o=Go(i,t),a=i[o],s=$o(e,t,a.level%2?-n:n,r);;){if(s>a.from&&s<a.to)return s;if(s==a.from||s==a.to){if(Go(i,s)==o)return s;a=i[o+=n];return n>0==a.level%2?a.to:a.from}a=i[o+=n];if(!a)return null;s=n>0==a.level%2?$o(e,a.to,-1,r):$o(e,a.from,1,r)}}function Jo(e,t,n,r){var i=t+n;if(r)for(;i>0&&Co(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var Yo=/gecko\/\d/i.test(navigator.userAgent),Ko=/MSIE \d/.test(navigator.userAgent),Qo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Zo=Ko||Qo,ea=Zo&&(Ko?document.documentMode||6:Qo[1]),ta=/WebKit\//.test(navigator.userAgent),na=ta&&/Qt\/\d+\.\d+/.test(navigator.userAgent),ra=/Chrome\//.test(navigator.userAgent),ia=/Opera\//.test(navigator.userAgent),oa=/Apple Computer/.test(navigator.vendor),aa=/KHTML\//.test(navigator.userAgent),sa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),la=/PhantomJS/.test(navigator.userAgent),ua=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ca=ua||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),fa=ua||/Mac/.test(navigator.platform),da=/win/i.test(navigator.platform),ha=ia&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);ha&&(ha=Number(ha[1]));if(ha&&ha>=15){ia=!1;ta=!0}var pa=fa&&(na||ia&&(null==ha||12.11>ha)),ga=Yo||Zo&&ea>=9,ma=!1,va=!1,ya=e.Pos=function(e,t){if(!(this instanceof ya))return new ya(e,t);this.line=e;this.ch=t},ba=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};$.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=ba(n.anchor,r.anchor)||0!=ba(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new X(U(this.ranges[t].anchor),U(this.ranges[t].head));return new $(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ba(t,r.from())>=0&&ba(e,r.to())<=0)return n}return-1}};X.prototype={from:function(){return G(this.anchor,this.head)},to:function(){return V(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var xa,wa,Ca,Sa={left:0,right:0,top:0,bottom:0},Ta=null,ka=0,Da=null,La=0,Aa=0,Na=null;Zo?Na=-.53:Yo?Na=15:ra?Na=-.7:oa&&(Na=-1/3);var _a=new co,Ma=null,Ea=e.changeEnd=function(e){return e.text?ya(e.from.line+e.text.length-1,po(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus();kn(this);Cn(this)},setOption:function(e,t){var n=this.options,r=n[e];if(n[e]!=t||"mode"==e){n[e]=t;Ia.hasOwnProperty(e)&&un(this,Ia[e])(this,t,r)}},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ar(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e){t.splice(n,1);return!0}},addOverlay:cn(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque});this.state.modeGen++;pn(this)}),removeOverlay:cn(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e){t.splice(n,1);this.state.modeGen++;pn(this);return}}}),indentLine:cn(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract");et(this.doc,e)&&wr(this,e,t,n)}),indentSelection:cn(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty()){if(i.head.line>n){wr(this,i.head.line,e,!0);n=i.head.line;r==this.doc.sel.primIndex&&br(this)}}else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;n>l;++l)wr(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&ot(this.doc,r,new X(o,u[r].to()),gs)}}}),getTokenAt:function(e,t){return hi(this,e,t)},getLineTokens:function(e,t){return hi(this,ya(e),t,!0)},getTokenTypeAt:function(e){e=Q(this.doc,e);var t,n=mi(this,Ei(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("cm-overlay "):-1;return 0>s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!Wa.hasOwnProperty(t))return Wa;var r=Wa[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var s=r._global[o];s.pred(i,this)&&-1==go(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(e,t){var n=this.doc;e=K(n,null==e?n.first+n.size-1:e);return Tt(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();n=null==e?r.head:"object"==typeof e?Q(this.doc,e):e?r.from():r.to();return Vt(this,n,t||"page")},charCoords:function(e,t){return Ut(this,Q(this.doc,e),t||"page")},coordsChar:function(e,t){e=qt(this,e,t||"page");return Xt(this,e.left,e.top)},lineAtHeight:function(e,t){e=qt(this,{top:e,left:0},t||"page").top;return Fi(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n=!1,r=this.doc.first+this.doc.size-1;if(e<this.doc.first)e=this.doc.first;else if(e>r){e=r;n=!0}var i=Ei(this.doc,e);return Bt(this,i,{top:0,left:0},t||"page").top+(n?this.doc.height-Pi(i):0)},defaultTextHeight:function(){return Yt(this.display)},defaultCharWidth:function(){return Kt(this.display)},setGutterMarker:cn(function(e,t,n){return Cr(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});r[t]=n;!n&&wo(r)&&(e.gutterMarkers=null);return!0})}),clearGutter:cn(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){if(n.gutterMarkers&&n.gutterMarkers[e]){n.gutterMarkers[e]=null;gn(t,r,"gutter");wo(n.gutterMarkers)&&(n.gutterMarkers=null)}++r})}),addLineWidget:cn(function(e,t,n){return si(this,e,t,n)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!et(this.doc,e))return null;var t=e;e=Ei(this.doc,e);if(!e)return null}else{var t=Oi(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=Vt(this,Q(this.doc,e));var a=e.bottom,s=e.left;t.style.position="absolute";o.sizer.appendChild(t);if("over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom);s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px";t.style.left=t.style.right="";if("right"==i){s=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{"left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2);t.style.left=s+"px"}n&&mr(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:cn(Xn),triggerOnKeyPress:cn(Kn),triggerOnKeyUp:Yn,execCommand:function(e){return qa.hasOwnProperty(e)?qa[e](this):void 0},findPosH:function(e,t,n,r){var i=1;if(0>t){i=-1;t=-t}for(var o=0,a=Q(this.doc,e);t>o;++o){a=Tr(this.doc,a,i,n,r);if(a.hitSide)break}return a},moveH:cn(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Tr(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},vs)}),deleteH:cn(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Sr(this,function(n){var i=Tr(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;if(0>t){i=-1;t=-t}for(var a=0,s=Q(this.doc,e);t>a;++a){var l=Vt(this,s,"div");null==o?o=l.left:l.left=o;s=kr(this,l,i,n);if(s.hitSide)break}return s},moveV:cn(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var s=Vt(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn);i.push(s.left);var l=kr(n,s,e,t);"page"==t&&a==r.sel.primary()&&yr(n,null,Ut(n,l,"div").top-s.top);return l},vs);if(i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Ei(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),s=xo(a,o)?function(e){return xo(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!xo(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new X(ya(e.line,r),ya(e.line,i))},toggleOverwrite:function(e){if(null==e||e!=this.state.overwrite){(this.state.overwrite=!this.state.overwrite)?Ns(this.display.cursorDiv,"CodeMirror-overwrite"):As(this.display.cursorDiv,"CodeMirror-overwrite");fs(this,"overwriteToggle",this,this.state.overwrite)}},hasFocus:function(){return Lo()==this.display.input},scrollTo:cn(function(e,t){(null!=e||null!=t)&&xr(this);null!=e&&(this.curOp.scrollLeft=e);null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller,t=hs;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:cn(function(e,t){if(null==e){e={from:this.doc.sel.primary().head,to:null};null==t&&(t=this.options.cursorScrollMargin)}else"number"==typeof e?e={from:ya(e,0),to:null}:null==e.from&&(e={from:e,to:null});e.to||(e.to=e.from);e.margin=t||0;if(null!=e.from.line){xr(this);this.curOp.scrollToPos=e}else{var n=vr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:cn(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e));null!=t&&(r.display.wrapper.style.height=n(t));r.options.lineWrapping&&Pt(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){gn(r,i,"widget");break}++i});r.curOp.forceUpdate=!0;fs(r,"refresh",this)}),operation:function(e){return ln(this,e)},refresh:cn(function(){var e=this.display.cachedTextHeight;pn(this);this.curOp.forceUpdate=!0;Rt(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);c(this);(null==e||Math.abs(e-Yt(this.display))>.5)&&a(this);fs(this,"refresh",this)}),swapDoc:cn(function(e){var t=this.doc;t.cm=null;Mi(this,e);Rt(this);Tn(this);this.scrollTo(e.scrollLeft,e.scrollTop);this.curOp.forceScroll=!0;io(this,"swapDoc",this,t);return t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};uo(e);var ja=e.defaults={},Ia=e.optionHandlers={},Ha=e.Init={toString:function(){return"CodeMirror.Init"}};Dr("value","",function(e,t){e.setValue(t)},!0);Dr("mode",null,function(e,t){e.doc.modeOption=t;n(e)},!0);Dr("indentUnit",2,n,!0);Dr("indentWithTabs",!1);Dr("smartIndent",!0);Dr("tabSize",4,function(e){r(e);Rt(e);pn(e)},!0);Dr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g");e.refresh()},!0);Dr("specialCharPlaceholder",xi,function(e){e.refresh()},!0);Dr("electricChars",!0);Dr("rtlMoveVisually",!da);Dr("wholeLineUpdateBefore",!0);Dr("theme","default",function(e){s(e);l(e)},!0);Dr("keyMap","default",function(t,n,r){var i=Ar(n),o=r!=e.Init&&Ar(r);o&&o.detach&&o.detach(t,i);i.attach&&i.attach(t,o||null)});Dr("extraKeys",null);Dr("lineWrapping",!1,i,!0);Dr("gutters",[],function(e){h(e.options);l(e)},!0);Dr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?w(e.display)+"px":"0";e.refresh()},!0);Dr("coverGutterNextToScrollbar",!1,m,!0);Dr("lineNumbers",!1,function(e){h(e.options);l(e)},!0);Dr("firstLineNumber",1,l,!0);Dr("lineNumberFormatter",function(e){return e},l,!0);Dr("showCursorWhenSelecting",!1,vt,!0);Dr("resetSelectionOnContextMenu",!0);Dr("readOnly",!1,function(e,t){if("nocursor"==t){Zn(e);e.display.input.blur();e.display.disabled=!0}else{e.display.disabled=!1;t||Tn(e)}});Dr("disableInput",!1,function(e,t){t||Tn(e)},!0);Dr("dragDrop",!0);Dr("cursorBlinkRate",530);Dr("cursorScrollMargin",0);Dr("cursorHeight",1,vt,!0);Dr("singleCursorHeightPerLine",!0,vt,!0);Dr("workTime",100);Dr("workDelay",100);Dr("flattenSpans",!0,r,!0);Dr("addModeClass",!1,r,!0);Dr("pollInterval",100);Dr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t});Dr("historyEventDelay",1250);Dr("viewportMargin",10,function(e){e.refresh()},!0);Dr("maxHighlightLength",1e4,r,!0);Dr("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)});Dr("tabindex",null,function(e,t){e.display.input.tabIndex=t||""});Dr("autofocus",null);var Oa=e.modes={},Fa=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t);arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2));Oa[t]=n};e.defineMIME=function(e,t){Fa[e]=t};e.resolveMode=function(t){if("string"==typeof t&&Fa.hasOwnProperty(t))t=Fa[t];else if(t&&"string"==typeof t.name&&Fa.hasOwnProperty(t.name)){var n=Fa[t.name];"string"==typeof n&&(n={name:n});t=vo(n,t);t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}};e.getMode=function(t,n){var n=e.resolveMode(n),r=Oa[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(Pa.hasOwnProperty(n.name)){var o=Pa[n.name];for(var a in o)if(o.hasOwnProperty(a)){i.hasOwnProperty(a)&&(i["_"+a]=i[a]);i[a]=o[a]}}i.name=n.name;n.helperType&&(i.helperType=n.helperType);if(n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}});e.defineMIME("text/plain","null");var Pa=e.modeExtensions={};e.extendMode=function(e,t){var n=Pa.hasOwnProperty(e)?Pa[e]:Pa[e]={};yo(t,n)};e.defineExtension=function(t,n){e.prototype[t]=n};e.defineDocExtension=function(e,t){rs.prototype[e]=t};e.defineOption=Dr;var Ra=[];e.defineInitHook=function(e){Ra.push(e)};var Wa=e.helpers={};e.registerHelper=function(t,n,r){Wa.hasOwnProperty(t)||(Wa[t]=e[t]={_global:[]});Wa[t][n]=r};e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i);Wa[t]._global.push({pred:r,val:i})};var za=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([]));n[r]=i}return n},Ba=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state;e=n.mode}return n||{mode:e,state:t}};var qa=e.commands={selectAll:function(e){e.setSelection(ya(e.firstLine(),0),ya(e.lastLine()),gs)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),gs)},killLine:function(e){Sr(e,function(t){if(t.empty()){var n=Ei(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ya(t.head.line+1,0)}:{from:t.head,to:ya(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Sr(e,function(t){return{from:ya(t.from().line,0),to:Q(e.doc,ya(t.to().line+1,0))}})},delLineLeft:function(e){Sr(e,function(e){return{from:ya(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Sr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){Sr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(ya(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(ya(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return Bo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return Uo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return qo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},vs)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},vs)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Uo(e,t.head):r},vs)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=ys(e.getLine(o.line),o.ch,r);t.push(new Array(r-a%r+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){ln(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Ei(e.doc,i.line).text;if(o){i.ch==o.length&&(i=new ya(i.line,i.ch-1));if(i.ch>0){i=new ya(i.line,i.ch+1);e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ya(i.line,i.ch-2),i,"+transpose")}else if(i.line>e.doc.first){var a=Ei(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),ya(i.line-1,a.length-1),ya(i.line,1),"+transpose")}}n.push(new X(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){ln(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange("\n",r.anchor,r.head,"+input");e.indentLine(r.from().line+1,null,!0);br(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},Ua=e.keyMap={};Ua.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Ua.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Ua.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};Ua.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Ua["default"]=fa?Ua.macDefault:Ua.pcDefault;e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=mo(n.split(" "),Lr),o=0;o<i.length;o++){var a,s;if(o==i.length-1){s=n;a=r}else{s=i.slice(0,o+1).join(" ");a="..."}var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var u in t)e[u]=t[u];return e};var Va=e.lookupKey=function(e,t,n){t=Ar(t);var r=t.call?t.call(e):t[e];if(r===!1)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Va(e,t.fallthrough,n);for(var i=0;i<t.fallthrough.length;i++){var o=Va(e,t.fallthrough[i],n);if(o)return o}}},Ga=e.isModifierKey=function(e){var t="string"==typeof e?e:Os[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},$a=e.keyName=function(e,t){if(ia&&34==e.keyCode&&e["char"])return!1;var n=Os[e.keyCode],r=n;if(null==r||e.altGraphKey)return!1;e.altKey&&"Alt"!=n&&(r="Alt-"+r);(pa?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r);(pa?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r);!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r);return r};e.fromTextArea=function(t,n){function r(){t.value=u.getValue()}n||(n={});n.value=t.value;!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex);!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder);if(null==n.autofocus){var i=Lo();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form){us(t.form,"submit",r);if(!n.leaveSubmitMethodAlone){var o=t.form,a=o.submit;try{var s=o.submit=function(){r();o.submit=a;o.submit();o.submit=s}}catch(l){}}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);u.save=r;u.getTextArea=function(){return t};u.toTextArea=function(){u.toTextArea=isNaN;r();t.parentNode.removeChild(u.getWrapperElement());t.style.display="";if(t.form){cs(t.form,"submit",r);"function"==typeof t.form.submit&&(t.form.submit=a)}};return u};var Xa=e.StringStream=function(e,t){this.pos=this.start=0;this.string=e;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};Xa.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n){++this.pos;return t}},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1){this.pos=t;return!0}},backUp:function(e){this.pos-=e},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=ys(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?ys(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return ys(this.string,null,this.tabSize)-(this.lineStart?ys(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);if(r&&r.index>0)return null;r&&t!==!1&&(this.pos+=r[0].length);return r}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e)){t!==!1&&(this.pos+=e.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var Ja=e.TextMarker=function(e,t){this.lines=[];this.type=t;this.doc=e};uo(Ja);Ja.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;t&&Qt(e);if(lo(this,"clear")){var n=this.find();n&&io(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Hr(a.markedSpans,this);if(e&&!this.collapsed)gn(e,Oi(a),"text");else if(e){null!=s.to&&(i=Oi(a));null!=s.from&&(r=Oi(a))}a.markedSpans=Or(a.markedSpans,s);null==s.from&&this.collapsed&&!ri(this.doc,a)&&e&&Hi(a,Yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=Zr(this.lines[o]),u=f(l);if(u>e.display.maxLineLength){e.display.maxLine=l;e.display.maxLineLength=u;e.display.maxLineChanged=!0}}null!=r&&e&&this.collapsed&&pn(e,r,i+1);this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;e&&dt(e.doc)}e&&io(e,"markerCleared",e,this);t&&en(e);this.parent&&this.parent.clear()}};Ja.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Hr(o.markedSpans,this);if(null!=a.from){n=ya(t?o:Oi(o),a.from);if(-1==e)return n}if(null!=a.to){r=ya(t?o:Oi(o),a.to);if(1==e)return r}}return n&&{from:n,to:r}};Ja.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&ln(n,function(){var r=e.line,i=Oi(e.line),o=Et(n,i);if(o){Ft(o);n.curOp.selectionChanged=n.curOp.forceUpdate=!0}n.curOp.updateMaxLine=!0;if(!ri(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var s=ai(t)-a;s&&Hi(r,r.height+s)}})};Ja.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=go(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)};Ja.prototype.detachLine=function(e){this.lines.splice(go(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var Ya=0,Ka=e.SharedTextMarker=function(e,t){this.markers=e;this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};uo(Ka);Ka.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();io(this,"clear")}};Ka.prototype.find=function(e,t){return this.primary.find(e,t)};var Qa=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.cm=e;this.node=t};uo(Qa);Qa.prototype.clear=function(){var e=this.cm,t=this.line.widgets,n=this.line,r=Oi(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=ai(this);ln(e,function(){oi(e,n,-o);gn(e,r,"widget");Hi(n,Math.max(0,n.height-o))})}};Qa.prototype.changed=function(){var e=this.height,t=this.cm,n=this.line;this.height=null;var r=ai(this)-e;r&&ln(t,function(){t.curOp.forceUpdate=!0;oi(t,n,r);Hi(n,n.height+r)})};var Za=e.Line=function(e,t,n){this.text=e;Vr(this,t);this.height=n?n(this):1};uo(Za);Za.prototype.lineNo=function(){return Oi(this)};var es={},ts={};Ai.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height;ui(i);io(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n;this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}};Ni.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;r.removeInner(e,o);this.height-=a-r.height;if(i==o){this.children.splice(n--,1);r.parent=null}if(0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ai))){var s=[];this.collapse(s);this.children=[new Ai(s)];this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length;this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){i.insertInner(e,t,n);if(i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new Ai(a);i.height-=s.height;this.children.splice(r+1,0,s);s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Ni(t);if(e.parent){e.size-=n.size;e.height-=n.height;var r=go(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Ni(e.children);i.parent=e;e.children=[i,n];e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ns=0,rs=e.Doc=function(e,t,n){if(!(this instanceof rs))return new rs(e,t,n);null==n&&(n=0);Ni.call(this,[new Ai([new Za("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=n;var r=ya(n,0);this.sel=Y(r);this.history=new Wi(null);this.id=++ns;this.modeOption=t;"string"==typeof e&&(e=Es(e));Li(this,{from:r,to:r,text:e});ut(this,Y(r),gs)};rs.prototype=vo(Ni.prototype,{constructor:rs,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e) },insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ii(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:fn(function(e){var t=ya(this.first,0),n=this.first+this.size-1;sr(this,{from:t,to:ya(n,Ei(this,n).text.length),text:Es(e),origin:"setValue"},!0);ut(this,Y(t))}),replaceRange:function(e,t,n,r){t=Q(this,t);n=n?Q(this,n):t;hr(this,e,t,n,r)},getRange:function(e,t,n){var r=ji(this,Q(this,e),Q(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return et(this,e)?Ei(this,e):void 0},getLineNumber:function(e){return Oi(e)},getLineHandleVisualStart:function(e){"number"==typeof e&&(e=Ei(this,e));return Zr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Q(this,e)},getCursor:function(e){var t,n=this.sel.primary();t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from();return t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:fn(function(e,t,n){at(this,Q(this,"number"==typeof e?ya(e,t||0):e),null,n)}),setSelection:fn(function(e,t,n){at(this,Q(this,e),Q(this,t||e),n)}),extendSelection:fn(function(e,t,n){rt(this,Q(this,e),t&&Q(this,t),n)}),extendSelections:fn(function(e,t){it(this,tt(this,e,t))}),extendSelectionsBy:fn(function(e,t){it(this,mo(this.sel.ranges,e),t)}),setSelections:fn(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new X(Q(this,e[r].anchor),Q(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex));ut(this,J(i,t),n)}}),addSelection:fn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new X(Q(this,e),Q(this,t||e)));ut(this,J(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=ji(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ji(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||"\n"));t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:fn(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Es(e[o]),origin:n}}for(var s=t&&"end"!=t&&or(this,r,t),o=r.length-1;o>=0;o--)sr(this,r[o]);s?lt(this,s):this.cm&&br(this.cm)}),undo:fn(function(){ur(this,"undo")}),redo:fn(function(){ur(this,"redo")}),undoSelection:fn(function(){ur(this,"undo",!0)}),redoSelection:fn(function(){ur(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Wi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(e){var t=this.history=new Wi(this.history.maxGeneration);t.done=Ki(e.done.slice(0),null,!0);t.undone=Ki(e.undone.slice(0),null,!0)},addLineClass:fn(function(e,t,n){return Cr(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Ao(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:fn(function(e,t,n){return Cr(this,e,"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Ao(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),markText:function(e,t,n){return Nr(this,Q(this,e),Q(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared};e=Q(this,e);return Nr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Q(this,e);var t=[],n=Ei(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Q(this,e);t=Q(this,t);var r=[],i=e.line;this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];i==e.line&&e.ch>l.to||null==l.from&&i!=e.line||i==t.line&&l.from>t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i});return r},getAllMarks:function(){var e=[];this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)});return e},posFromIndex:function(e){var t,n=this.first;this.iter(function(r){var i=r.text.length+1;if(i>e){t=e;return!0}e-=i;++n});return Q(this,ya(n,t))},indexFromPos:function(e){e=Q(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;this.iter(this.first,e.line,function(e){t+=e.text.length+1});return t},copy:function(e){var t=new rs(Ii(this,this.first,this.first+this.size),this.modeOption,this.first);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=!1;if(e){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())}return t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from);null!=e.to&&e.to<n&&(n=e.to);var r=new rs(Ii(this,t,n),e.mode||this.modeOption,t);e.sharedHist&&(r.history=this.history);(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist});r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}];Er(r,Mr(this));return r},unlinkDoc:function(t){t instanceof e&&(t=t.doc);if(this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1);t.unlinkDoc(this);jr(Mr(this));break}}if(t.history==this.history){var i=[t.id];_i(t,function(e){i.push(e.id)},!0);t.history=new Wi(null);t.history.done=Ki(this.history.done,i);t.history.undone=Ki(this.history.undone,i)}},iterLinkedDocs:function(e){_i(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});rs.prototype.eachLine=rs.prototype.iter;var is="iter insert remove copy getEditor".split(" ");for(var os in rs.prototype)rs.prototype.hasOwnProperty(os)&&go(is,os)<0&&(e.prototype[os]=function(e){return function(){return e.apply(this.doc,arguments)}}(rs.prototype[os]));uo(rs);var as=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},ss=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},ls=e.e_stop=function(e){as(e);ss(e)},us=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},cs=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},fs=e.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},ds=null,hs=30,ps=e.Pass={toString:function(){return"CodeMirror.Pass"}},gs={scroll:!1},ms={origin:"*mouse"},vs={origin:"+move"};co.prototype.set=function(e,t){clearTimeout(this.id);this.id=setTimeout(t,e)};var ys=e.countColumn=function(e,t,n,r,i){if(null==t){t=e.search(/[^\s\u00a0]/);-1==t&&(t=e.length)}for(var o=r||0,a=i||0;;){var s=e.indexOf(" ",o);if(0>s||s>=t)return a+(t-o);a+=s-o;a+=n-a%n;o=s+1}},bs=[""],xs=function(e){e.select()};ua?xs=function(e){e.selectionStart=0;e.selectionEnd=e.value.length}:Zo&&(xs=function(e){try{e.select()}catch(t){}});[].indexOf&&(go=function(e,t){return e.indexOf(t)});[].map&&(mo=function(e,t){return e.map(t)});var ws,Cs=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ss=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Cs.test(e))},Ts=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;ws=document.createRange?function(e,t,n){var r=document.createRange();r.setEnd(e,n);r.setStart(e,t);return r}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}r.collapse(!0);r.moveEnd("character",n);r.moveStart("character",t);return r};Zo&&11>ea&&(Lo=function(){try{return document.activeElement}catch(e){return document.body}});var ks,Ds,Ls,As=e.rmClass=function(e,t){var n=e.className,r=Ao(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ns=e.addClass=function(e,t){var n=e.className;Ao(t).test(n)||(e.className+=(n?" ":"")+t)},_s=!1,Ms=function(){if(Zo&&9>ea)return!1;var e=So("div");return"draggable"in e||"dragDrop"in e}(),Es=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");if(-1!=a){n.push(o.slice(0,a));t+=a+1}else{n.push(o);t=i+1}}return n}:function(e){return e.split(/\r\n?|\n/)},js=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Is=function(){var e=So("div");if("oncopy"in e)return!0;e.setAttribute("oncopy","return;");return"function"==typeof e.oncopy}(),Hs=null,Os={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Os;(function(){for(var e=0;10>e;e++)Os[e+48]=Os[e+96]=String(e);for(var e=65;90>=e;e++)Os[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Os[e+111]=Os[e+63235]="F"+e})();var Fs,Ps=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e;this.from=t;this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,u="L";return function(n){if(!i.test(n))return!1;for(var r,c=n.length,f=[],d=0;c>d;++d)f.push(r=e(n.charCodeAt(d)));for(var d=0,h=u;c>d;++d){var r=f[d];"m"==r?f[d]=h:h=r}for(var d=0,p=u;c>d;++d){var r=f[d];if("1"==r&&"r"==p)f[d]="n";else if(a.test(r)){p=r;"r"==r&&(f[d]="R")}}for(var d=1,h=f[0];c-1>d;++d){var r=f[d];"+"==r&&"1"==h&&"1"==f[d+1]?f[d]="1":","!=r||h!=f[d+1]||"1"!=h&&"n"!=h||(f[d]=h);h=r}for(var d=0;c>d;++d){var r=f[d];if(","==r)f[d]="N";else if("%"==r){for(var g=d+1;c>g&&"%"==f[g];++g);for(var m=d&&"!"==f[d-1]||c>g&&"1"==f[g]?"1":"N",v=d;g>v;++v)f[v]=m;d=g-1}}for(var d=0,p=u;c>d;++d){var r=f[d];"L"==p&&"1"==r?f[d]="L":a.test(r)&&(p=r)}for(var d=0;c>d;++d)if(o.test(f[d])){for(var g=d+1;c>g&&o.test(f[g]);++g);for(var y="L"==(d?f[d-1]:u),b="L"==(c>g?f[g]:u),m=y||b?"L":"R",v=d;g>v;++v)f[v]=m;d=g-1}for(var x,w=[],d=0;c>d;)if(s.test(f[d])){var C=d;for(++d;c>d&&s.test(f[d]);++d);w.push(new t(0,C,d))}else{var S=d,T=w.length;for(++d;c>d&&"L"!=f[d];++d);for(var v=S;d>v;)if(l.test(f[v])){v>S&&w.splice(T,0,new t(1,S,v));var k=v;for(++v;d>v&&l.test(f[v]);++v);w.splice(T,0,new t(2,k,v));S=v}else++v;d>S&&w.splice(T,0,new t(1,S,d))}if(1==w[0].level&&(x=n.match(/^\s+/))){w[0].from=x[0].length;w.unshift(new t(0,0,x[0].length))}if(1==po(w).level&&(x=n.match(/\s+$/))){po(w).to-=x[0].length;w.push(new t(0,c-x[0].length,c))}w[0].level!=po(w).level&&w.push(new t(w[0].level,c,c));return w}}();e.version="4.8.0";return e})},{}],10:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){pt=e;gt=n;return t}function o(e,t){var n=e.next();if('"'==n||"'"==n){t.tokenize=a(n);return t.tokenize(e,t)}if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i)){e.eatWhile(/[\da-f]/i);return i("number","number")}if(/\d/.test(n)){e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return i("number","number")}if("/"==n){if(e.eat("*")){t.tokenize=s;return s(e,t)}if(e.eat("/")){e.skipToEnd();return i("comment","comment")}if("operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)){r(e);e.eatWhile(/[gimy]/);return i("regexp","string-2")}e.eatWhile(St);return i("operator","operator",e.current())}if("`"==n){t.tokenize=l;return l(e,t)}if("#"==n){e.skipToEnd();return i("error","error")}if(St.test(n)){e.eatWhile(St);return i("operator","operator",e.current())}if(wt.test(n)){e.eatWhile(wt);var o=e.current(),u=Ct.propertyIsEnumerable(o)&&Ct[o];return u&&"."!=t.lastType?i(u.type,u.style,o):i("variable","variable",o)}}function a(e){return function(t,n){var r,a=!1;if(yt&&"@"==t.peek()&&t.match(Tt)){n.tokenize=o;return i("jsonld-keyword","meta")}for(;null!=(r=t.next())&&(r!=e||a);)a=!a&&"\\"==r;a||(n.tokenize=o);return i("string","string")}}function s(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),s=kt.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(wt.test(a))i=!0;else if(i&&!r){++o;break}}i&&!r&&(t.fatArrowAt=o)}}function c(e,t,n,r,i,o){this.indented=e;this.column=t;this.type=n;this.prev=i;this.info=o;null!=r&&(this.align=r)}function f(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function d(e,t,n,r,i){var o=e.cc;Lt.state=e;Lt.stream=i;Lt.marked=null,Lt.cc=o;Lt.style=t;e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var a=o.length?o.pop():bt?C:w;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Lt.marked?Lt.marked:"variable"==n&&f(e,r)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)Lt.cc.push(arguments[e])}function p(){h.apply(null,arguments);return!0}function g(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=Lt.state;if(r.context){Lt.marked="def";if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function m(){Lt.state.context={prev:Lt.state.context,vars:Lt.state.localVars};Lt.state.localVars=At}function v(){Lt.state.localVars=Lt.state.context.vars;Lt.state.context=Lt.state.context.prev}function y(e,t){var n=function(){var n=Lt.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new c(r,Lt.stream.column(),e,null,n.lexical,t)};n.lex=!0;return n}function b(){var e=Lt.state;if(e.lexical.prev){")"==e.lexical.type&&(e.indented=e.lexical.indented);e.lexical=e.lexical.prev}}function x(e){function t(n){return n==e?p():";"==e?h():p(t)}return t}function w(e,t){if("var"==e)return p(y("vardef",t.length),q,x(";"),b);if("keyword a"==e)return p(y("form"),C,w,b);if("keyword b"==e)return p(y("form"),w,b);if("{"==e)return p(y("}"),W,b);if(";"==e)return p();if("if"==e){"else"==Lt.state.lexical.info&&Lt.state.cc[Lt.state.cc.length-1]==b&&Lt.state.cc.pop()();return p(y("form"),C,w,b,X)}return"function"==e?p(et):"for"==e?p(y("form"),J,w,b):"variable"==e?p(y("stat"),j):"switch"==e?p(y("form"),C,y("}","switch"),x("{"),W,b,b):"case"==e?p(C,x(":")):"default"==e?p(x(":")):"catch"==e?p(y("form"),m,x("("),tt,x(")"),w,b,v):"module"==e?p(y("form"),m,at,v,b):"class"==e?p(y("form"),nt,b):"export"==e?p(y("form"),st,b):"import"==e?p(y("form"),lt,b):h(y("stat"),C,x(";"),b)}function C(e){return T(e,!1)}function S(e){return T(e,!0)}function T(e,t){if(Lt.state.fatArrowAt==Lt.stream.start){var n=t?E:M;if("("==e)return p(m,y(")"),P(U,")"),b,x("=>"),n,v);if("variable"==e)return h(m,U,x("=>"),n,v)}var r=t?A:L;return Dt.hasOwnProperty(e)?p(r):"function"==e?p(et,r):"keyword c"==e?p(t?D:k):"("==e?p(y(")"),k,ht,x(")"),b,r):"operator"==e||"spread"==e?p(t?S:C):"["==e?p(y("]"),ft,b,r):"{"==e?R(H,"}",null,r):"quasi"==e?h(N,r):p()}function k(e){return e.match(/[;\}\)\],]/)?h():h(C)}function D(e){return e.match(/[;\}\)\],]/)?h():h(S)}function L(e,t){return","==e?p(C):A(e,t,!1)}function A(e,t,n){var r=0==n?L:A,i=0==n?C:S;return"=>"==e?p(m,n?E:M,v):"operator"==e?/\+\+|--/.test(t)?p(r):"?"==t?p(C,x(":"),i):p(i):"quasi"==e?h(N,r):";"!=e?"("==e?R(S,")","call",r):"."==e?p(I,r):"["==e?p(y("]"),k,x("]"),b,r):void 0:void 0}function N(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?p(N):p(C,_)}function _(e){if("}"==e){Lt.marked="string-2";Lt.state.tokenize=l;return p(N)}}function M(e){u(Lt.stream,Lt.state);return h("{"==e?w:C)}function E(e){u(Lt.stream,Lt.state);return h("{"==e?w:S)}function j(e){return":"==e?p(b,w):h(L,x(";"),b)}function I(e){if("variable"==e){Lt.marked="property";return p()}}function H(e,t){if("variable"==e||"keyword"==Lt.style){Lt.marked="property";return p("get"==t||"set"==t?O:F)}if("number"==e||"string"==e){Lt.marked=yt?"property":Lt.style+" property";return p(F)}return"jsonld-keyword"==e?p(F):"["==e?p(C,x("]"),F):void 0}function O(e){if("variable"!=e)return h(F);Lt.marked="property";return p(et)}function F(e){return":"==e?p(S):"("==e?h(et):void 0}function P(e,t){function n(r){if(","==r){var i=Lt.state.lexical;"call"==i.info&&(i.pos=(i.pos||0)+1);return p(e,n)}return r==t?p():p(x(t))}return function(r){return r==t?p():h(e,n)}}function R(e,t,n){for(var r=3;r<arguments.length;r++)Lt.cc.push(arguments[r]);return p(y(t,n),P(e,t),b)}function W(e){return"}"==e?p():h(w,W)}function z(e){return xt&&":"==e?p(B):void 0}function B(e){if("variable"==e){Lt.marked="variable-3";return p()}}function q(){return h(U,z,G,$)}function U(e,t){if("variable"==e){g(t);return p()}return"["==e?R(U,"]"):"{"==e?R(V,"}"):void 0}function V(e,t){if("variable"==e&&!Lt.stream.match(/^\s*:/,!1)){g(t);return p(G)}"variable"==e&&(Lt.marked="property");return p(x(":"),U,G)}function G(e,t){return"="==t?p(S):void 0}function $(e){return","==e?p(q):void 0}function X(e,t){return"keyword b"==e&&"else"==t?p(y("form","else"),w,b):void 0}function J(e){return"("==e?p(y(")"),Y,x(")"),b):void 0}function Y(e){return"var"==e?p(q,x(";"),Q):";"==e?p(Q):"variable"==e?p(K):h(C,x(";"),Q)}function K(e,t){if("in"==t||"of"==t){Lt.marked="keyword";return p(C)}return p(L,Q)}function Q(e,t){if(";"==e)return p(Z);if("in"==t||"of"==t){Lt.marked="keyword";return p(C)}return h(C,x(";"),Z)}function Z(e){")"!=e&&p(C)}function et(e,t){if("*"==t){Lt.marked="keyword";return p(et)}if("variable"==e){g(t);return p(et)}return"("==e?p(m,y(")"),P(tt,")"),b,w,v):void 0}function tt(e){return"spread"==e?p(tt):h(U,z)}function nt(e,t){if("variable"==e){g(t);return p(rt)}}function rt(e,t){return"extends"==t?p(C,rt):"{"==e?p(y("}"),it,b):void 0}function it(e,t){if("variable"==e||"keyword"==Lt.style){Lt.marked="property";return"get"==t||"set"==t?p(ot,et,it):p(et,it)}if("*"==t){Lt.marked="keyword";return p(it)}return";"==e?p(it):"}"==e?p():void 0}function ot(e){if("variable"!=e)return h();Lt.marked="property";return p()}function at(e,t){if("string"==e)return p(w);if("variable"==e){g(t);return p(ct)}}function st(e,t){if("*"==t){Lt.marked="keyword";return p(ct,x(";"))}if("default"==t){Lt.marked="keyword";return p(C,x(";"))}return h(w)}function lt(e){return"string"==e?p():h(ut,ct)}function ut(e,t){if("{"==e)return R(ut,"}");"variable"==e&&g(t);return p()}function ct(e,t){if("from"==t){Lt.marked="keyword";return p(C)}}function ft(e){return"]"==e?p():h(S,dt)}function dt(e){return"for"==e?h(ht,x("]")):","==e?p(P(D,"]")):h(P(S,"]"))}function ht(e){return"for"==e?p(J,ht):"if"==e?p(C,ht):void 0}var pt,gt,mt=t.indentUnit,vt=n.statementIndent,yt=n.jsonld,bt=n.json||yt,xt=n.typescript,wt=n.wordCharacters||/[\w$\xa1-\uffff]/,Ct=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),module:e("module"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r};if(xt){var s={type:"variable",style:"variable-3"},l={"interface":e("interface"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),string:s,number:s,bool:s,any:s};for(var u in l)a[u]=l[u]}return a}(),St=/[+\-*&%=<>!?|~^]/,Tt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,kt="([{}])",Dt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Lt={state:null,column:null,marked:null,cc:null},At={name:"this",next:{name:"arguments"}};b.lex=!0;return{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new c((e||0)-mt,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars);return t},token:function(e,t){if(e.sol()){t.lexical.hasOwnProperty("align")||(t.lexical.align=!1);t.indented=e.indentation();u(e,t)}if(t.tokenize!=s&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==pt)return n;t.lastType="operator"!=pt||"++"!=gt&&"--"!=gt?pt:"incdec";return d(t,n,pt,gt,e)},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=o)return 0;var i=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==b)a=a.prev;else if(u!=X)break}"stat"==a.type&&"}"==i&&(a=a.prev);vt&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var c=a.type,f=i==c;return"vardef"==c?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==c&&"{"==i?a.indented:"form"==c?a.indented+mt:"stat"==c?a.indented+("operator"==t.lastType||","==t.lastType?vt||mt:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:mt):a.indented+(/^(?:case|default)\b/.test(r)?mt:2*mt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:bt?null:"/*",blockCommentEnd:bt?null:"*/",lineComment:bt?null:"//",fold:"brace",helperType:bt?"json":"javascript",jsonldMode:yt,jsonMode:bt}});e.registerHelper("wordChars","javascript",/[\w$]/);e.defineMIME("text/javascript","javascript");e.defineMIME("text/ecmascript","javascript");e.defineMIME("application/javascript","javascript");e.defineMIME("application/x-javascript","javascript");e.defineMIME("application/ecmascript","javascript");e.defineMIME("application/json",{name:"javascript",json:!0});e.defineMIME("application/x-json",{name:"javascript",json:!0});e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});e.defineMIME("text/typescript",{name:"javascript",typescript:!0});e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":9}],11:[function(t,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";e.defineMode("xml",function(t,n){function r(e,t){function n(n){t.tokenize=n;return n(e,t)}var r=e.next();if("<"==r){if(e.eat("!")){if(e.eat("["))return e.match("CDATA[")?n(a("atom","]]>")):null;if(e.match("--"))return n(a("comment","-->"));if(e.match("DOCTYPE",!0,!0)){e.eatWhile(/[\w\._\-]/);return n(s(1))}return null}if(e.eat("?")){e.eatWhile(/[\w\._\-]/);t.tokenize=a("meta","?>");return"meta"}S=e.eat("/")?"closeTag":"openTag";t.tokenize=i;return"tag bracket"}if("&"==r){var o;o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";");return o?"atom":"error"}e.eatWhile(/[^&<]/);return null}function i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">")){t.tokenize=r;S=">"==n?"endTag":"selfcloseTag";return"tag bracket"}if("="==n){S="equals";return null}if("<"==n){t.tokenize=r;t.state=f;t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}if(/[\'\"]/.test(n)){t.tokenize=o(n);t.stringStartCol=e.column();return t.tokenize(e,t)}e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function o(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"};t.isInAttribute=!0;return t}function a(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=r;break}n.next()}return e}}function s(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i){n.tokenize=s(e+1);return n.tokenize(t,n)}if(">"==i){if(1==e){n.tokenize=r;break}n.tokenize=s(e-1);return n.tokenize(t,n)}}return"meta"}}function l(e,t,n){this.prev=e.context;this.tagName=t;this.indent=e.indented;this.startOfLine=n;(k.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function u(e){e.context&&(e.context=e.context.prev)}function c(e,t){for(var n;;){if(!e.context)return;n=e.context.tagName;if(!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(t))return;u(e)}}function f(e,t,n){if("openTag"==e){n.tagStart=t.column();return d}return"closeTag"==e?h:f}function d(e,t,n){if("word"==e){n.tagName=t.current();T="tag";return m}T="error";return d}function h(e,t,n){if("word"==e){var r=t.current();n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n);if(n.context&&n.context.tagName==r){T="tag";return p}T="tag error";return g}T="error";return g}function p(e,t,n){if("endTag"!=e){T="error";return p}u(n);return f}function g(e,t,n){T="error";return p(e,t,n)}function m(e,t,n){if("word"==e){T="attribute";return v}if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;n.tagName=n.tagStart=null;if("selfcloseTag"==e||k.autoSelfClosers.hasOwnProperty(r))c(n,r);else{c(n,r);n.context=new l(n,r,i==n.indented)}return f}T="error";return m}function v(e,t,n){if("equals"==e)return y;k.allowMissing||(T="error");return m(e,t,n)}function y(e,t,n){if("string"==e)return b;if("word"==e&&k.allowUnquoted){T="string";return m}T="error";return m(e,t,n)}function b(e,t,n){return"string"==e?b:m(e,t,n)}var x=t.indentUnit,w=n.multilineTagIndentFactor||1,C=n.multilineTagIndentPastTag;null==C&&(C=!0);var S,T,k=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},D=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){!t.tagName&&e.sol()&&(t.indented=e.indentation());if(e.eatSpace())return null;S=null;var n=t.tokenize(e,t);if((n||S)&&"comment"!=n){T=null;t.state=t.state(S||n,e,t);T&&(n="error"==T?n+" error":T)}return n},indent:function(t,n,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(a&&a.noIndent)return e.Pass; if(t.tokenize!=i&&t.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return C?t.tagStart+t.tagName.length+2:t.tagStart+x*w;if(D&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;a;){if(a.tagName==s[2]){a=a.prev;break}if(!k.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(s)for(;a;){var l=k.contextGrabbers[a.tagName];if(!l||!l.hasOwnProperty(s[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+x:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}});e.defineMIME("text/xml","xml");e.defineMIME("application/xml","xml");e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":9}],12:[function(t,n){(function(e,t){"object"==typeof n&&"object"==typeof n.exports?n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)})("undefined"!=typeof window?window:this,function(t,n){function r(e){var t=e.length,n=ot.type(e);return"function"===n||ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(ot.isFunction(t))return ot.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ot.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ht.test(t))return ot.filter(t,e,n);t=ot.filter(t,e)}return ot.grep(e,function(e){return ot.inArray(e,t)>=0!==n})}function o(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function a(e){var t=wt[e]={};ot.each(e.match(xt)||[],function(e,n){t[n]=!0});return t}function s(){if(gt.addEventListener){gt.removeEventListener("DOMContentLoaded",l,!1);t.removeEventListener("load",l,!1)}else{gt.detachEvent("onreadystatechange",l);t.detachEvent("onload",l)}}function l(){if(gt.addEventListener||"load"===event.type||"complete"===gt.readyState){s();ot.ready()}}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(Dt,"-$1").toLowerCase();n=e.getAttribute(r);if("string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:kt.test(n)?ot.parseJSON(n):n}catch(i){}ot.data(e,t,n)}else n=void 0}return n}function c(e){var t;for(t in e)if(("data"!==t||!ot.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function f(e,t,n,r){if(ot.acceptData(e)){var i,o,a=ot.expando,s=e.nodeType,l=s?ot.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t){u||(u=s?e[a]=J.pop()||ot.guid++:a);l[u]||(l[u]=s?{}:{toJSON:ot.noop});("object"==typeof t||"function"==typeof t)&&(r?l[u]=ot.extend(l[u],t):l[u].data=ot.extend(l[u].data,t));o=l[u];if(!r){o.data||(o.data={});o=o.data}void 0!==n&&(o[ot.camelCase(t)]=n);if("string"==typeof t){i=o[t];null==i&&(i=o[ot.camelCase(t)])}else i=o;return i}}}function d(e,t,n){if(ot.acceptData(e)){var r,i,o=e.nodeType,a=o?ot.cache:e,s=o?e[ot.expando]:ot.expando;if(a[s]){if(t){r=n?a[s]:a[s].data;if(r){if(ot.isArray(t))t=t.concat(ot.map(t,ot.camelCase));else if(t in r)t=[t];else{t=ot.camelCase(t);t=t in r?[t]:t.split(" ")}i=t.length;for(;i--;)delete r[t[i]];if(n?!c(r):!ot.isEmptyObject(r))return}}if(!n){delete a[s].data;if(!c(a[s]))return}o?ot.cleanData([e],!0):rt.deleteExpando||a!=a.window?delete a[s]:a[s]=null}}}function h(){return!0}function p(){return!1}function g(){try{return gt.activeElement}catch(e){}}function m(e){var t=Ft.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function v(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==Tt?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Tt?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||ot.nodeName(r,t)?o.push(r):ot.merge(o,v(r,t));return void 0===t||t&&ot.nodeName(e,t)?ot.merge([e],o):o}function y(e){Mt.test(e.type)&&(e.defaultChecked=e.checked)}function b(e,t){return ot.nodeName(e,"table")&&ot.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function x(e){e.type=(null!==ot.find.attr(e,"type"))+"/"+e.type;return e}function w(e){var t=Xt.exec(e.type);t?e.type=t[1]:e.removeAttribute("type");return e}function C(e,t){for(var n,r=0;null!=(n=e[r]);r++)ot._data(n,"globalEval",!t||ot._data(t[r],"globalEval"))}function S(e,t){if(1===t.nodeType&&ot.hasData(e)){var n,r,i,o=ot._data(e),a=ot._data(t,o),s=o.events;if(s){delete a.handle;a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)ot.event.add(t,n,s[n][r])}a.data&&(a.data=ot.extend({},a.data))}}function T(e,t){var n,r,i;if(1===t.nodeType){n=t.nodeName.toLowerCase();if(!rt.noCloneEvent&&t[ot.expando]){i=ot._data(t);for(r in i.events)ot.removeEvent(t,r,i.handle);t.removeAttribute(ot.expando)}if("script"===n&&t.text!==e.text){x(t).text=e.text;w(t)}else if("object"===n){t.parentNode&&(t.outerHTML=e.outerHTML);rt.html5Clone&&e.innerHTML&&!ot.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)}else if("input"===n&&Mt.test(e.type)){t.defaultChecked=t.checked=e.checked;t.value!==e.value&&(t.value=e.value)}else"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function k(e,n){var r,i=ot(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(i[0]))?r.display:ot.css(i[0],"display");i.detach();return o}function D(e){var t=gt,n=en[e];if(!n){n=k(e,t);if("none"===n||!n){Zt=(Zt||ot("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement);t=(Zt[0].contentWindow||Zt[0].contentDocument).document;t.write();t.close();n=k(e,t);Zt.detach()}en[e]=n}return n}function L(e,t){return{get:function(){var n=e();if(null!=n){if(!n)return(this.get=t).apply(this,arguments);delete this.get}}}}function A(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=pn.length;i--;){t=pn[i]+n;if(t in e)return t}return r}function N(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++){r=e[a];if(r.style){o[a]=ot._data(r,"olddisplay");n=r.style.display;if(t){o[a]||"none"!==n||(r.style.display="");""===r.style.display&&Nt(r)&&(o[a]=ot._data(r,"olddisplay",D(r.nodeName)))}else{i=Nt(r);(n&&"none"!==n||!i)&&ot._data(r,"olddisplay",i?n:ot.css(r,"display"))}}}for(a=0;s>a;a++){r=e[a];r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"))}return e}function _(e,t,n){var r=cn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function M(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2){"margin"===n&&(a+=ot.css(e,n+At[o],!0,i));if(r){"content"===n&&(a-=ot.css(e,"padding"+At[o],!0,i));"margin"!==n&&(a-=ot.css(e,"border"+At[o]+"Width",!0,i))}else{a+=ot.css(e,"padding"+At[o],!0,i);"padding"!==n&&(a+=ot.css(e,"border"+At[o]+"Width",!0,i))}}return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=tn(e),a=rt.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,o);if(0>=i||null==i){i=nn(e,t,o);(0>i||null==i)&&(i=e.style[t]);if(on.test(i))return i;r=a&&(rt.boxSizingReliable()||i===e.style[t]);i=parseFloat(i)||0}return i+M(e,t,n||(a?"border":"content"),r,o)+"px"}function j(e,t,n,r,i){return new j.prototype.init(e,t,n,r,i)}function I(){setTimeout(function(){gn=void 0});return gn=ot.now()}function H(e,t){var n,r={height:e},i=0;t=t?1:0;for(;4>i;i+=2-t){n=At[i];r["margin"+n]=r["padding"+n]=e}t&&(r.opacity=r.width=e);return r}function O(e,t,n){for(var r,i=(wn[t]||[]).concat(wn["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,t,e))return r}function F(e,t,n){var r,i,o,a,s,l,u,c,f=this,d={},h=e.style,p=e.nodeType&&Nt(e),g=ot._data(e,"fxshow");if(!n.queue){s=ot._queueHooks(e,"fx");if(null==s.unqueued){s.unqueued=0;l=s.empty.fire;s.empty.fire=function(){s.unqueued||l()}}s.unqueued++;f.always(function(){f.always(function(){s.unqueued--;ot.queue(e,"fx").length||s.empty.fire()})})}if(1===e.nodeType&&("height"in t||"width"in t)){n.overflow=[h.overflow,h.overflowX,h.overflowY];u=ot.css(e,"display");c="none"===u?ot._data(e,"olddisplay")||D(e.nodeName):u;"inline"===c&&"none"===ot.css(e,"float")&&(rt.inlineBlockNeedsLayout&&"inline"!==D(e.nodeName)?h.zoom=1:h.display="inline-block")}if(n.overflow){h.overflow="hidden";rt.shrinkWrapBlocks()||f.always(function(){h.overflow=n.overflow[0];h.overflowX=n.overflow[1];h.overflowY=n.overflow[2]})}for(r in t){i=t[r];if(vn.exec(i)){delete t[r];o=o||"toggle"===i;if(i===(p?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;p=!0}d[r]=g&&g[r]||ot.style(e,r)}else u=void 0}if(ot.isEmptyObject(d))"inline"===("none"===u?D(e.nodeName):u)&&(h.display=u);else{g?"hidden"in g&&(p=g.hidden):g=ot._data(e,"fxshow",{});o&&(g.hidden=!p);p?ot(e).show():f.done(function(){ot(e).hide()});f.done(function(){var t;ot._removeData(e,"fxshow");for(t in d)ot.style(e,t,d[t])});for(r in d){a=O(p?g[r]:0,r,f);if(!(r in g)){g[r]=a.start;if(p){a.end=a.start;a.start="width"===r||"height"===r?1:0}}}}}function P(e,t){var n,r,i,o,a;for(n in e){r=ot.camelCase(n);i=t[r];o=e[n];if(ot.isArray(o)){i=o[1];o=e[n]=o[0]}if(n!==r){e[r]=o;delete e[n]}a=ot.cssHooks[r];if(a&&"expand"in a){o=a.expand(o);delete e[r];for(n in o)if(!(n in e)){e[n]=o[n];t[n]=i}}else t[r]=i}}function R(e,t,n){var r,i,o=0,a=xn.length,s=ot.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=gn||I(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;l>a;a++)u.tweens[a].run(o);s.notifyWith(e,[u,o,n]);if(1>o&&l)return n;s.resolveWith(e,[u]);return!1},u=s.promise({elem:e,props:ot.extend({},t),opts:ot.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:gn||I(),duration:n.duration,tweens:[],createTween:function(t,n){var r=ot.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);u.tweens.push(r);return r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;i=!0;for(;r>n;n++)u.tweens[n].run(1);t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]);return this}}),c=u.props;P(c,u.opts.specialEasing);for(;a>o;o++){r=xn[o].call(u,e,c,u.opts);if(r)return r}ot.map(c,O,u);ot.isFunction(u.opts.start)&&u.opts.start.call(e,u);ot.fx.timer(ot.extend(l,{elem:e,anim:u,queue:u.opts.queue}));return u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function W(e){return function(t,n){if("string"!=typeof t){n=t;t="*"}var r,i=0,o=t.toLowerCase().match(xt)||[];if(ot.isFunction(n))for(;r=o[i++];)if("+"===r.charAt(0)){r=r.slice(1)||"*";(e[r]=e[r]||[]).unshift(n)}else(e[r]=e[r]||[]).push(n)}}function z(e,t,n,r){function i(s){var l;o[s]=!0;ot.each(e[s]||[],function(e,s){var u=s(t,n,r);if("string"==typeof u&&!a&&!o[u]){t.dataTypes.unshift(u);i(u);return!1}return a?!(l=u):void 0});return l}var o={},a=e===Vn;return i(t.dataTypes[0])||!o["*"]&&i("*")}function B(e,t){var n,r,i=ot.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);n&&ot.extend(!0,e,n);return e}function q(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];){l.shift();void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"))}if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}if(o){o!==l[0]&&l.unshift(o);return n[o]}}function U(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();for(;o;){e.responseFields[o]&&(n[e.responseFields[o]]=t);!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType));l=o;o=c.shift();if(o)if("*"===o)o=l;else if("*"!==l&&l!==o){a=u[l+" "+o]||u["* "+o];if(!a)for(i in u){s=i.split(" ");if(s[1]===o){a=u[l+" "+s[0]]||u["* "+s[0]];if(a){if(a===!0)a=u[i];else if(u[i]!==!0){o=s[0];c.unshift(s[1])}break}}}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+l+" to "+o}}}}return{state:"success",data:t}}function V(e,t,n,r){var i;if(ot.isArray(t))ot.each(t,function(t,i){n||Jn.test(e)?r(e,i):V(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==ot.type(t))r(e,t);else for(i in t)V(e+"["+i+"]",t[i],n,r)}function G(){try{return new t.XMLHttpRequest}catch(e){}}function $(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function X(e){return ot.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var J=[],Y=J.slice,K=J.concat,Q=J.push,Z=J.indexOf,et={},tt=et.toString,nt=et.hasOwnProperty,rt={},it="1.11.1",ot=function(e,t){return new ot.fn.init(e,t)},at=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,st=/^-ms-/,lt=/-([\da-z])/gi,ut=function(e,t){return t.toUpperCase()};ot.fn=ot.prototype={jquery:it,constructor:ot,selector:"",length:0,toArray:function(){return Y.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:Y.call(this)},pushStack:function(e){var t=ot.merge(this.constructor(),e);t.prevObject=this;t.context=this.context;return t},each:function(e,t){return ot.each(this,e,t)},map:function(e){return this.pushStack(ot.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(Y.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:Q,sort:J.sort,splice:J.splice};ot.extend=ot.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;if("boolean"==typeof a){u=a;a=arguments[s]||{};s++}"object"==typeof a||ot.isFunction(a)||(a={});if(s===l){a=this;s--}for(;l>s;s++)if(null!=(i=arguments[s]))for(r in i){e=a[r];n=i[r];if(a!==n)if(u&&n&&(ot.isPlainObject(n)||(t=ot.isArray(n)))){if(t){t=!1;o=e&&ot.isArray(e)?e:[]}else o=e&&ot.isPlainObject(e)?e:{};a[r]=ot.extend(u,o,n)}else void 0!==n&&(a[r]=n)}return a};ot.extend({expando:"jQuery"+(it+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===ot.type(e)},isArray:Array.isArray||function(e){return"array"===ot.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!ot.isArray(e)&&e-parseFloat(e)>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==ot.type(e)||e.nodeType||ot.isWindow(e))return!1;try{if(e.constructor&&!nt.call(e,"constructor")&&!nt.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(rt.ownLast)for(t in e)return nt.call(e,t);for(t in e);return void 0===t||nt.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?et[tt.call(e)]||"object":typeof e},globalEval:function(e){e&&ot.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(e){return e.replace(st,"ms-").replace(lt,ut)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var i,o=0,a=e.length,s=r(e);if(n)if(s)for(;a>o;o++){i=t.apply(e[o],n);if(i===!1)break}else for(o in e){i=t.apply(e[o],n);if(i===!1)break}else if(s)for(;a>o;o++){i=t.call(e[o],o,e[o]);if(i===!1)break}else for(o in e){i=t.call(e[o],o,e[o]);if(i===!1)break}return e},trim:function(e){return null==e?"":(e+"").replace(at,"")},makeArray:function(e,t){var n=t||[];null!=e&&(r(Object(e))?ot.merge(n,"string"==typeof e?[e]:e):Q.call(n,e));return n},inArray:function(e,t,n){var r;if(t){if(Z)return Z.call(t,e,n);r=t.length;n=n?0>n?Math.max(0,r+n):n:0;for(;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;)e[i++]=t[r++];if(n!==n)for(;void 0!==t[r];)e[i++]=t[r++];e.length=i;return e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;a>o;o++){r=!t(e[o],o);r!==s&&i.push(e[o])}return i},map:function(e,t,n){var i,o=0,a=e.length,s=r(e),l=[];if(s)for(;a>o;o++){i=t(e[o],o,n);null!=i&&l.push(i)}else for(o in e){i=t(e[o],o,n);null!=i&&l.push(i)}return K.apply([],l)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t){i=e[t];t=e;e=i}if(!ot.isFunction(e))return void 0;n=Y.call(arguments,2);r=function(){return e.apply(t||this,n.concat(Y.call(arguments)))};r.guid=e.guid=e.guid||ot.guid++;return r},now:function(){return+new Date},support:rt});ot.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){et["[object "+t+"]"]=t.toLowerCase()});var ct=function(e){function t(e,t,n,r){var i,o,a,s,l,u,f,h,p,g;(t?t.ownerDocument||t:W)!==E&&M(t);t=t||E;n=n||[];if(!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(I&&!r){if(i=yt.exec(e))if(a=i[1]){if(9===s){o=t.getElementById(a);if(!o||!o.parentNode)return n;if(o.id===a){n.push(o);return n}}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&P(t,o)&&o.id===a){n.push(o);return n}}else{if(i[2]){Z.apply(n,t.getElementsByTagName(e));return n}if((a=i[3])&&w.getElementsByClassName&&t.getElementsByClassName){Z.apply(n,t.getElementsByClassName(a));return n}}if(w.qsa&&(!H||!H.test(e))){h=f=R;p=t;g=9===s&&e;if(1===s&&"object"!==t.nodeName.toLowerCase()){u=k(e);(f=t.getAttribute("id"))?h=f.replace(xt,"\\$&"):t.setAttribute("id",h);h="[id='"+h+"'] ";l=u.length;for(;l--;)u[l]=h+d(u[l]);p=bt.test(e)&&c(t.parentNode)||t;g=u.join(",")}if(g)try{Z.apply(n,p.querySelectorAll(g));return n}catch(m){}finally{f||t.removeAttribute("id")}}}return L(e.replace(lt,"$1"),t,n,r)}function n(){function e(n,r){t.push(n+" ")>C.cacheLength&&delete e[t.shift()];return e[n+" "]=r}var t=[];return e}function r(e){e[R]=!0;return e}function i(e){var t=E.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)C.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return r(function(t){t=+t;return r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&typeof e.getElementsByTagName!==$&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=B++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,u=[z,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){l=t[R]||(t[R]={});if((s=l[r])&&s[0]===z&&s[1]===o)return u[2]=s[2];l[r]=u;if(u[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function m(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;l>s;s++)if((o=e[s])&&(!n||n(o,r,i))){a.push(o);u&&t.push(s)}return a}function v(e,t,n,i,o,a){i&&!i[R]&&(i=v(i));o&&!o[R]&&(o=v(o,a));return r(function(r,a,s,l){var u,c,f,d=[],h=[],p=a.length,v=r||g(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:m(v,d,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;n&&n(y,b,s,l);if(i){u=m(b,h);i(u,[],s,l);c=u.length;for(;c--;)(f=u[c])&&(b[h[c]]=!(y[h[c]]=f))}if(r){if(o||e){if(o){u=[];c=b.length;for(;c--;)(f=b[c])&&u.push(y[c]=f);o(null,b=[],u,l)}c=b.length;for(;c--;)(f=b[c])&&(u=o?tt.call(r,f):d[c])>-1&&(r[u]=!(a[u]=f))}}else{b=m(b===a?b.splice(p,b.length):b);o?o(null,a,b,l):Z.apply(a,b)}})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),u=h(function(e){return tt.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==A)||((t=n).nodeType?l(e,n,r):u(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[h(p(c),n)];else{n=C.filter[e[s].type].apply(null,e[s].matches);if(n[R]){r=++s;for(;i>r&&!C.relative[e[r].type];r++);return v(s>1&&p(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(lt,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&d(e))}c.push(n)}return p(c)}function b(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,l,u){var c,f,d,h=0,p="0",g=r&&[],v=[],y=A,b=r||o&&C.find.TAG("*",u),x=z+=null==y?1:Math.random()||.1,w=b.length;u&&(A=a!==E&&a);for(;p!==w&&null!=(c=b[p]);p++){if(o&&c){f=0;for(;d=e[f++];)if(d(c,a,s)){l.push(c);break}u&&(z=x)}if(i){(c=!d&&c)&&h--;r&&g.push(c)}}h+=p;if(i&&p!==h){f=0;for(;d=n[f++];)d(g,v,a,s);if(r){if(h>0)for(;p--;)g[p]||v[p]||(v[p]=K.call(l));v=m(v)}Z.apply(l,v);u&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(l)}if(u){z=x;A=y}return g};return i?r(a):a}var x,w,C,S,T,k,D,L,A,N,_,M,E,j,I,H,O,F,P,R="sizzle"+-new Date,W=e.document,z=0,B=0,q=n(),U=n(),V=n(),G=function(e,t){e===t&&(_=!0);return 0},$="undefined",X=1<<31,J={}.hasOwnProperty,Y=[],K=Y.pop,Q=Y.push,Z=Y.push,et=Y.slice,tt=Y.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",rt="[\\x20\\t\\r\\n\\f]",it="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot=it.replace("w","w#"),at="\\["+rt+"*("+it+")(?:"+rt+"*([*^$|!~]?=)"+rt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ot+"))|)"+rt+"*\\]",st=":("+it+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+at+")*)|.*)\\)|)",lt=new RegExp("^"+rt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+rt+"+$","g"),ut=new RegExp("^"+rt+"*,"+rt+"*"),ct=new RegExp("^"+rt+"*([>+~]|"+rt+")"+rt+"*"),ft=new RegExp("="+rt+"*([^\\]'\"]*?)"+rt+"*\\]","g"),dt=new RegExp(st),ht=new RegExp("^"+ot+"$"),pt={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+rt+"*(even|odd|(([+-]|)(\\d*)n|)"+rt+"*(?:([+-]|)"+rt+"*(\\d+)|))"+rt+"*\\)|)","i"),bool:new RegExp("^(?:"+nt+")$","i"),needsContext:new RegExp("^"+rt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+rt+"*((?:-\\d)?\\d*)"+rt+"*\\)|)(?=[^-]|$)","i")},gt=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,yt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,bt=/[+~]/,xt=/'|\\/g,wt=new RegExp("\\\\([\\da-f]{1,6}"+rt+"?|("+rt+")|.)","ig"),Ct=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(Y=et.call(W.childNodes),W.childNodes);Y[W.childNodes.length].nodeType}catch(St){Z={apply:Y.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={};T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1};M=t.setDocument=function(e){var t,n=e?e.ownerDocument||e:W,r=n.defaultView;if(n===E||9!==n.nodeType||!n.documentElement)return E;E=n;j=n.documentElement;I=!T(n);r&&r!==r.top&&(r.addEventListener?r.addEventListener("unload",function(){M()},!1):r.attachEvent&&r.attachEvent("onunload",function(){M()}));w.attributes=i(function(e){e.className="i";return!e.getAttribute("className")});w.getElementsByTagName=i(function(e){e.appendChild(n.createComment(""));return!e.getElementsByTagName("*").length});w.getElementsByClassName=vt.test(n.getElementsByClassName)&&i(function(e){e.innerHTML="<div class='a'></div><div class='a i'></div>";e.firstChild.className="i";return 2===e.getElementsByClassName("i").length});w.getById=i(function(e){j.appendChild(e).id=R;return!n.getElementsByName||!n.getElementsByName(R).length});if(w.getById){C.find.ID=function(e,t){if(typeof t.getElementById!==$&&I){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}};C.filter.ID=function(e){var t=e.replace(wt,Ct);return function(e){return e.getAttribute("id")===t}}}else{delete C.find.ID;C.filter.ID=function(e){var t=e.replace(wt,Ct);return function(e){var n=typeof e.getAttributeNode!==$&&e.getAttributeNode("id");return n&&n.value===t}}}C.find.TAG=w.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==$?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o};C.find.CLASS=w.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==$&&I?t.getElementsByClassName(e):void 0};O=[];H=[];if(w.qsa=vt.test(n.querySelectorAll)){i(function(e){e.innerHTML="<select msallowclip=''><option selected=''></option></select>";e.querySelectorAll("[msallowclip^='']").length&&H.push("[*^$]="+rt+"*(?:''|\"\")");e.querySelectorAll("[selected]").length||H.push("\\["+rt+"*(?:value|"+nt+")");e.querySelectorAll(":checked").length||H.push(":checked")});i(function(e){var t=n.createElement("input");t.setAttribute("type","hidden");e.appendChild(t).setAttribute("name","D");e.querySelectorAll("[name=d]").length&&H.push("name"+rt+"*[*^$|!~]?=");e.querySelectorAll(":enabled").length||H.push(":enabled",":disabled");e.querySelectorAll("*,:x");H.push(",.*:")})}(w.matchesSelector=vt.test(F=j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector||j.msMatchesSelector))&&i(function(e){w.disconnectedMatch=F.call(e,"div");F.call(e,"[s!='']:x");O.push("!=",st)});H=H.length&&new RegExp(H.join("|"));O=O.length&&new RegExp(O.join("|"));t=vt.test(j.compareDocumentPosition);P=t||vt.test(j.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1};G=t?function(e,t){if(e===t){_=!0;return 0}var r=!e.compareDocumentPosition-!t.compareDocumentPosition;if(r)return r;r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1;return 1&r||!w.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===W&&P(W,e)?-1:t===n||t.ownerDocument===W&&P(W,t)?1:N?tt.call(N,e)-tt.call(N,t):0:4&r?-1:1}:function(e,t){if(e===t){_=!0;return 0}var r,i=0,o=e.parentNode,s=t.parentNode,l=[e],u=[t];if(!o||!s)return e===n?-1:t===n?1:o?-1:s?1:N?tt.call(N,e)-tt.call(N,t):0;if(o===s)return a(e,t);r=e;for(;r=r.parentNode;)l.unshift(r);r=t;for(;r=r.parentNode;)u.unshift(r);for(;l[i]===u[i];)i++;return i?a(l[i],u[i]):l[i]===W?-1:u[i]===W?1:0};return n};t.matches=function(e,n){return t(e,null,null,n)};t.matchesSelector=function(e,n){(e.ownerDocument||e)!==E&&M(e);n=n.replace(ft,"='$1']");if(!(!w.matchesSelector||!I||O&&O.test(n)||H&&H.test(n)))try{var r=F.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,E,null,[e]).length>0};t.contains=function(e,t){(e.ownerDocument||e)!==E&&M(e);return P(e,t)};t.attr=function(e,t){(e.ownerDocument||e)!==E&&M(e);var n=C.attrHandle[t.toLowerCase()],r=n&&J.call(C.attrHandle,t.toLowerCase())?n(e,t,!I):void 0;return void 0!==r?r:w.attributes||!I?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null};t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};t.uniqueSort=function(e){var t,n=[],r=0,i=0;_=!w.detectDuplicates;N=!w.sortStable&&e.slice(0);e.sort(G);if(_){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}N=null;return e};S=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=S(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=S(t);return n};C=t.selectors={cacheLength:50,createPseudo:r,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(wt,Ct);e[3]=(e[3]||e[4]||e[5]||"").replace(wt,Ct);"~="===e[2]&&(e[3]=" "+e[3]+" ");return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if("nth"===e[1].slice(0,3)){e[3]||t.error(e[0]);e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3]));e[5]=+(e[7]+e[8]||"odd"===e[3])}else e[3]&&t.error(e[0]);return e},PSEUDO:function(e){var t,n=!e[6]&&e[2];if(pt.CHILD.test(e[0]))return null;if(e[3])e[2]=e[4]||e[5]||"";else if(n&&dt.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)){e[0]=e[0].slice(0,t);e[2]=n.slice(0,t)}return e.slice(0,3)}},filter:{TAG:function(e){var t=e.replace(wt,Ct).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=q[e+" "];return t||(t=new RegExp("(^|"+rt+")"+e+"("+rt+"|$)"))&&q(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==$&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);if(null==o)return"!="===n;if(!n)return!0;o+="";return"="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,f,d,h,p,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(m){if(o){for(;g;){f=t;for(;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}p=[a?m.firstChild:m.lastChild];if(a&&y){c=m[R]||(m[R]={});u=c[e]||[];h=u[0]===z&&u[1];d=u[0]===z&&u[2];f=h&&m.childNodes[h];for(;f=++h&&f&&f[g]||(d=h=0)||p.pop();)if(1===f.nodeType&&++d&&f===t){c[e]=[z,h,d];break}}else if(y&&(u=(t[R]||(t[R]={}))[e])&&u[0]===z)d=u[1];else for(;f=++h&&f&&f[g]||(d=h=0)||p.pop();)if((s?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++d){y&&((f[R]||(f[R]={}))[e]=[z,d]);if(f===t)break}d-=i;return d===r||d%r===0&&d/r>=0}}},PSEUDO:function(e,n){var i,o=C.pseudos[e]||C.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);if(o[R])return o(n);if(o.length>1){i=[e,e,"",n];return C.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;){r=tt.call(e,i[a]);e[r]=!(t[r]=i[a])}}):function(e){return o(e,0,i)}}return o}},pseudos:{not:r(function(e){var t=[],n=[],i=D(e.replace(lt,"$1"));return i[R]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){t[0]=e;i(t,null,o,n);return!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}}),lang:r(function(e){ht.test(e||"")||t.error("unsupported lang: "+e);e=e.replace(wt,Ct).toLowerCase();return function(t){var n;do if(n=I?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang")){n=n.toLowerCase();return n===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===j},focus:function(e){return e===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){e.parentNode&&e.parentNode.selectedIndex;return e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return mt.test(e.nodeName)},input:function(e){return gt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t },text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}};C.pseudos.nth=C.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[x]=s(x);for(x in{submit:!0,reset:!0})C.pseudos[x]=l(x);f.prototype=C.filters=C.pseudos;C.setFilters=new f;k=t.tokenize=function(e,n){var r,i,o,a,s,l,u,c=U[e+" "];if(c)return n?0:c.slice(0);s=e;l=[];u=C.preFilter;for(;s;){if(!r||(i=ut.exec(s))){i&&(s=s.slice(i[0].length)||s);l.push(o=[])}r=!1;if(i=ct.exec(s)){r=i.shift();o.push({value:r,type:i[0].replace(lt," ")});s=s.slice(r.length)}for(a in C.filter)if((i=pt[a].exec(s))&&(!u[a]||(i=u[a](i)))){r=i.shift();o.push({value:r,type:a,matches:i});s=s.slice(r.length)}if(!r)break}return n?s.length:s?t.error(e):U(e,l).slice(0)};D=t.compile=function(e,t){var n,r=[],i=[],o=V[e+" "];if(!o){t||(t=k(e));n=t.length;for(;n--;){o=y(t[n]);o[R]?r.push(o):i.push(o)}o=V(e,b(i,r));o.selector=e}return o};L=t.select=function(e,t,n,r){var i,o,a,s,l,u="function"==typeof e&&e,f=!r&&k(e=u.selector||e);n=n||[];if(1===f.length){o=f[0]=f[0].slice(0);if(o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&I&&C.relative[o[1].type]){t=(C.find.ID(a.matches[0].replace(wt,Ct),t)||[])[0];if(!t)return n;u&&(t=t.parentNode);e=e.slice(o.shift().value.length)}i=pt.needsContext.test(e)?0:o.length;for(;i--;){a=o[i];if(C.relative[s=a.type])break;if((l=C.find[s])&&(r=l(a.matches[0].replace(wt,Ct),bt.test(o[0].type)&&c(t.parentNode)||t))){o.splice(i,1);e=r.length&&d(o);if(!e){Z.apply(n,r);return n}break}}}(u||D(e,f))(r,t,!I,n,bt.test(e)&&c(t.parentNode)||t);return n};w.sortStable=R.split("").sort(G).join("")===R;w.detectDuplicates=!!_;M();w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(E.createElement("div"))});i(function(e){e.innerHTML="<a href='#'></a>";return"#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)});w.attributes&&i(function(e){e.innerHTML="<input/>";e.firstChild.setAttribute("value","");return""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue});i(function(e){return null==e.getAttribute("disabled")})||o(nt,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});return t}(t);ot.find=ct;ot.expr=ct.selectors;ot.expr[":"]=ot.expr.pseudos;ot.unique=ct.uniqueSort;ot.text=ct.getText;ot.isXMLDoc=ct.isXML;ot.contains=ct.contains;var ft=ot.expr.match.needsContext,dt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ht=/^.[^:#\[\.,]*$/;ot.filter=function(e,t,n){var r=t[0];n&&(e=":not("+e+")");return 1===t.length&&1===r.nodeType?ot.find.matchesSelector(r,e)?[r]:[]:ot.find.matches(e,ot.grep(t,function(e){return 1===e.nodeType}))};ot.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(ot(e).filter(function(){for(t=0;i>t;t++)if(ot.contains(r[t],this))return!0}));for(t=0;i>t;t++)ot.find(e,r[t],n);n=this.pushStack(i>1?ot.unique(n):n);n.selector=this.selector?this.selector+" "+e:e;return n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&ft.test(e)?ot(e):e||[],!1).length}});var pt,gt=t.document,mt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,vt=ot.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:mt.exec(e);if(!n||!n[1]&&t)return!t||t.jquery?(t||pt).find(e):this.constructor(t).find(e);if(n[1]){t=t instanceof ot?t[0]:t;ot.merge(this,ot.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:gt,!0));if(dt.test(n[1])&&ot.isPlainObject(t))for(n in t)ot.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}r=gt.getElementById(n[2]);if(r&&r.parentNode){if(r.id!==n[2])return pt.find(e);this.length=1;this[0]=r}this.context=gt;this.selector=e;return this}if(e.nodeType){this.context=this[0]=e;this.length=1;return this}if(ot.isFunction(e))return"undefined"!=typeof pt.ready?pt.ready(e):e(ot);if(void 0!==e.selector){this.selector=e.selector;this.context=e.context}return ot.makeArray(e,this)};vt.prototype=ot.fn;pt=ot(gt);var yt=/^(?:parents|prev(?:Until|All))/,bt={children:!0,contents:!0,next:!0,prev:!0};ot.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!ot(i).is(n));){1===i.nodeType&&r.push(i);i=i[t]}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});ot.fn.extend({has:function(e){var t,n=ot(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(ot.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ft.test(e)||"string"!=typeof e?ot(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&ot.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?ot.unique(o):o)},index:function(e){return e?"string"==typeof e?ot.inArray(this[0],ot(e)):ot.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ot.unique(ot.merge(this.get(),ot(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});ot.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ot.dir(e,"parentNode")},parentsUntil:function(e,t,n){return ot.dir(e,"parentNode",n)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return ot.dir(e,"nextSibling")},prevAll:function(e){return ot.dir(e,"previousSibling")},nextUntil:function(e,t,n){return ot.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return ot.dir(e,"previousSibling",n)},siblings:function(e){return ot.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ot.sibling(e.firstChild)},contents:function(e){return ot.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ot.merge([],e.childNodes)}},function(e,t){ot.fn[e]=function(n,r){var i=ot.map(this,t,n);"Until"!==e.slice(-5)&&(r=n);r&&"string"==typeof r&&(i=ot.filter(r,i));if(this.length>1){bt[e]||(i=ot.unique(i));yt.test(e)&&(i=i.reverse())}return this.pushStack(i)}});var xt=/\S+/g,wt={};ot.Callbacks=function(e){e="string"==typeof e?wt[e]||a(e):ot.extend({},e);var t,n,r,i,o,s,l=[],u=!e.once&&[],c=function(a){n=e.memory&&a;r=!0;o=s||0;s=0;i=l.length;t=!0;for(;l&&i>o;o++)if(l[o].apply(a[0],a[1])===!1&&e.stopOnFalse){n=!1;break}t=!1;l&&(u?u.length&&c(u.shift()):n?l=[]:f.disable())},f={add:function(){if(l){var r=l.length;(function o(t){ot.each(t,function(t,n){var r=ot.type(n);"function"===r?e.unique&&f.has(n)||l.push(n):n&&n.length&&"string"!==r&&o(n)})})(arguments);if(t)i=l.length;else if(n){s=r;c(n)}}return this},remove:function(){l&&ot.each(arguments,function(e,n){for(var r;(r=ot.inArray(n,l,r))>-1;){l.splice(r,1);if(t){i>=r&&i--;o>=r&&o--}}});return this},has:function(e){return e?ot.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){l=[];i=0;return this},disable:function(){l=u=n=void 0;return this},disabled:function(){return!l},lock:function(){u=void 0;n||f.disable();return this},locked:function(){return!u},fireWith:function(e,n){if(l&&(!r||u)){n=n||[];n=[e,n.slice?n.slice():n];t?u.push(n):c(n)}return this},fire:function(){f.fireWith(this,arguments);return this},fired:function(){return!!r}};return f};ot.extend({Deferred:function(e){var t=[["resolve","done",ot.Callbacks("once memory"),"resolved"],["reject","fail",ot.Callbacks("once memory"),"rejected"],["notify","progress",ot.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var e=arguments;return ot.Deferred(function(n){ot.each(t,function(t,o){var a=ot.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&ot.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})});e=null}).promise()},promise:function(e){return null!=e?ot.extend(e,r):r}},i={};r.pipe=r.then;ot.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add;s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock);i[o[0]]=function(){i[o[0]+"With"](this===i?r:this,arguments);return this};i[o[0]+"With"]=a.fireWith});r.promise(i);e&&e.call(i,i);return i},when:function(e){var t,n,r,i=0,o=Y.call(arguments),a=o.length,s=1!==a||e&&ot.isFunction(e.promise)?a:0,l=1===s?e:ot.Deferred(),u=function(e,n,r){return function(i){n[e]=this;r[e]=arguments.length>1?Y.call(arguments):i;r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1){t=new Array(a);n=new Array(a);r=new Array(a);for(;a>i;i++)o[i]&&ot.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,t)):--s}s||l.resolveWith(r,o);return l.promise()}});var Ct;ot.fn.ready=function(e){ot.ready.promise().done(e);return this};ot.extend({isReady:!1,readyWait:1,holdReady:function(e){e?ot.readyWait++:ot.ready(!0)},ready:function(e){if(e===!0?!--ot.readyWait:!ot.isReady){if(!gt.body)return setTimeout(ot.ready);ot.isReady=!0;if(!(e!==!0&&--ot.readyWait>0)){Ct.resolveWith(gt,[ot]);if(ot.fn.triggerHandler){ot(gt).triggerHandler("ready");ot(gt).off("ready")}}}}});ot.ready.promise=function(e){if(!Ct){Ct=ot.Deferred();if("complete"===gt.readyState)setTimeout(ot.ready);else if(gt.addEventListener){gt.addEventListener("DOMContentLoaded",l,!1);t.addEventListener("load",l,!1)}else{gt.attachEvent("onreadystatechange",l);t.attachEvent("onload",l);var n=!1;try{n=null==t.frameElement&&gt.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!ot.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}s();ot.ready()}}()}}return Ct.promise(e)};var St,Tt="undefined";for(St in ot(rt))break;rt.ownLast="0"!==St;rt.inlineBlockNeedsLayout=!1;ot(function(){var e,t,n,r;n=gt.getElementsByTagName("body")[0];if(n&&n.style){t=gt.createElement("div");r=gt.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(t);if(typeof t.style.zoom!==Tt){t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";rt.inlineBlockNeedsLayout=e=3===t.offsetWidth;e&&(n.style.zoom=1)}n.removeChild(r)}});(function(){var e=gt.createElement("div");if(null==rt.deleteExpando){rt.deleteExpando=!0;try{delete e.test}catch(t){rt.deleteExpando=!1}}e=null})();ot.acceptData=function(e){var t=ot.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return 1!==n&&9!==n?!1:!t||t!==!0&&e.getAttribute("classid")===t};var kt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Dt=/([A-Z])/g;ot.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){e=e.nodeType?ot.cache[e[ot.expando]]:e[ot.expando];return!!e&&!c(e)},data:function(e,t,n){return f(e,t,n)},removeData:function(e,t){return d(e,t)},_data:function(e,t,n){return f(e,t,n,!0)},_removeData:function(e,t){return d(e,t,!0)}});ot.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length){i=ot.data(o);if(1===o.nodeType&&!ot._data(o,"parsedAttrs")){n=a.length;for(;n--;)if(a[n]){r=a[n].name;if(0===r.indexOf("data-")){r=ot.camelCase(r.slice(5));u(o,r,i[r])}}ot._data(o,"parsedAttrs",!0)}}return i}return"object"==typeof e?this.each(function(){ot.data(this,e)}):arguments.length>1?this.each(function(){ot.data(this,e,t)}):o?u(o,e,ot.data(o,e)):void 0},removeData:function(e){return this.each(function(){ot.removeData(this,e)})}});ot.extend({queue:function(e,t,n){var r;if(e){t=(t||"fx")+"queue";r=ot._data(e,t);n&&(!r||ot.isArray(n)?r=ot._data(e,t,ot.makeArray(n)):r.push(n));return r||[]}},dequeue:function(e,t){t=t||"fx";var n=ot.queue(e,t),r=n.length,i=n.shift(),o=ot._queueHooks(e,t),a=function(){ot.dequeue(e,t)};if("inprogress"===i){i=n.shift();r--}if(i){"fx"===t&&n.unshift("inprogress");delete o.stop;i.call(e,a,o)}!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ot._data(e,n)||ot._data(e,n,{empty:ot.Callbacks("once memory").add(function(){ot._removeData(e,t+"queue");ot._removeData(e,n)})})}});ot.fn.extend({queue:function(e,t){var n=2;if("string"!=typeof e){t=e;e="fx";n--}return arguments.length<n?ot.queue(this[0],e):void 0===t?this:this.each(function(){var n=ot.queue(this,e,t);ot._queueHooks(this,e);"fx"===e&&"inprogress"!==n[0]&&ot.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ot.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ot.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};if("string"!=typeof e){t=e;e=void 0}e=e||"fx";for(;a--;){n=ot._data(o[a],e+"queueHooks");if(n&&n.empty){r++;n.empty.add(s)}}s();return i.promise(t)}});var Lt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,At=["Top","Right","Bottom","Left"],Nt=function(e,t){e=t||e;return"none"===ot.css(e,"display")||!ot.contains(e.ownerDocument,e)},_t=ot.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===ot.type(n)){i=!0;for(s in n)ot.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r){i=!0;ot.isFunction(r)||(a=!0);if(u)if(a){t.call(e,r);t=null}else{u=t;t=function(e,t,n){return u.call(ot(e),n)}}if(t)for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)))}return i?e:u?t.call(e):l?t(e[0],n):o},Mt=/^(?:checkbox|radio)$/i;(function(){var e=gt.createElement("input"),t=gt.createElement("div"),n=gt.createDocumentFragment();t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";rt.leadingWhitespace=3===t.firstChild.nodeType;rt.tbody=!t.getElementsByTagName("tbody").length;rt.htmlSerialize=!!t.getElementsByTagName("link").length;rt.html5Clone="<:nav></:nav>"!==gt.createElement("nav").cloneNode(!0).outerHTML;e.type="checkbox";e.checked=!0;n.appendChild(e);rt.appendChecked=e.checked;t.innerHTML="<textarea>x</textarea>";rt.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue;n.appendChild(t);t.innerHTML="<input type='radio' checked='checked' name='t'/>";rt.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked;rt.noCloneEvent=!0;if(t.attachEvent){t.attachEvent("onclick",function(){rt.noCloneEvent=!1});t.cloneNode(!0).click()}if(null==rt.deleteExpando){rt.deleteExpando=!0;try{delete t.test}catch(r){rt.deleteExpando=!1}}})();(function(){var e,n,r=gt.createElement("div");for(e in{submit:!0,change:!0,focusin:!0}){n="on"+e;if(!(rt[e+"Bubbles"]=n in t)){r.setAttribute(n,"t");rt[e+"Bubbles"]=r.attributes[n].expando===!1}}r=null})();var Et=/^(?:input|select|textarea)$/i,jt=/^key/,It=/^(?:mouse|pointer|contextmenu)|click/,Ht=/^(?:focusinfocus|focusoutblur)$/,Ot=/^([^.]*)(?:\.(.+)|)$/;ot.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,h,p,g,m=ot._data(e);if(m){if(n.handler){l=n;n=l.handler;i=l.selector}n.guid||(n.guid=ot.guid++);(a=m.events)||(a=m.events={});if(!(c=m.handle)){c=m.handle=function(e){return typeof ot===Tt||e&&ot.event.triggered===e.type?void 0:ot.event.dispatch.apply(c.elem,arguments)};c.elem=e}t=(t||"").match(xt)||[""];s=t.length;for(;s--;){o=Ot.exec(t[s])||[];h=g=o[1];p=(o[2]||"").split(".").sort();if(h){u=ot.event.special[h]||{};h=(i?u.delegateType:u.bindType)||h;u=ot.event.special[h]||{};f=ot.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ot.expr.match.needsContext.test(i),namespace:p.join(".")},l);if(!(d=a[h])){d=a[h]=[];d.delegateCount=0;u.setup&&u.setup.call(e,r,p,c)!==!1||(e.addEventListener?e.addEventListener(h,c,!1):e.attachEvent&&e.attachEvent("on"+h,c))}if(u.add){u.add.call(e,f);f.handler.guid||(f.handler.guid=n.guid)}i?d.splice(d.delegateCount++,0,f):d.push(f);ot.event.global[h]=!0}}e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,h,p,g,m=ot.hasData(e)&&ot._data(e);if(m&&(c=m.events)){t=(t||"").match(xt)||[""];u=t.length;for(;u--;){s=Ot.exec(t[u])||[];h=g=s[1];p=(s[2]||"").split(".").sort();if(h){f=ot.event.special[h]||{};h=(r?f.delegateType:f.bindType)||h;d=c[h]||[];s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)");l=o=d.length;for(;o--;){a=d[o];if(!(!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector))){d.splice(o,1);a.selector&&d.delegateCount--;f.remove&&f.remove.call(e,a)}}if(l&&!d.length){f.teardown&&f.teardown.call(e,p,m.handle)!==!1||ot.removeEvent(e,h,m.handle);delete c[h]}}else for(h in c)ot.event.remove(e,h+t[u],n,r,!0)}if(ot.isEmptyObject(c)){delete m.handle;ot._removeData(e,"events")}}},trigger:function(e,n,r,i){var o,a,s,l,u,c,f,d=[r||gt],h=nt.call(e,"type")?e.type:e,p=nt.call(e,"namespace")?e.namespace.split("."):[];s=c=r=r||gt;if(3!==r.nodeType&&8!==r.nodeType&&!Ht.test(h+ot.event.triggered)){if(h.indexOf(".")>=0){p=h.split(".");h=p.shift();p.sort()}a=h.indexOf(":")<0&&"on"+h;e=e[ot.expando]?e:new ot.Event(h,"object"==typeof e&&e);e.isTrigger=i?2:3;e.namespace=p.join(".");e.namespace_re=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;e.result=void 0;e.target||(e.target=r);n=null==n?[e]:ot.makeArray(n,[e]);u=ot.event.special[h]||{};if(i||!u.trigger||u.trigger.apply(r,n)!==!1){if(!i&&!u.noBubble&&!ot.isWindow(r)){l=u.delegateType||h;Ht.test(l+h)||(s=s.parentNode);for(;s;s=s.parentNode){d.push(s);c=s}c===(r.ownerDocument||gt)&&d.push(c.defaultView||c.parentWindow||t)}f=0;for(;(s=d[f++])&&!e.isPropagationStopped();){e.type=f>1?l:u.bindType||h;o=(ot._data(s,"events")||{})[e.type]&&ot._data(s,"handle");o&&o.apply(s,n);o=a&&s[a];if(o&&o.apply&&ot.acceptData(s)){e.result=o.apply(s,n);e.result===!1&&e.preventDefault()}}e.type=h;if(!i&&!e.isDefaultPrevented()&&(!u._default||u._default.apply(d.pop(),n)===!1)&&ot.acceptData(r)&&a&&r[h]&&!ot.isWindow(r)){c=r[a];c&&(r[a]=null);ot.event.triggered=h;try{r[h]()}catch(g){}ot.event.triggered=void 0;c&&(r[a]=c)}return e.result}}},dispatch:function(e){e=ot.event.fix(e);var t,n,r,i,o,a=[],s=Y.call(arguments),l=(ot._data(this,"events")||{})[e.type]||[],u=ot.event.special[e.type]||{};s[0]=e;e.delegateTarget=this;if(!u.preDispatch||u.preDispatch.call(this,e)!==!1){a=ot.event.handlers.call(this,e,l);t=0;for(;(i=a[t++])&&!e.isPropagationStopped();){e.currentTarget=i.elem;o=0;for(;(r=i.handlers[o++])&&!e.isImmediatePropagationStopped();)if(!e.namespace_re||e.namespace_re.test(r.namespace)){e.handleObj=r;e.data=r.data;n=((ot.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,s);if(void 0!==n&&(e.result=n)===!1){e.preventDefault();e.stopPropagation()}}}u.postDispatch&&u.postDispatch.call(this,e);return e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){i=[];for(o=0;s>o;o++){r=t[o];n=r.selector+" ";void 0===i[n]&&(i[n]=r.needsContext?ot(n,this).index(l)>=0:ot.find(n,this,null,[l]).length);i[n]&&i.push(r)}i.length&&a.push({elem:l,handlers:i})}s<t.length&&a.push({elem:this,handlers:t.slice(s)});return a},fix:function(e){if(e[ot.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=It.test(i)?this.mouseHooks:jt.test(i)?this.keyHooks:{});r=a.props?this.props.concat(a.props):this.props;e=new ot.Event(o);t=r.length;for(;t--;){n=r[t];e[n]=o[n]}e.target||(e.target=o.srcElement||gt);3===e.target.nodeType&&(e.target=e.target.parentNode);e.metaKey=!!e.metaKey;return a.filter?a.filter(e,o):e},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(e,t){null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode);return e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;if(null==e.pageX&&null!=t.clientX){r=e.target.ownerDocument||gt;i=r.documentElement;n=r.body;e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0);e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)}!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a);e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0);return e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)try{this.focus();return!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur){this.blur();return!1}},delegateType:"focusout"},click:{trigger:function(){if(ot.nodeName(this,"input")&&"checkbox"===this.type&&this.click){this.click();return!1}},_default:function(e){return ot.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=ot.extend(new ot.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?ot.event.trigger(i,null,t):ot.event.dispatch.call(t,i);i.isDefaultPrevented()&&n.preventDefault()}};ot.removeEvent=gt.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;if(e.detachEvent){typeof e[r]===Tt&&(e[r]=null);e.detachEvent(r,n)}};ot.Event=function(e,t){if(!(this instanceof ot.Event))return new ot.Event(e,t);if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:p}else this.type=e;t&&ot.extend(this,t);this.timeStamp=e&&e.timeStamp||ot.now();this[ot.expando]=!0};ot.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h;if(e){e.stopPropagation&&e.stopPropagation();e.cancelBubble=!0}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h;e&&e.stopImmediatePropagation&&e.stopImmediatePropagation();this.stopPropagation()}};ot.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){ot.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;if(!i||i!==r&&!ot.contains(r,i)){e.type=o.origType;n=o.handler.apply(this,arguments);e.type=t}return n}}});rt.submitBubbles||(ot.event.special.submit={setup:function(){if(ot.nodeName(this,"form"))return!1;ot.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=ot.nodeName(t,"input")||ot.nodeName(t,"button")?t.form:void 0;if(n&&!ot._data(n,"submitBubbles")){ot.event.add(n,"submit._submit",function(e){e._submit_bubble=!0});ot._data(n,"submitBubbles",!0)}});return void 0},postDispatch:function(e){if(e._submit_bubble){delete e._submit_bubble;this.parentNode&&!e.isTrigger&&ot.event.simulate("submit",this.parentNode,e,!0)}},teardown:function(){if(ot.nodeName(this,"form"))return!1;ot.event.remove(this,"._submit");return void 0}});rt.changeBubbles||(ot.event.special.change={setup:function(){if(Et.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type){ot.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)});ot.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1);ot.event.simulate("change",this,e,!0)})}return!1}ot.event.add(this,"beforeactivate._change",function(e){var t=e.target;if(Et.test(t.nodeName)&&!ot._data(t,"changeBubbles")){ot.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||ot.event.simulate("change",this.parentNode,e,!0)});ot._data(t,"changeBubbles",!0)}})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){ot.event.remove(this,"._change");return!Et.test(this.nodeName)}});rt.focusinBubbles||ot.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ot.event.simulate(t,e.target,ot.event.fix(e),!0)};ot.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ot._data(r,t);i||r.addEventListener(e,n,!0);ot._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ot._data(r,t)-1;if(i)ot._data(r,t,i);else{r.removeEventListener(e,n,!0);ot._removeData(r,t)}}}});ot.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){if("string"!=typeof t){n=n||t;t=void 0}for(o in e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r){r=t;n=t=void 0}else if(null==r)if("string"==typeof t){r=n;n=void 0}else{r=n;n=t;t=void 0}if(r===!1)r=p;else if(!r)return this;if(1===i){a=r;r=function(e){ot().off(e);return a.apply(this,arguments)};r.guid=a.guid||(a.guid=ot.guid++)}return this.each(function(){ot.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj){r=e.handleObj;ot(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler);return this}if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}if(t===!1||"function"==typeof t){n=t;t=void 0}n===!1&&(n=p);return this.each(function(){ot.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){ot.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?ot.event.trigger(e,t,n,!0):void 0}});var Ft="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Pt=/ jQuery\d+="(?:null|\d+)"/g,Rt=new RegExp("<(?:"+Ft+")[\\s/>]","i"),Wt=/^\s+/,zt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Bt=/<([\w:]+)/,qt=/<tbody/i,Ut=/<|&#?\w+;/,Vt=/<(?:script|style|link)/i,Gt=/checked\s*(?:[^=]|=\s*.checked.)/i,$t=/^$|\/(?:java|ecma)script/i,Xt=/^true\/(.*)/,Jt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Yt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:rt.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Kt=m(gt),Qt=Kt.appendChild(gt.createElement("div"));Yt.optgroup=Yt.option;Yt.tbody=Yt.tfoot=Yt.colgroup=Yt.caption=Yt.thead;Yt.th=Yt.td;ot.extend({clone:function(e,t,n){var r,i,o,a,s,l=ot.contains(e.ownerDocument,e);if(rt.html5Clone||ot.isXMLDoc(e)||!Rt.test("<"+e.nodeName+">"))o=e.cloneNode(!0);else{Qt.innerHTML=e.outerHTML;Qt.removeChild(o=Qt.firstChild)}if(!(rt.noCloneEvent&&rt.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ot.isXMLDoc(e))){r=v(o);s=v(e);for(a=0;null!=(i=s[a]);++a)r[a]&&T(i,r[a])}if(t)if(n){s=s||v(e);r=r||v(o);for(a=0;null!=(i=s[a]);a++)S(i,r[a])}else S(e,o);r=v(o,"script");r.length>0&&C(r,!l&&v(e,"script"));r=s=i=null;return o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,c,f=e.length,d=m(t),h=[],p=0;f>p;p++){o=e[p];if(o||0===o)if("object"===ot.type(o))ot.merge(h,o.nodeType?[o]:o);else if(Ut.test(o)){s=s||d.appendChild(t.createElement("div"));l=(Bt.exec(o)||["",""])[1].toLowerCase();c=Yt[l]||Yt._default;s.innerHTML=c[1]+o.replace(zt,"<$1></$2>")+c[2];i=c[0];for(;i--;)s=s.lastChild;!rt.leadingWhitespace&&Wt.test(o)&&h.push(t.createTextNode(Wt.exec(o)[0]));if(!rt.tbody){o="table"!==l||qt.test(o)?"<table>"!==c[1]||qt.test(o)?0:s:s.firstChild;i=o&&o.childNodes.length;for(;i--;)ot.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}ot.merge(h,s.childNodes);s.textContent="";for(;s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o))}s&&d.removeChild(s);rt.appendChecked||ot.grep(v(h,"input"),y);p=0;for(;o=h[p++];)if(!r||-1===ot.inArray(o,r)){a=ot.contains(o.ownerDocument,o);s=v(d.appendChild(o),"script");a&&C(s);if(n){i=0;for(;o=s[i++];)$t.test(o.type||"")&&n.push(o)}}s=null;return d},cleanData:function(e,t){for(var n,r,i,o,a=0,s=ot.expando,l=ot.cache,u=rt.deleteExpando,c=ot.event.special;null!=(n=e[a]);a++)if(t||ot.acceptData(n)){i=n[s];o=i&&l[i];if(o){if(o.events)for(r in o.events)c[r]?ot.event.remove(n,r):ot.removeEvent(n,r,o.handle);if(l[i]){delete l[i];u?delete n[s]:typeof n.removeAttribute!==Tt?n.removeAttribute(s):n[s]=null;J.push(i)}}}}});ot.fn.extend({text:function(e){return _t(this,function(e){return void 0===e?ot.text(this):this.empty().append((this[0]&&this[0].ownerDocument||gt).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=b(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=b(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?ot.filter(e,this):this,i=0;null!=(n=r[i]);i++){t||1!==n.nodeType||ot.cleanData(v(n));if(n.parentNode){t&&ot.contains(n.ownerDocument,n)&&C(v(n,"script"));n.parentNode.removeChild(n)}}return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){1===e.nodeType&&ot.cleanData(v(e,!1));for(;e.firstChild;)e.removeChild(e.firstChild);e.options&&ot.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){e=null==e?!1:e;t=null==t?e:t;return this.map(function(){return ot.clone(this,e,t)})},html:function(e){return _t(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Pt,""):void 0;if(!("string"!=typeof e||Vt.test(e)||!rt.htmlSerialize&&Rt.test(e)||!rt.leadingWhitespace&&Wt.test(e)||Yt[(Bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(zt,"<$1></$2>");try{for(;r>n;n++){t=this[n]||{};if(1===t.nodeType){ot.cleanData(v(t,!1));t.innerHTML=e}}t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];this.domManip(arguments,function(t){e=this.parentNode;ot.cleanData(v(this));e&&e.replaceChild(t,this)});return e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=K.apply([],e);var n,r,i,o,a,s,l=0,u=this.length,c=this,f=u-1,d=e[0],h=ot.isFunction(d);if(h||u>1&&"string"==typeof d&&!rt.checkClone&&Gt.test(d))return this.each(function(n){var r=c.eq(n);h&&(e[0]=d.call(this,n,r.html()));r.domManip(e,t)});if(u){s=ot.buildFragment(e,this[0].ownerDocument,!1,this);n=s.firstChild;1===s.childNodes.length&&(s=n);if(n){o=ot.map(v(s,"script"),x);i=o.length;for(;u>l;l++){r=s;if(l!==f){r=ot.clone(r,!0,!0);i&&ot.merge(o,v(r,"script"))}t.call(this[l],r,l)}if(i){a=o[o.length-1].ownerDocument;ot.map(o,w);for(l=0;i>l;l++){r=o[l];$t.test(r.type||"")&&!ot._data(r,"globalEval")&&ot.contains(a,r)&&(r.src?ot._evalUrl&&ot._evalUrl(r.src):ot.globalEval((r.text||r.textContent||r.innerHTML||"").replace(Jt,"")))}}s=n=null}}return this}});ot.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ot.fn[e]=function(e){for(var n,r=0,i=[],o=ot(e),a=o.length-1;a>=r;r++){n=r===a?this:this.clone(!0); ot(o[r])[t](n);Q.apply(i,n.get())}return this.pushStack(i)}});var Zt,en={};(function(){var e;rt.shrinkWrapBlocks=function(){if(null!=e)return e;e=!1;var t,n,r;n=gt.getElementsByTagName("body")[0];if(n&&n.style){t=gt.createElement("div");r=gt.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(t);if(typeof t.style.zoom!==Tt){t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1";t.appendChild(gt.createElement("div")).style.width="5px";e=3!==t.offsetWidth}n.removeChild(r);return e}}})();var tn,nn,rn=/^margin/,on=new RegExp("^("+Lt+")(?!px)[a-z%]+$","i"),an=/^(top|right|bottom|left)$/;if(t.getComputedStyle){tn=function(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)};nn=function(e,t,n){var r,i,o,a,s=e.style;n=n||tn(e);a=n?n.getPropertyValue(t)||n[t]:void 0;if(n){""!==a||ot.contains(e.ownerDocument,e)||(a=ot.style(e,t));if(on.test(a)&&rn.test(t)){r=s.width;i=s.minWidth;o=s.maxWidth;s.minWidth=s.maxWidth=s.width=a;a=n.width;s.width=r;s.minWidth=i;s.maxWidth=o}}return void 0===a?a:a+""}}else if(gt.documentElement.currentStyle){tn=function(e){return e.currentStyle};nn=function(e,t,n){var r,i,o,a,s=e.style;n=n||tn(e);a=n?n[t]:void 0;null==a&&s&&s[t]&&(a=s[t]);if(on.test(a)&&!an.test(t)){r=s.left;i=e.runtimeStyle;o=i&&i.left;o&&(i.left=e.currentStyle.left);s.left="fontSize"===t?"1em":a;a=s.pixelLeft+"px";s.left=r;o&&(i.left=o)}return void 0===a?a:a+""||"auto"}}(function(){function e(){var e,n,r,i;n=gt.getElementsByTagName("body")[0];if(n&&n.style){e=gt.createElement("div");r=gt.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";o=a=!1;l=!0;if(t.getComputedStyle){o="1%"!==(t.getComputedStyle(e,null)||{}).top;a="4px"===(t.getComputedStyle(e,null)||{width:"4px"}).width;i=e.appendChild(gt.createElement("div"));i.style.cssText=e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0";i.style.marginRight=i.style.width="0";e.style.width="1px";l=!parseFloat((t.getComputedStyle(i,null)||{}).marginRight)}e.innerHTML="<table><tr><td></td><td>t</td></tr></table>";i=e.getElementsByTagName("td");i[0].style.cssText="margin:0;border:0;padding:0;display:none";s=0===i[0].offsetHeight;if(s){i[0].style.display="";i[1].style.display="none";s=0===i[0].offsetHeight}n.removeChild(r)}}var n,r,i,o,a,s,l;n=gt.createElement("div");n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";i=n.getElementsByTagName("a")[0];r=i&&i.style;if(r){r.cssText="float:left;opacity:.5";rt.opacity="0.5"===r.opacity;rt.cssFloat=!!r.cssFloat;n.style.backgroundClip="content-box";n.cloneNode(!0).style.backgroundClip="";rt.clearCloneStyle="content-box"===n.style.backgroundClip;rt.boxSizing=""===r.boxSizing||""===r.MozBoxSizing||""===r.WebkitBoxSizing;ot.extend(rt,{reliableHiddenOffsets:function(){null==s&&e();return s},boxSizingReliable:function(){null==a&&e();return a},pixelPosition:function(){null==o&&e();return o},reliableMarginRight:function(){null==l&&e();return l}})}})();ot.swap=function(e,t,n,r){var i,o,a={};for(o in t){a[o]=e.style[o];e.style[o]=t[o]}i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var sn=/alpha\([^)]*\)/i,ln=/opacity\s*=\s*([^)]*)/,un=/^(none|table(?!-c[ea]).+)/,cn=new RegExp("^("+Lt+")(.*)$","i"),fn=new RegExp("^([+-])=("+Lt+")","i"),dn={position:"absolute",visibility:"hidden",display:"block"},hn={letterSpacing:"0",fontWeight:"400"},pn=["Webkit","O","Moz","ms"];ot.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":rt.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=ot.camelCase(t),l=e.style;t=ot.cssProps[s]||(ot.cssProps[s]=A(l,s));a=ot.cssHooks[t]||ot.cssHooks[s];if(void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];o=typeof n;if("string"===o&&(i=fn.exec(n))){n=(i[1]+1)*i[2]+parseFloat(ot.css(e,t));o="number"}if(null!=n&&n===n){"number"!==o||ot.cssNumber[s]||(n+="px");rt.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit");if(!(a&&"set"in a&&void 0===(n=a.set(e,n,r))))try{l[t]=n}catch(u){}}}},css:function(e,t,n,r){var i,o,a,s=ot.camelCase(t);t=ot.cssProps[s]||(ot.cssProps[s]=A(e.style,s));a=ot.cssHooks[t]||ot.cssHooks[s];a&&"get"in a&&(o=a.get(e,!0,n));void 0===o&&(o=nn(e,t,r));"normal"===o&&t in hn&&(o=hn[t]);if(""===n||n){i=parseFloat(o);return n===!0||ot.isNumeric(i)?i||0:o}return o}});ot.each(["height","width"],function(e,t){ot.cssHooks[t]={get:function(e,n,r){return n?un.test(ot.css(e,"display"))&&0===e.offsetWidth?ot.swap(e,dn,function(){return E(e,t,r)}):E(e,t,r):void 0},set:function(e,n,r){var i=r&&tn(e);return _(e,n,r?M(e,t,r,rt.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,i),i):0)}}});rt.opacity||(ot.cssHooks.opacity={get:function(e,t){return ln.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=ot.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||""===t)&&""===ot.trim(o.replace(sn,""))&&n.removeAttribute){n.removeAttribute("filter");if(""===t||r&&!r.filter)return}n.filter=sn.test(o)?o.replace(sn,i):o+" "+i}});ot.cssHooks.marginRight=L(rt.reliableMarginRight,function(e,t){return t?ot.swap(e,{display:"inline-block"},nn,[e,"marginRight"]):void 0});ot.each({margin:"",padding:"",border:"Width"},function(e,t){ot.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+At[r]+t]=o[r]||o[r-2]||o[0];return i}};rn.test(e)||(ot.cssHooks[e+t].set=_)});ot.fn.extend({css:function(e,t){return _t(this,function(e,t,n){var r,i,o={},a=0;if(ot.isArray(t)){r=tn(e);i=t.length;for(;i>a;a++)o[t[a]]=ot.css(e,t[a],!1,r);return o}return void 0!==n?ot.style(e,t,n):ot.css(e,t)},e,t,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Nt(this)?ot(this).show():ot(this).hide()})}});ot.Tween=j;j.prototype={constructor:j,init:function(e,t,n,r,i,o){this.elem=e;this.prop=n;this.easing=i||"swing";this.options=t;this.start=this.now=this.cur();this.end=r;this.unit=o||(ot.cssNumber[n]?"":"px")},cur:function(){var e=j.propHooks[this.prop];return e&&e.get?e.get(this):j.propHooks._default.get(this)},run:function(e){var t,n=j.propHooks[this.prop];this.pos=t=this.options.duration?ot.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e;this.now=(this.end-this.start)*t+this.start;this.options.step&&this.options.step.call(this.elem,this.now,this);n&&n.set?n.set(this):j.propHooks._default.set(this);return this}};j.prototype.init.prototype=j.prototype;j.propHooks={_default:{get:function(e){var t;if(null!=e.elem[e.prop]&&(!e.elem.style||null==e.elem.style[e.prop]))return e.elem[e.prop];t=ot.css(e.elem,e.prop,"");return t&&"auto"!==t?t:0},set:function(e){ot.fx.step[e.prop]?ot.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ot.cssProps[e.prop]]||ot.cssHooks[e.prop])?ot.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}};j.propHooks.scrollTop=j.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}};ot.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}};ot.fx=j.prototype.init;ot.fx.step={};var gn,mn,vn=/^(?:toggle|show|hide)$/,yn=new RegExp("^(?:([+-])=|)("+Lt+")([a-z%]*)$","i"),bn=/queueHooks$/,xn=[F],wn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=yn.exec(t),o=i&&i[3]||(ot.cssNumber[e]?"":"px"),a=(ot.cssNumber[e]||"px"!==o&&+r)&&yn.exec(ot.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3];i=i||[];a=+r||1;do{s=s||".5";a/=s;ot.style(n.elem,e,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}if(i){a=n.start=+a||+r||0;n.unit=o;n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]}return n}]};ot.Animation=ot.extend(R,{tweener:function(e,t){if(ot.isFunction(e)){t=e;e=["*"]}else e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++){n=e[r];wn[n]=wn[n]||[];wn[n].unshift(t)}},prefilter:function(e,t){t?xn.unshift(e):xn.push(e)}});ot.speed=function(e,t,n){var r=e&&"object"==typeof e?ot.extend({},e):{complete:n||!n&&t||ot.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ot.isFunction(t)&&t};r.duration=ot.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in ot.fx.speeds?ot.fx.speeds[r.duration]:ot.fx.speeds._default;(null==r.queue||r.queue===!0)&&(r.queue="fx");r.old=r.complete;r.complete=function(){ot.isFunction(r.old)&&r.old.call(this);r.queue&&ot.dequeue(this,r.queue)};return r};ot.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Nt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=ot.isEmptyObject(e),o=ot.speed(t,n,r),a=function(){var t=R(this,ot.extend({},e),o);(i||ot._data(this,"finish"))&&t.stop(!0)};a.finish=a;return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop;t(n)};if("string"!=typeof e){n=t;t=e;e=void 0}t&&e!==!1&&this.queue(e||"fx",[]);return this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=ot.timers,a=ot._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&bn.test(i)&&r(a[i]);for(i=o.length;i--;)if(o[i].elem===this&&(null==e||o[i].queue===e)){o[i].anim.stop(n);t=!1;o.splice(i,1)}(t||!n)&&ot.dequeue(this,e)})},finish:function(e){e!==!1&&(e=e||"fx");return this.each(function(){var t,n=ot._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=ot.timers,a=r?r.length:0;n.finish=!0;ot.queue(this,e,[]);i&&i.stop&&i.stop.call(this,!0);for(t=o.length;t--;)if(o[t].elem===this&&o[t].queue===e){o[t].anim.stop(!0);o.splice(t,1)}for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});ot.each(["toggle","show","hide"],function(e,t){var n=ot.fn[t];ot.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(H(t,!0),e,r,i)}});ot.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ot.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}});ot.timers=[];ot.fx.tick=function(){var e,t=ot.timers,n=0;gn=ot.now();for(;n<t.length;n++){e=t[n];e()||t[n]!==e||t.splice(n--,1)}t.length||ot.fx.stop();gn=void 0};ot.fx.timer=function(e){ot.timers.push(e);e()?ot.fx.start():ot.timers.pop()};ot.fx.interval=13;ot.fx.start=function(){mn||(mn=setInterval(ot.fx.tick,ot.fx.interval))};ot.fx.stop=function(){clearInterval(mn);mn=null};ot.fx.speeds={slow:600,fast:200,_default:400};ot.fn.delay=function(e,t){e=ot.fx?ot.fx.speeds[e]||e:e;t=t||"fx";return this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})};(function(){var e,t,n,r,i;t=gt.createElement("div");t.setAttribute("className","t");t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";r=t.getElementsByTagName("a")[0];n=gt.createElement("select");i=n.appendChild(gt.createElement("option"));e=t.getElementsByTagName("input")[0];r.style.cssText="top:1px";rt.getSetAttribute="t"!==t.className;rt.style=/top/.test(r.getAttribute("style"));rt.hrefNormalized="/a"===r.getAttribute("href");rt.checkOn=!!e.value;rt.optSelected=i.selected;rt.enctype=!!gt.createElement("form").enctype;n.disabled=!0;rt.optDisabled=!i.disabled;e=gt.createElement("input");e.setAttribute("value","");rt.input=""===e.getAttribute("value");e.value="t";e.setAttribute("type","radio");rt.radioValue="t"===e.value})();var Cn=/\r/g;ot.fn.extend({val:function(e){var t,n,r,i=this[0];if(arguments.length){r=ot.isFunction(e);return this.each(function(n){var i;if(1===this.nodeType){i=r?e.call(this,n,ot(this).val()):e;null==i?i="":"number"==typeof i?i+="":ot.isArray(i)&&(i=ot.map(i,function(e){return null==e?"":e+""}));t=ot.valHooks[this.type]||ot.valHooks[this.nodeName.toLowerCase()];t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i)}})}if(i){t=ot.valHooks[i.type]||ot.valHooks[i.nodeName.toLowerCase()];if(t&&"get"in t&&void 0!==(n=t.get(i,"value")))return n;n=i.value;return"string"==typeof n?n.replace(Cn,""):null==n?"":n}}});ot.extend({valHooks:{option:{get:function(e){var t=ot.find.attr(e,"value");return null!=t?t:ot.trim(ot.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++){n=r[l];if(!(!n.selected&&l!==i||(rt.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&ot.nodeName(n.parentNode,"optgroup"))){t=ot(n).val();if(o)return t;a.push(t)}}return a},set:function(e,t){for(var n,r,i=e.options,o=ot.makeArray(t),a=i.length;a--;){r=i[a];if(ot.inArray(ot.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1}n||(e.selectedIndex=-1);return i}}}});ot.each(["radio","checkbox"],function(){ot.valHooks[this]={set:function(e,t){return ot.isArray(t)?e.checked=ot.inArray(ot(e).val(),t)>=0:void 0}};rt.checkOn||(ot.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Sn,Tn,kn=ot.expr.attrHandle,Dn=/^(?:checked|selected)$/i,Ln=rt.getSetAttribute,An=rt.input;ot.fn.extend({attr:function(e,t){return _t(this,ot.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ot.removeAttr(this,e)})}});ot.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o){if(typeof e.getAttribute===Tt)return ot.prop(e,t,n);if(1!==o||!ot.isXMLDoc(e)){t=t.toLowerCase();r=ot.attrHooks[t]||(ot.expr.match.bool.test(t)?Tn:Sn)}if(void 0===n){if(r&&"get"in r&&null!==(i=r.get(e,t)))return i;i=ot.find.attr(e,t);return null==i?void 0:i}if(null!==n){if(r&&"set"in r&&void 0!==(i=r.set(e,n,t)))return i;e.setAttribute(t,n+"");return n}ot.removeAttr(e,t)}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(xt);if(o&&1===e.nodeType)for(;n=o[i++];){r=ot.propFix[n]||n;ot.expr.match.bool.test(n)?An&&Ln||!Dn.test(n)?e[r]=!1:e[ot.camelCase("default-"+n)]=e[r]=!1:ot.attr(e,n,"");e.removeAttribute(Ln?n:r)}},attrHooks:{type:{set:function(e,t){if(!rt.radioValue&&"radio"===t&&ot.nodeName(e,"input")){var n=e.value;e.setAttribute("type",t);n&&(e.value=n);return t}}}}});Tn={set:function(e,t,n){t===!1?ot.removeAttr(e,n):An&&Ln||!Dn.test(n)?e.setAttribute(!Ln&&ot.propFix[n]||n,n):e[ot.camelCase("default-"+n)]=e[n]=!0;return n}};ot.each(ot.expr.match.bool.source.match(/\w+/g),function(e,t){var n=kn[t]||ot.find.attr;kn[t]=An&&Ln||!Dn.test(t)?function(e,t,r){var i,o;if(!r){o=kn[t];kn[t]=i;i=null!=n(e,t,r)?t.toLowerCase():null;kn[t]=o}return i}:function(e,t,n){return n?void 0:e[ot.camelCase("default-"+t)]?t.toLowerCase():null}});An&&Ln||(ot.attrHooks.value={set:function(e,t,n){if(!ot.nodeName(e,"input"))return Sn&&Sn.set(e,t,n);e.defaultValue=t;return void 0}});if(!Ln){Sn={set:function(e,t,n){var r=e.getAttributeNode(n);r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n));r.value=t+="";return"value"===n||t===e.getAttribute(n)?t:void 0}};kn.id=kn.name=kn.coords=function(e,t,n){var r;return n?void 0:(r=e.getAttributeNode(t))&&""!==r.value?r.value:null};ot.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:void 0},set:Sn.set};ot.attrHooks.contenteditable={set:function(e,t,n){Sn.set(e,""===t?!1:t,n)}};ot.each(["width","height"],function(e,t){ot.attrHooks[t]={set:function(e,n){if(""===n){e.setAttribute(t,"auto");return n}}}})}rt.style||(ot.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Nn=/^(?:input|select|textarea|button|object)$/i,_n=/^(?:a|area)$/i;ot.fn.extend({prop:function(e,t){return _t(this,ot.prop,e,t,arguments.length>1)},removeProp:function(e){e=ot.propFix[e]||e;return this.each(function(){try{this[e]=void 0;delete this[e]}catch(t){}})}});ot.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a){o=1!==a||!ot.isXMLDoc(e);if(o){t=ot.propFix[t]||t;i=ot.propHooks[t]}return void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]}},propHooks:{tabIndex:{get:function(e){var t=ot.find.attr(e,"tabindex");return t?parseInt(t,10):Nn.test(e.nodeName)||_n.test(e.nodeName)&&e.href?0:-1}}}});rt.hrefNormalized||ot.each(["href","src"],function(e,t){ot.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}});rt.optSelected||(ot.propHooks.selected={get:function(e){var t=e.parentNode;if(t){t.selectedIndex;t.parentNode&&t.parentNode.selectedIndex}return null}});ot.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ot.propFix[this.toLowerCase()]=this});rt.enctype||(ot.propFix.enctype="encoding");var Mn=/[\t\r\n\f]/g;ot.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).addClass(e.call(this,t,this.className))});if(u){t=(e||"").match(xt)||[];for(;l>s;s++){n=this[s];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Mn," "):" ");if(r){o=0;for(;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=ot.trim(r);n.className!==a&&(n.className=a)}}}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).removeClass(e.call(this,t,this.className))});if(u){t=(e||"").match(xt)||[];for(;l>s;s++){n=this[s];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Mn," "):"");if(r){o=0;for(;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?ot.trim(r):"";n.className!==a&&(n.className=a)}}}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(ot.isFunction(e)?function(n){ot(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,r=0,i=ot(this),o=e.match(xt)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else if(n===Tt||"boolean"===n){this.className&&ot._data(this,"__className__",this.className);this.className=this.className||e===!1?"":ot._data(this,"__className__")||""}})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Mn," ").indexOf(t)>=0)return!0;return!1}});ot.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(e,t){ot.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});ot.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var En=ot.now(),jn=/\?/,In=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ot.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var n,r=null,i=ot.trim(e+"");return i&&!ot.trim(i.replace(In,function(e,t,i,o){n&&t&&(r=0);if(0===r)return e;n=i||t;r+=!o-!i;return""}))?Function("return "+i)():ot.error("Invalid JSON: "+e)};ot.parseXML=function(e){var n,r;if(!e||"string"!=typeof e)return null;try{if(t.DOMParser){r=new DOMParser;n=r.parseFromString(e,"text/xml")}else{n=new ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(e)}}catch(i){n=void 0}n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ot.error("Invalid XML: "+e);return n};var Hn,On,Fn=/#.*$/,Pn=/([?&])_=[^&]*/,Rn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Wn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,zn=/^(?:GET|HEAD)$/,Bn=/^\/\//,qn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Un={},Vn={},Gn="*/".concat("*");try{On=location.href}catch($n){On=gt.createElement("a");On.href="";On=On.href}Hn=qn.exec(On.toLowerCase())||[];ot.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:On,type:"GET",isLocal:Wn.test(Hn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Gn,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":ot.parseJSON,"text xml":ot.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?B(B(e,ot.ajaxSettings),t):B(ot.ajaxSettings,e)},ajaxPrefilter:W(Un),ajaxTransport:W(Vn),ajax:function(e,t){function n(e,t,n,r){var i,c,v,y,x,C=t;if(2!==b){b=2;s&&clearTimeout(s);u=void 0;a=r||"";w.readyState=e>0?4:0;i=e>=200&&300>e||304===e;n&&(y=q(f,w,n));y=U(f,y,w,i);if(i){if(f.ifModified){x=w.getResponseHeader("Last-Modified");x&&(ot.lastModified[o]=x);x=w.getResponseHeader("etag");x&&(ot.etag[o]=x)}if(204===e||"HEAD"===f.type)C="nocontent";else if(304===e)C="notmodified";else{C=y.state;c=y.data;v=y.error;i=!v}}else{v=C;if(e||!C){C="error";0>e&&(e=0)}}w.status=e;w.statusText=(t||C)+"";i?p.resolveWith(d,[c,C,w]):p.rejectWith(d,[w,C,v]);w.statusCode(m);m=void 0;l&&h.trigger(i?"ajaxSuccess":"ajaxError",[w,f,i?c:v]);g.fireWith(d,[w,C]);if(l){h.trigger("ajaxComplete",[w,f]);--ot.active||ot.event.trigger("ajaxStop")}}}if("object"==typeof e){t=e;e=void 0}t=t||{};var r,i,o,a,s,l,u,c,f=ot.ajaxSetup({},t),d=f.context||f,h=f.context&&(d.nodeType||d.jquery)?ot(d):ot.event,p=ot.Deferred(),g=ot.Callbacks("once memory"),m=f.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};for(;t=Rn.exec(a);)c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();if(!b){e=y[n]=y[n]||e;v[e]=t}return this},overrideMimeType:function(e){b||(f.mimeType=e);return this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;u&&u.abort(t);n(0,t);return this}};p.promise(w).complete=g.add;w.success=w.done;w.error=w.fail;f.url=((e||f.url||On)+"").replace(Fn,"").replace(Bn,Hn[1]+"//");f.type=t.method||t.type||f.method||f.type;f.dataTypes=ot.trim(f.dataType||"*").toLowerCase().match(xt)||[""];if(null==f.crossDomain){r=qn.exec(f.url.toLowerCase());f.crossDomain=!(!r||r[1]===Hn[1]&&r[2]===Hn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(Hn[3]||("http:"===Hn[1]?"80":"443")))}f.data&&f.processData&&"string"!=typeof f.data&&(f.data=ot.param(f.data,f.traditional));z(Un,f,t,w);if(2===b)return w;l=f.global;l&&0===ot.active++&&ot.event.trigger("ajaxStart");f.type=f.type.toUpperCase();f.hasContent=!zn.test(f.type);o=f.url;if(!f.hasContent){if(f.data){o=f.url+=(jn.test(o)?"&":"?")+f.data;delete f.data}f.cache===!1&&(f.url=Pn.test(o)?o.replace(Pn,"$1_="+En++):o+(jn.test(o)?"&":"?")+"_="+En++)}if(f.ifModified){ot.lastModified[o]&&w.setRequestHeader("If-Modified-Since",ot.lastModified[o]);ot.etag[o]&&w.setRequestHeader("If-None-Match",ot.etag[o])}(f.data&&f.hasContent&&f.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",f.contentType);w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Gn+"; q=0.01":""):f.accepts["*"]);for(i in f.headers)w.setRequestHeader(i,f.headers[i]);if(f.beforeSend&&(f.beforeSend.call(d,w,f)===!1||2===b))return w.abort();x="abort";for(i in{success:1,error:1,complete:1})w[i](f[i]);u=z(Vn,f,t,w);if(u){w.readyState=1;l&&h.trigger("ajaxSend",[w,f]);f.async&&f.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1;u.send(v,n)}catch(C){if(!(2>b))throw C;n(-1,C)}}else n(-1,"No Transport");return w},getJSON:function(e,t,n){return ot.get(e,t,n,"json")},getScript:function(e,t){return ot.get(e,void 0,t,"script")}});ot.each(["get","post"],function(e,t){ot[t]=function(e,n,r,i){if(ot.isFunction(n)){i=i||r;r=n;n=void 0}return ot.ajax({url:e,type:t,dataType:i,data:n,success:r})}});ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ot.fn[t]=function(e){return this.on(t,e)}});ot._evalUrl=function(e){return ot.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})};ot.fn.extend({wrapAll:function(e){if(ot.isFunction(e))return this.each(function(t){ot(this).wrapAll(e.call(this,t))});if(this[0]){var t=ot(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(ot.isFunction(e)?function(t){ot(this).wrapInner(e.call(this,t))}:function(){var t=ot(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ot.isFunction(e);return this.each(function(n){ot(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ot.nodeName(this,"body")||ot(this).replaceWith(this.childNodes)}).end()}});ot.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!rt.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||ot.css(e,"display"))};ot.expr.filters.visible=function(e){return!ot.expr.filters.hidden(e)};var Xn=/%20/g,Jn=/\[\]$/,Yn=/\r?\n/g,Kn=/^(?:submit|button|image|reset|file)$/i,Qn=/^(?:input|select|textarea|keygen)/i;ot.param=function(e,t){var n,r=[],i=function(e,t){t=ot.isFunction(t)?t():null==t?"":t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};void 0===t&&(t=ot.ajaxSettings&&ot.ajaxSettings.traditional);if(ot.isArray(e)||e.jquery&&!ot.isPlainObject(e))ot.each(e,function(){i(this.name,this.value)});else for(n in e)V(n,e[n],t,i);return r.join("&").replace(Xn,"+")};ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ot.prop(this,"elements");return e?ot.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ot(this).is(":disabled")&&Qn.test(this.nodeName)&&!Kn.test(e)&&(this.checked||!Mt.test(e))}).map(function(e,t){var n=ot(this).val();return null==n?null:ot.isArray(n)?ot.map(n,function(e){return{name:t.name,value:e.replace(Yn,"\r\n")}}):{name:t.name,value:n.replace(Yn,"\r\n")}}).get()}});ot.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&G()||$()}:G;var Zn=0,er={},tr=ot.ajaxSettings.xhr();t.ActiveXObject&&ot(t).on("unload",function(){for(var e in er)er[e](void 0,!0)});rt.cors=!!tr&&"withCredentials"in tr;tr=rt.ajax=!!tr;tr&&ot.ajaxTransport(function(e){if(!e.crossDomain||rt.cors){var t;return{send:function(n,r){var i,o=e.xhr(),a=++Zn;o.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType);e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null);t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState)){delete er[a];t=void 0;o.onreadystatechange=ot.noop;if(i)4!==o.readyState&&o.abort();else{u={};s=o.status;"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(c){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}}u&&r(s,l,u,o.getAllResponseHeaders())};e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=er[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}});ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){ot.globalEval(e);return e}}});ot.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1);if(e.crossDomain){e.type="GET";e.global=!1}});ot.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=gt.head||ot("head")[0]||gt.documentElement;return{send:function(r,i){t=gt.createElement("script");t.async=!0;e.scriptCharset&&(t.charset=e.scriptCharset);t.src=e.url;t.onload=t.onreadystatechange=function(e,n){if(n||!t.readyState||/loaded|complete/.test(t.readyState)){t.onload=t.onreadystatechange=null;t.parentNode&&t.parentNode.removeChild(t);t=null;n||i(200,"success")}};n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var nr=[],rr=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=nr.pop()||ot.expando+"_"+En++;this[e]=!0;return e}});ot.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,s=e.jsonp!==!1&&(rr.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&rr.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0]){i=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback;s?e[s]=e[s].replace(rr,"$1"+i):e.jsonp!==!1&&(e.url+=(jn.test(e.url)?"&":"?")+e.jsonp+"="+i);e.converters["script json"]=function(){a||ot.error(i+" was not called");return a[0]};e.dataTypes[0]="json";o=t[i];t[i]=function(){a=arguments};r.always(function(){t[i]=o;if(e[i]){e.jsonpCallback=n.jsonpCallback;nr.push(i)}a&&ot.isFunction(o)&&o(a[0]);a=o=void 0});return"script"}});ot.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;if("boolean"==typeof t){n=t;t=!1}t=t||gt;var r=dt.exec(e),i=!n&&[];if(r)return[t.createElement(r[1])];r=ot.buildFragment([e],t,i);i&&i.length&&ot(i).remove();return ot.merge([],r.childNodes)};var ir=ot.fn.load;ot.fn.load=function(e,t,n){if("string"!=typeof e&&ir)return ir.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");if(s>=0){r=ot.trim(e.slice(s,e.length));e=e.slice(0,s)}if(ot.isFunction(t)){n=t;t=void 0}else t&&"object"==typeof t&&(o="POST");a.length>0&&ot.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments;a.html(r?ot("<div>").append(ot.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])});return this};ot.expr.filters.animated=function(e){return ot.grep(ot.timers,function(t){return e===t.elem}).length};var or=t.document.documentElement;ot.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u,c=ot.css(e,"position"),f=ot(e),d={};"static"===c&&(e.style.position="relative");s=f.offset();o=ot.css(e,"top");l=ot.css(e,"left");u=("absolute"===c||"fixed"===c)&&ot.inArray("auto",[o,l])>-1;if(u){r=f.position();a=r.top;i=r.left}else{a=parseFloat(o)||0;i=parseFloat(l)||0}ot.isFunction(t)&&(t=t.call(e,n,s));null!=t.top&&(d.top=t.top-s.top+a);null!=t.left&&(d.left=t.left-s.left+i);"using"in t?t.using.call(e,d):f.css(d)}};ot.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ot.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o){t=o.documentElement;if(!ot.contains(t,i))return r;typeof i.getBoundingClientRect!==Tt&&(r=i.getBoundingClientRect());n=X(o);return{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}}},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0]; if("fixed"===ot.css(r,"position"))t=r.getBoundingClientRect();else{e=this.offsetParent();t=this.offset();ot.nodeName(e[0],"html")||(n=e.offset());n.top+=ot.css(e[0],"borderTopWidth",!0);n.left+=ot.css(e[0],"borderLeftWidth",!0)}return{top:t.top-n.top-ot.css(r,"marginTop",!0),left:t.left-n.left-ot.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||or;e&&!ot.nodeName(e,"html")&&"static"===ot.css(e,"position");)e=e.offsetParent;return e||or})}});ot.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);ot.fn[e]=function(r){return _t(this,function(e,r,i){var o=X(e);if(void 0===i)return o?t in o?o[t]:o.document.documentElement[r]:e[r];o?o.scrollTo(n?ot(o).scrollLeft():i,n?i:ot(o).scrollTop()):e[r]=i;return void 0},e,r,arguments.length,null)}});ot.each(["top","left"],function(e,t){ot.cssHooks[t]=L(rt.pixelPosition,function(e,n){if(n){n=nn(e,t);return on.test(n)?ot(e).position()[t]+"px":n}})});ot.each({Height:"height",Width:"width"},function(e,t){ot.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){ot.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return _t(this,function(t,n,r){var i;if(ot.isWindow(t))return t.document.documentElement["client"+e];if(9===t.nodeType){i=t.documentElement;return Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])}return void 0===r?ot.css(t,n,a):ot.style(t,n,r,a)},t,o?r:void 0,o,null)}})});ot.fn.size=function(){return this.length};ot.fn.andSelf=ot.fn.addBack;"function"==typeof e&&e.amd&&e("jquery",[],function(){return ot});var ar=t.jQuery,sr=t.$;ot.noConflict=function(e){t.$===ot&&(t.$=sr);e&&t.jQuery===ot&&(t.jQuery=ar);return ot};typeof n===Tt&&(t.jQuery=t.$=ot);return ot})},{}],13:[function(t,n){(function(t){function r(){try{return u in t&&t[u]}catch(e){return!1}}function i(e){return function(){var t=Array.prototype.slice.call(arguments,0);t.unshift(a);f.appendChild(a);a.addBehavior("#default#userData");a.load(u);var n=e.apply(s,t);f.removeChild(a);return n}}function o(e){return e.replace(/^d/,"___$&").replace(p,"___")}var a,s={},l=t.document,u="localStorage",c="script";s.disabled=!1;s.set=function(){};s.get=function(){};s.remove=function(){};s.clear=function(){};s.transact=function(e,t,n){var r=s.get(e);if(null==n){n=t;t=null}"undefined"==typeof r&&(r=t||{});n(r);s.set(e,r)};s.getAll=function(){};s.forEach=function(){};s.serialize=function(e){return JSON.stringify(e)};s.deserialize=function(e){if("string"!=typeof e)return void 0;try{return JSON.parse(e)}catch(t){return e||void 0}};if(r()){a=t[u];s.set=function(e,t){if(void 0===t)return s.remove(e);a.setItem(e,s.serialize(t));return t};s.get=function(e){return s.deserialize(a.getItem(e))};s.remove=function(e){a.removeItem(e)};s.clear=function(){a.clear()};s.getAll=function(){var e={};s.forEach(function(t,n){e[t]=n});return e};s.forEach=function(e){for(var t=0;t<a.length;t++){var n=a.key(t);e(n,s.get(n))}}}else if(l.documentElement.addBehavior){var f,d;try{d=new ActiveXObject("htmlfile");d.open();d.write("<"+c+">document.w=window</"+c+'><iframe src="/favicon.ico"></iframe>');d.close();f=d.w.frames[0].document;a=f.createElement("div")}catch(h){a=l.createElement("div");f=l.body}var p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");s.set=i(function(e,t,n){t=o(t);if(void 0===n)return s.remove(t);e.setAttribute(t,s.serialize(n));e.save(u);return n});s.get=i(function(e,t){t=o(t);return s.deserialize(e.getAttribute(t))});s.remove=i(function(e,t){t=o(t);e.removeAttribute(t);e.save(u)});s.clear=i(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(u);for(var n,r=0;n=t[r];r++)e.removeAttribute(n.name);e.save(u)});s.getAll=function(){var e={};s.forEach(function(t,n){e[t]=n});return e};s.forEach=i(function(e,t){for(var n,r=e.XMLDocument.documentElement.attributes,i=0;n=r[i];++i)t(n.name,s.deserialize(e.getAttribute(n.name)))})}try{var g="__storejs__";s.set(g,g);s.get(g)!=g&&(s.disabled=!0);s.remove(g)}catch(h){s.disabled=!0}s.enabled=!s.disabled;"undefined"!=typeof n&&n.exports&&this.module!==n?n.exports=s:"function"==typeof e&&e.amd?e(s):t.store=s})(Function("return this")())},{}],14:[function(e,t){t.exports={name:"yasgui-utils",version:"1.4.1",description:"Utils for YASGUI libs",main:"src/main.js",repository:{type:"git",url:"git://github.com/YASGUI/Utils.git"},licenses:[{type:"MIT",url:"http://yasgui.github.io/license.txt"}],author:{name:"Laurens Rietveld"},maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",url:"http://laurensrietveld.nl"}],bugs:{url:"https://github.com/YASGUI/Utils/issues"},homepage:"https://github.com/YASGUI/Utils",dependencies:{store:"^1.3.14"},readme:"A simple utils repo for the YASGUI tools\n",readmeFilename:"README.md",_id:"yasgui-utils@1.4.1",_from:"yasgui-utils@^1.4.1"}},{}],15:[function(e,t){window.console=window.console||{log:function(){}};t.exports={storage:e("./storage.js"),svg:e("./svg.js"),version:{"yasgui-utils":e("../package.json").version}}},{"../package.json":14,"./storage.js":16,"./svg.js":17}],16:[function(e,t){{var n=e("store"),r={day:function(){return 864e5},month:function(){30*r.day()},year:function(){12*r.month()}};t.exports={set:function(e,t,i){"string"==typeof i&&(i=r[i]());t.documentElement&&(t=(new XMLSerializer).serializeToString(t.documentElement));n.set(e,{val:t,exp:i,time:(new Date).getTime()})},get:function(e){var t=n.get(e);return t?t.exp&&(new Date).getTime()-t.time>t.exp?null:t.val:null}}}},{store:13}],17:[function(e,t){t.exports={draw:function(e,n,r){if(e){var i=t.exports.getElement(n,r);i&&(e.append?e.append(i):e.appendChild(i))}},getElement:function(e,t){if(e&&0==e.indexOf("<svg")){t.width||(t.width="100%");t.height||(t.height="100%");var n=new DOMParser,r=n.parseFromString(e,"text/xml"),i=r.documentElement,o=document.createElement("div");o.style.display="inline-block";o.style.width=t.width;o.style.height=t.height;o.appendChild(i);return o}return!1}}},{}],18:[function(e,t){t.exports={name:"yasgui-yasr",description:"Yet Another SPARQL Resultset GUI",version:"2.2.2",main:"src/main.js",licenses:[{type:"MIT",url:"http://yasr.yasgui.org/license.txt"}],author:"Laurens Rietveld",homepage:"http://yasr.yasgui.org",devDependencies:{browserify:"^6.1.0",gulp:"~3.6.0","gulp-bump":"^0.1.11","gulp-concat":"^2.4.1","gulp-connect":"^2.0.5","gulp-embedlr":"^0.5.2","gulp-filter":"^1.0.2","gulp-git":"^0.5.2","gulp-jsvalidate":"^0.2.0","gulp-livereload":"^1.3.1","gulp-minify-css":"^0.3.0","gulp-notify":"^1.2.5","gulp-rename":"^1.2.0","gulp-streamify":"0.0.5","gulp-tag-version":"^1.1.0","gulp-uglify":"^1.0.1","require-dir":"^0.1.0","run-sequence":"^1.0.1","vinyl-buffer":"^1.0.0","vinyl-source-stream":"~0.1.1",watchify:"^0.6.4","gulp-sourcemaps":"^1.2.8",exorcist:"^0.1.6","vinyl-transform":"0.0.1","gulp-sass":"^1.2.2","twitter-bootstrap-3.0.0":"^3.0.0","browserify-transform-tools":"^1.2.1"},bugs:"https://github.com/YASGUI/YASR/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"https://github.com/YASGUI/YASR.git"},dependencies:{jquery:"~ 1.11.0",codemirror:"^4.2.0","yasgui-utils":"^1.4.1",n3:"^0.3.4"},optionalShim:{codemirror:{require:"codemirror",global:"CodeMirror"},jquery:{require:"jquery",global:"jQuery"},"../../lib/codemirror":{require:"codemirror",global:"CodeMirror"},"../lib/DataTables/media/js/jquery.dataTables.js":{require:"jquery.dataTables",global:"jQuery"}}}},{}],19:[function(e,t){"use strict";t.exports=function(e){var t='"',n=",",r="\n",i=e.head.vars,o=e.results.bindings,a=function(){for(var e=0;e<i.length;e++)u(i[e]);csvString+=r},s=function(){for(var e=0;e<o.length;e++){l(o[e]);csvString+=r}},l=function(e){for(var t=0;t<i.length;t++){var n=i[t];u(e.hasOwnProperty(n)?e[n].value:"")}},u=function(e){e.replace(t,t+t);c(e)&&(e=t+e+t);csvString+=" "+e+" "+n},c=function(e){var r=!1;e.match("[\\w|"+n+"|"+t+"]")&&(r=!0);return r};csvString="";a();s();return csvString}},{}],20:[function(e,t){"use strict";var n=e("jquery"),r=t.exports=function(t){var r=n("<div class='booleanResult'></div>"),i=function(){r.empty().appendTo(t.resultsContainer);var i=t.results.getBoolean(),o=null,a=null;if(i===!0){o="check";a="True"}else if(i===!1){o="cross";a="False"}else{r.width("140");a="Could not find boolean value in response"}o&&e("yasgui-utils").svg.draw(r,e("./imgs.js")[o],{width:25,height:25});n("<span></span>").text(a).appendTo(r)},o=function(){return t.results.getBoolean()===!0||0==t.results.getBoolean()};return{name:null,draw:i,hideFromSelection:!0,getPriority:10,canHandleResults:o}};r.version={"YASR-boolean":e("../package.json").version,jquery:n.fn.jquery}},{"../package.json":18,"./imgs.js":23,jquery:12,"yasgui-utils":15}],21:[function(e,t){"use strict";var n=e("jquery");t.exports={output:"table",outputPlugins:["table","error","boolean","rawResponse"],drawOutputSelector:!0,drawDownloadIcon:!0,getUsedPrefixes:null,persistency:{outputSelector:function(e){return"selector_"+n(e.container).closest("[id]").attr("id")},results:{id:function(e){return"results_"+n(e.container).closest("[id]").attr("id")},maxSize:1e5}}}},{jquery:12}],22:[function(e,t){"use strict";var n=e("jquery"),r=t.exports=function(e){var t=n("<div class='errorResult'></div>"),i=(n.extend(!0,{},r.defaults),function(){t.empty().appendTo(e.resultsContainer);n("<span class='exception'>ERROR</span>").appendTo(t);n("<p></p>").html(e.results.getException()).appendTo(t)}),o=function(e){return e.results.getException()||!1};return{name:null,draw:i,getPriority:20,hideFromSelection:!0,canHandleResults:o}};r.defaults={}},{jquery:12}],23:[function(e,t){"use strict";t.exports={cross:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g> <path d="M83.288,88.13c-2.114,2.112-5.575,2.112-7.689,0L53.659,66.188c-2.114-2.112-5.573-2.112-7.687,0L24.251,87.907 c-2.113,2.114-5.571,2.114-7.686,0l-4.693-4.691c-2.114-2.114-2.114-5.573,0-7.688l21.719-21.721c2.113-2.114,2.113-5.573,0-7.686 L11.872,24.4c-2.114-2.113-2.114-5.571,0-7.686l4.842-4.842c2.113-2.114,5.571-2.114,7.686,0L46.12,33.591 c2.114,2.114,5.572,2.114,7.688,0l21.721-21.719c2.114-2.114,5.573-2.114,7.687,0l4.695,4.695c2.111,2.113,2.111,5.571-0.003,7.686 L66.188,45.973c-2.112,2.114-2.112,5.573,0,7.686L88.13,75.602c2.112,2.111,2.112,5.572,0,7.687L83.288,88.13z"/></g></svg>',check:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#000000" d="M14.301,49.982l22.606,17.047L84.361,4.903c2.614-3.733,7.76-4.64,11.493-2.026l0.627,0.462 c3.732,2.614,4.64,7.758,2.025,11.492l-51.783,79.77c-1.955,2.791-3.896,3.762-7.301,3.988c-3.405,0.225-5.464-1.039-7.508-3.084 L2.447,61.814c-3.263-3.262-3.263-8.553,0-11.814l0.041-0.019C5.75,46.718,11.039,46.718,14.301,49.982z"/></svg>',unsorted:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path7-9" d="m 8.8748339,52.571766 16.9382111,-0.222584 4.050851,-0.06665 15.719154,-0.222166 0.27778,-0.04246 0.43276,0.0017 0.41632,-0.06121 0.37532,-0.0611 0.47132,-0.119342 0.27767,-0.08206 0.55244,-0.198047 0.19707,-0.08043 0.61095,-0.259721 0.0988,-0.05825 0.019,-0.01914 0.59303,-0.356548 0.11787,-0.0788 0.49125,-0.337892 0.17994,-0.139779 0.37317,-0.336871 0.21862,-0.219786 0.31311,-0.31479 0.21993,-0.259387 c 0.92402,-1.126057 1.55249,-2.512251 1.78961,-4.016904 l 0.0573,-0.25754 0.0195,-0.374113 0.0179,-0.454719 0.0175,-0.05874 -0.0169,-0.258049 -0.0225,-0.493503 -0.0398,-0.355569 -0.0619,-0.414201 -0.098,-0.414812 -0.083,-0.353334 L 53.23955,41.1484 53.14185,40.850967 52.93977,40.377742 52.84157,40.161628 34.38021,4.2507375 C 33.211567,1.9401875 31.035446,0.48226552 28.639484,0.11316952 l -0.01843,-0.01834 -0.671963,-0.07882 -0.236871,0.0042 L 27.335984,-4.7826577e-7 27.220736,0.00379952 l -0.398804,0.0025 -0.313848,0.04043 -0.594474,0.07724 -0.09611,0.02147 C 23.424549,0.60716252 21.216017,2.1142355 20.013025,4.4296865 L 0.93967491,40.894479 c -2.08310801,3.997178 -0.588125,8.835482 3.35080799,10.819749 1.165535,0.613495 2.43199,0.88731 3.675026,0.864202 l 0.49845,-0.02325 0.410875,0.01658 z M 9.1502369,43.934401 9.0136999,43.910011 27.164145,9.2564625 44.70942,43.42818 l -14.765289,0.214677 -4.031106,0.0468 -16.7627881,0.244744 z" /></svg>',sortDesc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,0.12823506 0.09753,0.02006 c 2.39093,0.458209 4.599455,1.96811104 5.80244,4.28639004 L 52.785897,40.894525 c 2.088044,4.002139 0.590949,8.836902 -3.348692,10.821875 -1.329078,0.688721 -2.766603,0.943695 -4.133174,0.841768 l -0.454018,0.02 L 27.910392,52.354171 23.855313,52.281851 8.14393,52.061827 7.862608,52.021477 7.429856,52.021738 7.014241,51.959818 6.638216,51.900838 6.164776,51.779369 5.889216,51.699439 5.338907,51.500691 5.139719,51.419551 4.545064,51.145023 4.430618,51.105123 4.410168,51.084563 3.817138,50.730843 3.693615,50.647783 3.207314,50.310611 3.028071,50.174369 2.652795,49.833957 2.433471,49.613462 2.140099,49.318523 1.901127,49.041407 C 0.97781,47.916059 0.347935,46.528448 0.11153,45.021676 L 0.05352,44.766255 0.05172,44.371683 0.01894,43.936017 0,43.877277 0.01836,43.62206 0.03666,43.122889 0.0765,42.765905 0.13912,42.352413 0.23568,41.940425 0.32288,41.588517 0.481021,41.151945 0.579391,40.853806 0.77369,40.381268 0.876097,40.162336 19.338869,4.2542801 c 1.172169,-2.308419 3.34759,-3.76846504 5.740829,-4.17716604 l 0.01975,0.01985 0.69605,-0.09573 0.218437,0.0225 0.490791,-0.02132 0.39809,0.0046 0.315972,0.03973 0.594462,0.08149 z" /></svg>',sortAsc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,0.70898699,-0.70898699,-0.70522156,97.988199,58.704807)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,113.65778 0.09753,-0.0201 c 2.39093,-0.45821 4.599455,-1.96811 5.80244,-4.28639 L 52.785897,72.891487 c 2.088044,-4.002139 0.590949,-8.836902 -3.348692,-10.821875 -1.329078,-0.688721 -2.766603,-0.943695 -4.133174,-0.841768 l -0.454018,-0.02 -16.939621,0.223997 -4.055079,0.07232 -15.711383,0.220024 -0.281322,0.04035 -0.432752,-2.61e-4 -0.415615,0.06192 -0.376025,0.05898 -0.47344,0.121469 -0.27556,0.07993 -0.550309,0.198748 -0.199188,0.08114 -0.594655,0.274528 -0.114446,0.0399 -0.02045,0.02056 -0.59303,0.35372 -0.123523,0.08306 -0.486301,0.337172 -0.179243,0.136242 -0.375276,0.340412 -0.219324,0.220495 -0.293372,0.294939 -0.238972,0.277116 C 0.97781,65.869953 0.347935,67.257564 0.11153,68.764336 L 0.05352,69.019757 0.05172,69.414329 0.01894,69.849995 0,69.908735 l 0.01836,0.255217 0.0183,0.499171 0.03984,0.356984 0.06262,0.413492 0.09656,0.411988 0.0872,0.351908 0.158141,0.436572 0.09837,0.298139 0.194299,0.472538 0.102407,0.218932 18.462772,35.908054 c 1.172169,2.30842 3.34759,3.76847 5.740829,4.17717 l 0.01975,-0.0199 0.69605,0.0957 0.218437,-0.0225 0.490791,0.0213 0.39809,-0.005 0.315972,-0.0397 0.594462,-0.0815 z" /></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" xml:space="preserve"><g id="Captions"></g><g id="Your_Icon"> <path fill-rule="evenodd" fill="#000000" d="M88,84v-2c0-2.961-0.859-4-4-4H16c-2.961,0-4,0.98-4,4v2c0,3.102,1.039,4,4,4h68 C87.02,88,88,87.039,88,84z M58,12H42c-5,0-6,0.941-6,6v22H16l34,34l34-34H64V18C64,12.941,62.939,12,58,12z"/></g></svg>'}},{}],24:[function(e,t){"use strict";e("jquery"),t.exports=function(t){return e("./dlv.js")(t,",")}},{"./dlv.js":25,jquery:12}],25:[function(e,t){"use strict";var n=jQuery=e("jquery");e("../../lib/jquery.csv-0.71.js");t.exports=function(e,t){var r={},i=n.csv.toArrays(e,{separator:t}),o=function(e){return 0==e.indexOf("http")?"uri":null},a=function(){if(2==i.length&&1==i[0].length&&1==i[1].length&&"boolean"==i[0][0]&&("1"==i[1][0]||"0"==i[1][0])){r.boolean="1"==i[1][0]?!0:!1;return!0}return!1},s=function(){if(i.length>0&&i[0].length>0){r.head={vars:i[0]};return!0}return!1},l=function(){if(i.length>1){r.results={bindings:[]};for(var e=1;e<i.length;e++){for(var t={},n=0;n<i[e].length;n++){var a=r.head.vars[n];if(a){var s=i[e][n],l=o(s);t[a]={value:s};l&&(t[a].type=l)}}r.results.bindings.push(t)}r.head={vars:i[0]};return!0}return!1},u=a();if(!u){var c=s();c&&l()}return r}},{"../../lib/jquery.csv-0.71.js":3,jquery:12}],26:[function(e,t){"use strict";e("jquery"),t.exports=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return!1}return"object"==typeof e&&e.constructor==={}.constructor?e:!1}},{jquery:12}],27:[function(e,t){"use strict";e("jquery"),t.exports=function(t){return e("./dlv.js")(t," ")}},{"./dlv.js":25,jquery:12}],28:[function(e,t){"use strict";e("jquery"),t.exports=function(t){var n,r,i={xml:e("./xml.js"),json:e("./json.js"),tsv:e("./tsv.js"),csv:e("./csv.js")},o=null,a=null,s="object"==typeof t&&t.exception?t.exception:null;n="object"==typeof t&&t.contentType?t.contentType.toLowerCase():null;r="object"==typeof t&&t.response?t.response:t;var l=function(){if(o)return o;if(o===!1||s)return!1;var e=function(){if(n)if(n.indexOf("json")>-1){try{o=i.json(r)}catch(e){s=e}a="json"}else if(n.indexOf("xml")>-1){try{o=i.xml(r)}catch(e){s=e}a="xml"}else if(n.indexOf("csv")>-1){try{o=i.csv(r)}catch(e){s=e}a="csv"}else if(n.indexOf("tab-separated")>-1){try{o=i.tsv(r)}catch(e){s=e}a="tsv"}},t=function(){o=i.json(r);if(o)a="json";else try{o=i.xml(r);o&&(a="xml")}catch(e){}};e();o||t();o||(o=!1);return o},u=function(){var e=l();return e&&"head"in e?e.head.vars:null},c=function(){var e=l();return e&&"results"in e?e.results.bindings:null},f=function(){var e=l();return e&&"boolean"in e?e.boolean:null},d=function(){return r},h=function(){var e="";"string"==typeof r?e=r:"json"==a?e=JSON.stringify(r,void 0,2):"xml"==a&&(e=(new XMLSerializer).serializeToString(r));return e},p=function(){return s},g=function(){null==a&&l();return a};o=l();return{getAsJson:l,getOriginalResponse:d,getOriginalResponseAsString:h,getOriginalContentType:function(){return n},getVariables:u,getBindings:c,getBoolean:f,getType:g,getException:p}}},{"./csv.js":24,"./json.js":26,"./tsv.js":27,"./xml.js":29,jquery:12}],29:[function(e,t){"use strict";{var n=e("jquery");t.exports=function(e){var t=function(e){a.head={};for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if("variable"==n.nodeName){a.head.vars||(a.head.vars=[]);var r=n.getAttribute("name");r&&a.head.vars.push(r)}}},r=function(e){a.results={};a.results.bindings=[];for(var t=0;t<e.childNodes.length;t++){for(var n=e.childNodes[t],r=null,i=0;i<n.childNodes.length;i++){var o=n.childNodes[i];if("binding"==o.nodeName){var s=o.getAttribute("name");if(s){r=r||{};r[s]={};for(var l=0;l<o.childNodes.length;l++){var u=o.childNodes[l],c=u.nodeName;if("#text"!=c){r[s].type=c;r[s].value=u.innerHTML;var f=u.getAttribute("datatype");f&&(r[s].datatype=f)}}}}}r&&a.results.bindings.push(r)}},i=function(e){a.boolean="true"==e.innerHTML?!0:!1},o=null;"string"==typeof e?o=n.parseXML(e):n.isXMLDoc(e)&&(o=e);var e=null;if(!(o.childNodes.length>0))return null;e=o.childNodes[0];for(var a={},s=0;s<e.childNodes.length;s++){var l=e.childNodes[s];"head"==l.nodeName&&t(l);"results"==l.nodeName&&r(l);"boolean"==l.nodeName&&i(l)}return a}}},{jquery:12}],30:[function(e,t){"use strict";var n=e("jquery"),r=e("codemirror");e("codemirror/addon/fold/foldcode.js");e("codemirror/addon/fold/foldgutter.js");e("codemirror/addon/fold/xml-fold.js");e("codemirror/addon/fold/brace-fold.js");e("codemirror/addon/edit/matchbrackets.js");e("codemirror/mode/xml/xml.js");e("codemirror/mode/javascript/javascript.js");var i=t.exports=function(e){var t=n.extend(!0,{},i.defaults),o=null,a=function(){var n=t.CodeMirror;n.value=e.results.getOriginalResponseAsString();var i=e.results.getType();if(i){"json"==i&&(i={name:"javascript",json:!0});n.mode=i}o=r(e.resultsContainer.get()[0],n);o.on("fold",function(){o.refresh()});o.on("unfold",function(){o.refresh()})},s=function(){if(!e.results)return!1;var t=e.results.getOriginalResponseAsString();return t&&0!=t.length||!e.results.getException()?!0:!1},l=function(){if(!e.results)return null;var t=e.results.getOriginalContentType(),n=e.results.getType();return{getContent:function(){return e.results.getOriginalResponse()},filename:"queryResults"+(n?"."+n:""),contentType:t?t:"text/plain",buttonTitle:"Download raw response"}};return{draw:a,name:"Raw Response",canHandleResults:s,getPriority:2,getDownloadInfo:l}};i.defaults={CodeMirror:{readOnly:!0,lineNumbers:!0,lineWrapping:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]}};i.version={"YASR-rawResponse":e("../package.json").version,jquery:n.fn.jquery,CodeMirror:r.version}},{"../package.json":18,codemirror:9,"codemirror/addon/edit/matchbrackets.js":4,"codemirror/addon/fold/brace-fold.js":5,"codemirror/addon/fold/foldcode.js":6,"codemirror/addon/fold/foldgutter.js":7,"codemirror/addon/fold/xml-fold.js":8,"codemirror/mode/javascript/javascript.js":10,"codemirror/mode/xml/xml.js":11,jquery:12}],31:[function(e,t){"use strict";var n=e("jquery"),r=e("yasgui-utils"),i=e("./imgs.js");e("../lib/DataTables/media/js/jquery.dataTables.js");var o=t.exports=function(t){var a=null,s={name:"Table",getPriority:10},u=s.options=n.extend(!0,{},o.defaults),c=function(){var e=[],n=t.results.getBindings(),r=t.results.getVariables(),i=null;t.options.getUsedPrefixes&&(i="function"==typeof t.options.getUsedPrefixes?t.options.getUsedPrefixes(t):t.options.getUsedPrefixes);for(var o=0;o<n.length;o++){var a=[];a.push("");for(var l=n[o],c=0;c<r.length;c++){var f=r[c];a.push(f in l?u.getCellContent?u.getCellContent(t,s,l,f,{rowId:o,colId:c,usedPrefixes:i}):"":"")}e.push(a)}return e},f=function(){a.on("order.dt",function(){d()});u.persistency&&u.persistency.tableLength&&a.on("length.dt",function(e,n,i){var o="string"==typeof u.persistency.tableLength?u.persistency.tableLength:u.persistency.tableLength(t);r.storage.set(o,i,"month")});n.extend(!0,u.callbacks,u.handlers);a.delegate("td","click",function(e){if(u.callbacks&&u.callbacks.onCellClick){var t=u.callbacks.onCellClick(this,e);if(t===!1)return!1}}).delegate("td","mouseenter",function(e){u.callbacks&&u.callbacks.onCellMouseEnter&&u.callbacks.onCellMouseEnter(this,e);var t=n(this);u.fetchTitlesFromPreflabel&&void 0===t.attr("title")&&0==t.text().trim().indexOf("http")&&l(t)}).delegate("td","mouseleave",function(e){u.callbacks&&u.callbacks.onCellMouseLeave&&u.callbacks.onCellMouseLeave(this,e)})};s.draw=function(){a=n('<table cellpadding="0" cellspacing="0" border="0" class="resultsTable"></table>');n(t.resultsContainer).html(a);var e=u.datatable;e.data=c();e.columns=u.getColumns(t,s);if(u.persistency&&u.persistency.tableLength){var i="string"==typeof u.persistency.tableLength?u.persistency.tableLength:u.persistency.tableLength(t);e.pageLength=r.storage.get(i)}a.DataTable(n.extend(!0,{},e));d();f();var o=t.header.outerHeight()-5;o>0&&t.resultsContainer.find(".dataTables_wrapper").css("position","relative").css("top","-"+o+"px").css("margin-bottom","-"+o+"px")};var d=function(){var e={sorting:"unsorted",sorting_asc:"sortAsc",sorting_desc:"sortDesc"};a.find(".sortIcons").remove();var t=8,o=13;for(var s in e){var l=n("<div class='sortIcons'></div>").css("float","right").css("margin-right","-12px").width(t).height(o);r.svg.draw(l,i[e[s]],{width:t+2,height:o+1});a.find("th."+s).append(l)}};s.canHandleResults=function(){return t.results&&t.results.getVariables()&&t.results.getVariables().length>0};s.getDownloadInfo=function(){return t.results?{getContent:function(){return e("./bindingsToCsv.js")(t.results.getAsJson())},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:null};return s},a=function(e,t,n){var r=n.value;if(n["xml:lang"])r='"'+n.value+'"@'+n["xml:lang"];else if(n.datatype){var i="http://www.w3.org/2001/XMLSchema#",o=n.datatype;o=0==o.indexOf(i)?"xsd:"+o.substring(i.length):"<"+o+">";r='"'+r+'"^^'+o}return r},s=function(e,t,n,r,i){var o=n[r],s=null;if("uri"==o.type){var l=null,u=o.value,c=u;if(i.usedPrefixes)for(var f in i.usedPrefixes)if(0==c.indexOf(i.usedPrefixes[f])){c=f+u.substring(i.usedPrefixes[f].length);break}if(t.options.mergeLabelsWithUris){var d="string"==typeof t.options.mergeLabelsWithUris?t.options.mergeLabelsWithUris:"Label";if(n[r+d]){c=a(e,t,n[r+d]);l=u}}s="<a "+(l?"title='"+u+"' ":"")+"class='uri' target='_blank' href='"+u+"'>"+c+"</a>"}else s="<span class='nonUri'>"+a(e,t,o)+"</span>";return s},l=function(e){var t=function(){e.attr("title","")};n.get("http://preflabel.org/api/v1/label/"+encodeURIComponent(e.text())+"?silent=true").success(function(n){"object"==typeof n&&n.label?e.attr("title",n.label):"string"==typeof n&&n.length>0?e.attr("title",n):t()}).fail(t)};o.defaults={getCellContent:s,persistency:{tableLength:function(e){return"tableLength_"+n(e.container).closest("[id]").attr("id")}},getColumns:function(e,t){var n=function(n){if(!t.options.mergeLabelsWithUris)return!0;var r="string"==typeof t.options.mergeLabelsWithUris?t.options.mergeLabelsWithUris:"Label";return-1!==n.indexOf(r,n.length-r.length)&&e.results.getVariables().indexOf(n.substring(0,n.length-r.length))>=0?!1:!0},r=[];r.push({title:""});e.results.getVariables().forEach(function(e){r.push({title:e,visible:n(e)})});return r},fetchTitlesFromPreflabel:!0,mergeLabelsWithUris:!1,callbacks:{onCellMouseEnter:null,onCellMouseLeave:null,onCellClick:null},datatable:{order:[],pageLength:50,lengthMenu:[[10,50,100,1e3,-1],[10,50,100,1e3,"All"]],lengthChange:!0,pagingType:"full_numbers",drawCallback:function(e){for(var t=0;t<e.aiDisplay.length;t++)n("td:eq(0)",e.aoData[e.aiDisplay[t]].nTr).html(t+1);var r=!1;n(e.nTableWrapper).find(".paginate_button").each(function(){-1==n(this).attr("class").indexOf("current")&&-1==n(this).attr("class").indexOf("disabled")&&(r=!0)});r?n(e.nTableWrapper).find(".dataTables_paginate").show():n(e.nTableWrapper).find(".dataTables_paginate").hide()},columnDefs:[{width:"12px",orderable:!1,targets:0}]}};o.version={"YASR-table":e("../package.json").version,jquery:n.fn.jquery,"jquery-datatables":n.fn.DataTable.version}},{"../lib/DataTables/media/js/jquery.dataTables.js":2,"../package.json":18,"./bindingsToCsv.js":19,"./imgs.js":23,jquery:12,"yasgui-utils":15}]},{},[1])(1)}); //# sourceMappingURL=yasr.bundled.min.js.map
ajax/libs/yui/3.11.0/simpleyui/simpleyui-debug.js
janpaepke/cdnjs
/** The YUI module contains the components required for building the YUI seed file. This includes the script loading mechanism, a simple queue, and the core utilities for the library. @module yui @main yui @submodule yui-base **/ /*jshint eqeqeq: false*/ if (typeof YUI != 'undefined') { YUI._YUI = YUI; } /** The YUI global namespace object. This is the constructor for all YUI instances. This is a self-instantiable factory function, meaning you don't need to precede it with the `new` operator. You can invoke it directly like this: YUI().use('*', function (Y) { // Y is a new YUI instance. }); But it also works like this: var Y = YUI(); The `YUI` constructor accepts an optional config object, like this: YUI({ debug: true, combine: false }).use('node', function (Y) { // Y.Node is ready to use. }); See the API docs for the <a href="config.html">Config</a> class for the complete list of supported configuration properties accepted by the YUI constuctor. If a global `YUI` object is already defined, the existing YUI object will not be overwritten, to ensure that defined namespaces are preserved. Each YUI instance has full custom event support, but only if the event system is available. @class YUI @uses EventTarget @constructor @global @param {Object} [config]* Zero or more optional configuration objects. Config values are stored in the `Y.config` property. See the <a href="config.html">Config</a> docs for the list of supported properties. **/ /*global YUI*/ /*global YUI_config*/ var YUI = function() { var i = 0, Y = this, args = arguments, l = args.length, instanceOf = function(o, type) { return (o && o.hasOwnProperty && (o instanceof type)); }, gconf = (typeof YUI_config !== 'undefined') && YUI_config; if (!(instanceOf(Y, YUI))) { Y = new YUI(); } else { // set up the core environment Y._init(); /** Master configuration that might span multiple contexts in a non- browser environment. It is applied first to all instances in all contexts. @example YUI.GlobalConfig = { filter: 'debug' }; YUI().use('node', function (Y) { // debug files used here }); YUI({ filter: 'min' }).use('node', function (Y) { // min files used here }); @property {Object} GlobalConfig @global @static **/ if (YUI.GlobalConfig) { Y.applyConfig(YUI.GlobalConfig); } /** Page-level config applied to all YUI instances created on the current page. This is applied after `YUI.GlobalConfig` and before any instance-level configuration. @example // Single global var to include before YUI seed file YUI_config = { filter: 'debug' }; YUI().use('node', function (Y) { // debug files used here }); YUI({ filter: 'min' }).use('node', function (Y) { // min files used here }); @property {Object} YUI_config @global **/ if (gconf) { Y.applyConfig(gconf); } // bind the specified additional modules for this instance if (!l) { Y._setup(); } } if (l) { // Each instance can accept one or more configuration objects. // These are applied after YUI.GlobalConfig and YUI_Config, // overriding values set in those config files if there is a // matching property. for (; i < l; i++) { Y.applyConfig(args[i]); } Y._setup(); } Y.instanceOf = instanceOf; return Y; }; (function() { var proto, prop, VERSION = '@VERSION@', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /* These CSS class names can't be generated by getClassName since it is not available at the time they are being used. */ DOC_LABEL = 'yui3-js-enabled', CSS_STAMP_EL = 'yui3-css-stamp', NOOP = function() {}, SLICE = Array.prototype.slice, APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo 'io.xdrResponse': 1, // can call. this should 'SWF.eventHandler': 1 }, // be done at build time hasWin = (typeof window != 'undefined'), win = (hasWin) ? window : null, doc = (hasWin) ? win.document : null, docEl = doc && doc.documentElement, docClass = docEl && docEl.className, instances = {}, time = new Date().getTime(), add = function(el, type, fn, capture) { if (el && el.addEventListener) { el.addEventListener(type, fn, capture); } else if (el && el.attachEvent) { el.attachEvent('on' + type, fn); } }, remove = function(el, type, fn, capture) { if (el && el.removeEventListener) { // this can throw an uncaught exception in FF try { el.removeEventListener(type, fn, capture); } catch (ex) {} } else if (el && el.detachEvent) { el.detachEvent('on' + type, fn); } }, handleLoad = function() { YUI.Env.windowLoaded = true; YUI.Env.DOMReady = true; if (hasWin) { remove(window, 'load', handleLoad); } }, getLoader = function(Y, o) { var loader = Y.Env._loader, lCore = [ 'loader-base' ], G_ENV = YUI.Env, mods = G_ENV.mods; if (loader) { //loader._config(Y.config); loader.ignoreRegistered = false; loader.onEnd = null; loader.data = null; loader.required = []; loader.loadType = null; } else { loader = new Y.Loader(Y.config); Y.Env._loader = loader; } if (mods && mods.loader) { lCore = [].concat(lCore, YUI.Env.loaderExtras); } YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore)); return loader; }, clobber = function(r, s) { for (var i in s) { if (s.hasOwnProperty(i)) { r[i] = s[i]; } } }, ALREADY_DONE = { success: true }; // Stamp the documentElement (HTML) with a class of "yui-loaded" to // enable styles that need to key off of JS being enabled. if (docEl && docClass.indexOf(DOC_LABEL) == -1) { if (docClass) { docClass += ' '; } docClass += DOC_LABEL; docEl.className = docClass; } if (VERSION.indexOf('@') > -1) { VERSION = '3.5.0'; // dev time hack for cdn test } proto = { /** Applies a new configuration object to the config of this YUI instance. This will merge new group/module definitions, and will also update the loader cache if necessary. Updating `Y.config` directly will not update the cache. @method applyConfig @param {Object} o the configuration object. @since 3.2.0 **/ applyConfig: function(o) { o = o || NOOP; var attr, name, // detail, config = this.config, mods = config.modules, groups = config.groups, aliases = config.aliases, loader = this.Env._loader; for (name in o) { if (o.hasOwnProperty(name)) { attr = o[name]; if (mods && name == 'modules') { clobber(mods, attr); } else if (aliases && name == 'aliases') { clobber(aliases, attr); } else if (groups && name == 'groups') { clobber(groups, attr); } else if (name == 'win') { config[name] = (attr && attr.contentWindow) || attr; config.doc = config[name] ? config[name].document : null; } else if (name == '_yuid') { // preserve the guid } else { config[name] = attr; } } } if (loader) { loader._config(o); } }, /** Old way to apply a config to this instance (calls `applyConfig` under the hood). @private @method _config @param {Object} o The config to apply **/ _config: function(o) { this.applyConfig(o); }, /** Initializes this YUI instance. @private @method _init **/ _init: function() { var filter, el, Y = this, G_ENV = YUI.Env, Env = Y.Env, prop; /** The version number of this YUI instance. This value is typically updated by a script when a YUI release is built, so it may not reflect the correct version number when YUI is run from the development source tree. @property {String} version **/ Y.version = VERSION; if (!Env) { Y.Env = { core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later'], loaderExtras: ['loader-rollup', 'loader-yui3'], mods: {}, // flat module map versions: {}, // version module map base: BASE, cdn: BASE + VERSION + '/build/', // bootstrapped: false, _idx: 0, _used: {}, _attached: {}, _missed: [], _yidx: 0, _uidx: 0, _guidp: 'y', _loaded: {}, // serviced: {}, // Regex in English: // I'll start at the \b(simpleyui). // 1. Look in the test string for "simpleyui" or "yui" or // "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break. That is, it // can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string. // 2. After #1 must come a forward slash followed by the string matched in #1, so // "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants". // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min", // so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt". // 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js" // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string, // then capture the junk between the LAST "&" and the string in 1-4. So // "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js" // will capture "3.3.0/build/" // // Regex Exploded: // (?:\? Find a ? // (?:[^&]*&) followed by 0..n characters followed by an & // * in fact, find as many sets of characters followed by a & as you can // ([^&]*) capture the stuff after the last & in \1 // )? but it's ok if all this ?junk&more_junk stuff isn't even there // \b(simpleyui| after a word break find either the string "simpleyui" or // yui(?:-\w+)? the string "yui" optionally followed by a -, then more characters // ) and store the simpleyui or yui-* string in \2 // \/\2 then comes a / followed by the simpleyui or yui-* string in \2 // (?:-(min|debug))? optionally followed by "-min" or "-debug" // .js and ending in ".js" _BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/, parseBasePath: function(src, pattern) { var match = src.match(pattern), path, filter; if (match) { path = RegExp.leftContext || src.slice(0, src.indexOf(match[0])); // this is to set up the path to the loader. The file // filter for loader should match the yui include. filter = match[3]; // extract correct path for mixed combo urls // http://yuilibrary.com/projects/yui3/ticket/2528423 if (match[1]) { path += '?' + match[1]; } path = { filter: filter, path: path }; } return path; }, getBase: G_ENV && G_ENV.getBase || function(pattern) { var nodes = (doc && doc.getElementsByTagName('script')) || [], path = Env.cdn, parsed, i, len, src; for (i = 0, len = nodes.length; i < len; ++i) { src = nodes[i].src; if (src) { parsed = Y.Env.parseBasePath(src, pattern); if (parsed) { filter = parsed.filter; path = parsed.path; break; } } } // use CDN default return path; } }; Env = Y.Env; Env._loaded[VERSION] = {}; if (G_ENV && Y !== YUI) { Env._yidx = ++G_ENV._yidx; Env._guidp = ('yui_' + VERSION + '_' + Env._yidx + '_' + time).replace(/[^a-z0-9_]+/g, '_'); } else if (YUI._YUI) { G_ENV = YUI._YUI.Env; Env._yidx += G_ENV._yidx; Env._uidx += G_ENV._uidx; for (prop in G_ENV) { if (!(prop in Env)) { Env[prop] = G_ENV[prop]; } } delete YUI._YUI; } Y.id = Y.stamp(Y); instances[Y.id] = Y; } Y.constructor = YUI; // configuration defaults Y.config = Y.config || { bootstrap: true, cacheUse: true, debug: true, doc: doc, fetchCSS: true, throwFail: true, useBrowserConsole: true, useNativeES5: true, win: win, global: Function('return this')() }; //Register the CSS stamp element if (doc && !doc.getElementById(CSS_STAMP_EL)) { el = doc.createElement('div'); el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>'; YUI.Env.cssStampEl = el.firstChild; if (doc.body) { doc.body.appendChild(YUI.Env.cssStampEl); } else { docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild); } } else if (doc && doc.getElementById(CSS_STAMP_EL) && !YUI.Env.cssStampEl) { YUI.Env.cssStampEl = doc.getElementById(CSS_STAMP_EL); } Y.config.lang = Y.config.lang || 'en-US'; Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE); if (!filter || (!('mindebug').indexOf(filter))) { filter = 'min'; } filter = (filter) ? '-' + filter : filter; Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js'; }, /** Finishes the instance setup. Attaches whatever YUI modules were defined at the time that this instance was created. @method _setup @private **/ _setup: function() { var i, Y = this, core = [], mods = YUI.Env.mods, extras = Y.config.core || [].concat(YUI.Env.core); //Clone it.. for (i = 0; i < extras.length; i++) { if (mods[extras[i]]) { core.push(extras[i]); } } Y._attach(['yui-base']); Y._attach(core); if (Y.Loader) { getLoader(Y); } // Y.log(Y.id + ' initialized', 'info', 'yui'); }, /** Executes the named method on the specified YUI instance if that method is whitelisted. @method applyTo @param {String} id YUI instance id. @param {String} method Name of the method to execute. For example: 'Object.keys'. @param {Array} args Arguments to apply to the method. @return {Mixed} Return value from the applied method, or `null` if the specified instance was not found or the method was not whitelisted. **/ applyTo: function(id, method, args) { if (!(method in APPLY_TO_AUTH)) { this.log(method + ': applyTo not allowed', 'warn', 'yui'); return null; } var instance = instances[id], nest, m, i; if (instance) { nest = method.split('.'); m = instance; for (i = 0; i < nest.length; i = i + 1) { m = m[nest[i]]; if (!m) { this.log('applyTo not found: ' + method, 'warn', 'yui'); } } return m && m.apply(instance, args); } return null; }, /** Registers a YUI module and makes it available for use in a `YUI().use()` call or as a dependency for other modules. The easiest way to create a first-class YUI module is to use <a href="http://yui.github.com/shifter/">Shifter</a>, the YUI component build tool. Shifter will automatically wrap your module code in a `YUI.add()` call along with any configuration info required for the module. @example YUI.add('davglass', function (Y) { Y.davglass = function () { Y.log('Dav was here!'); }; }, '3.4.0', { requires: ['harley-davidson', 'mt-dew'] }); @method add @param {String} name Module name. @param {Function} fn Function containing module code. This function will be executed whenever the module is attached to a specific YUI instance. @param {YUI} fn.Y The YUI instance to which this module is attached. @param {String} fn.name Name of the module @param {String} version Module version number. This is currently used only for informational purposes, and is not used internally by YUI. @param {Object} [config] Module config. @param {Array} [config.requires] Array of other module names that must be attached before this module can be attached. @param {Array} [config.optional] Array of optional module names that should be attached before this module is attached if they've already been loaded. If the `loadOptional` YUI option is `true`, optional modules that have not yet been loaded will be loaded just as if they were hard requirements. @param {Array} [config.use] Array of module names that are included within or otherwise provided by this module, and which should be attached automatically when this module is attached. This makes it possible to create "virtual rollup" modules that simply attach a collection of other modules or submodules. @return {YUI} This YUI instance. **/ add: function(name, fn, version, details) { details = details || {}; var env = YUI.Env, mod = { name: name, fn: fn, version: version, details: details }, //Instance hash so we don't apply it to the same instance twice applied = {}, loader, inst, i, versions = env.versions; env.mods[name] = mod; versions[version] = versions[version] || {}; versions[version][name] = mod; for (i in instances) { if (instances.hasOwnProperty(i)) { inst = instances[i]; if (!applied[inst.id]) { applied[inst.id] = true; loader = inst.Env._loader; if (loader) { if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) { loader.addModule(details, name); } } } } } return this; }, /** Executes the callback function associated with each required module, attaching the module to this YUI instance. @method _attach @param {Array} r The array of modules to attach @param {Boolean} [moot=false] If `true`, don't throw a warning if the module is not attached. @private **/ _attach: function(r, moot) { var i, name, mod, details, req, use, after, mods = YUI.Env.mods, aliases = YUI.Env.aliases, Y = this, j, cache = YUI.Env._renderedMods, loader = Y.Env._loader, done = Y.Env._attached, len = r.length, loader, def, go, c = []; //Check for conditional modules (in a second+ instance) and add their requirements //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass for (i = 0; i < len; i++) { name = r[i]; mod = mods[name]; c.push(name); if (loader && loader.conditions[name]) { for (j in loader.conditions[name]) { if (loader.conditions[name].hasOwnProperty(j)) { def = loader.conditions[name][j]; go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y))); if (go) { c.push(def.name); } } } } } r = c; len = r.length; for (i = 0; i < len; i++) { if (!done[r[i]]) { name = r[i]; mod = mods[name]; if (aliases && aliases[name] && !mod) { Y._attach(aliases[name]); continue; } if (!mod) { if (loader && loader.moduleInfo[name]) { mod = loader.moduleInfo[name]; moot = true; } // Y.log('no js def for: ' + name, 'info', 'yui'); //if (!loader || !loader.moduleInfo[name]) { //if ((!loader || !loader.moduleInfo[name]) && !moot) { if (!moot && name) { if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) { Y.Env._missed.push(name); Y.Env._missed = Y.Array.dedupe(Y.Env._missed); Y.message('NOT loaded: ' + name, 'warn', 'yui'); } } } else { done[name] = true; //Don't like this, but in case a mod was asked for once, then we fetch it //We need to remove it from the missed list ^davglass for (j = 0; j < Y.Env._missed.length; j++) { if (Y.Env._missed[j] === name) { Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui'); Y.Env._missed.splice(j, 1); } } /* If it's a temp module, we need to redo it's requirements if it's already loaded since it may have been loaded by another instance and it's dependencies might have been redefined inside the fetched file. */ if (loader && cache && cache[name] && cache[name].temp) { loader.getRequires(cache[name]); req = []; for (j in loader.moduleInfo[name].expanded_map) { if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) { req.push(j); } } Y._attach(req); } details = mod.details; req = details.requires; use = details.use; after = details.after; //Force Intl load if there is a language (Loader logic) @todo fix this shit if (details.lang) { req = req || []; req.unshift('intl'); } if (req) { for (j = 0; j < req.length; j++) { if (!done[req[j]]) { if (!Y._attach(req)) { return false; } break; } } } if (after) { for (j = 0; j < after.length; j++) { if (!done[after[j]]) { if (!Y._attach(after, true)) { return false; } break; } } } if (mod.fn) { if (Y.config.throwFail) { mod.fn(Y, name); } else { try { mod.fn(Y, name); } catch (e) { Y.error('Attach error: ' + name, e, name); return false; } } } if (use) { for (j = 0; j < use.length; j++) { if (!done[use[j]]) { if (!Y._attach(use)) { return false; } break; } } } } } } return true; }, /** Delays the `use` callback until another event has taken place such as `window.onload`, `domready`, `contentready`, or `available`. @private @method _delayCallback @param {Function} cb The original `use` callback. @param {String|Object} until Either an event name ('load', 'domready', etc.) or an object containing event/args keys for contentready/available. @return {Function} **/ _delayCallback: function(cb, until) { var Y = this, mod = ['event-base']; until = (Y.Lang.isObject(until) ? until : { event: until }); if (until.event === 'load') { mod.push('event-synthetic'); } Y.log('Delaying use callback until: ' + until.event, 'info', 'yui'); return function() { Y.log('Use callback fired, waiting on delay', 'info', 'yui'); var args = arguments; Y._use(mod, function() { Y.log('Delayed use wrapper callback after dependencies', 'info', 'yui'); Y.on(until.event, function() { args[1].delayUntil = until.event; Y.log('Delayed use callback done after ' + until.event, 'info', 'yui'); cb.apply(Y, args); }, until.args); }); }; }, /** Attaches one or more modules to this YUI instance. When this is executed, the requirements of the desired modules are analyzed, and one of several things can happen: * All required modules have already been loaded, and just need to be attached to this YUI instance. In this case, the `use()` callback will be executed synchronously after the modules are attached. * One or more modules have not yet been loaded, or the Get utility is not available, or the `bootstrap` config option is `false`. In this case, a warning is issued indicating that modules are missing, but all available modules will still be attached and the `use()` callback will be executed synchronously. * One or more modules are missing and the Loader is not available but the Get utility is, and `bootstrap` is not `false`. In this case, the Get utility will be used to load the Loader, and we will then proceed to the following state: * One or more modules are missing and the Loader is available. In this case, the Loader will be used to resolve the dependency tree for the missing modules and load them and their dependencies. When the Loader is finished loading modules, the `use()` callback will be executed asynchronously. @example // Loads and attaches dd and its dependencies. YUI().use('dd', function (Y) { // ... }); // Loads and attaches dd and node as well as all of their dependencies. YUI().use(['dd', 'node'], function (Y) { // ... }); // Attaches all modules that have already been loaded. YUI().use('*', function (Y) { // ... }); // Attaches a gallery module. YUI().use('gallery-yql', function (Y) { // ... }); // Attaches a YUI 2in3 module. YUI().use('yui2-datatable', function (Y) { // ... }); @method use @param {String|Array} modules* One or more module names to attach. @param {Function} [callback] Callback function to be executed once all specified modules and their dependencies have been attached. @param {YUI} callback.Y The YUI instance created for this sandbox. @param {Object} callback.status Object containing `success`, `msg` and `data` properties. @chainable **/ use: function() { var args = SLICE.call(arguments, 0), callback = args[args.length - 1], Y = this, i = 0, name, Env = Y.Env, provisioned = true; // The last argument supplied to use can be a load complete callback if (Y.Lang.isFunction(callback)) { args.pop(); if (Y.config.delayUntil) { callback = Y._delayCallback(callback, Y.config.delayUntil); } } else { callback = null; } if (Y.Lang.isArray(args[0])) { args = args[0]; } if (Y.config.cacheUse) { while ((name = args[i++])) { if (!Env._attached[name]) { provisioned = false; break; } } if (provisioned) { if (args.length) { Y.log('already provisioned: ' + args, 'info', 'yui'); } Y._notify(callback, ALREADY_DONE, args); return Y; } } if (Y._loading) { Y._useQueue = Y._useQueue || new Y.Queue(); Y._useQueue.add([args, callback]); } else { Y._use(args, function(Y, response) { Y._notify(callback, response, args); }); } return Y; }, /** Handles Loader notifications about attachment/load errors. @method _notify @param {Function} callback Callback to pass to `Y.config.loadErrorFn`. @param {Object} response Response returned from Loader. @param {Array} args Arguments passed from Loader. @private **/ _notify: function(callback, response, args) { if (!response.success && this.config.loadErrorFn) { this.config.loadErrorFn.call(this, this, callback, response, args); } else if (callback) { if (this.Env._missed && this.Env._missed.length) { response.msg = 'Missing modules: ' + this.Env._missed.join(); response.success = false; } if (this.config.throwFail) { callback(this, response); } else { try { callback(this, response); } catch (e) { this.error('use callback error', e, args); } } } }, /** Called from the `use` method queue to ensure that only one set of loading logic is performed at a time. @method _use @param {String} args* One or more modules to attach. @param {Function} [callback] Function to call once all required modules have been attached. @private **/ _use: function(args, callback) { if (!this.Array) { this._attach(['yui-base']); } var len, loader, handleBoot, Y = this, G_ENV = YUI.Env, mods = G_ENV.mods, Env = Y.Env, used = Env._used, aliases = G_ENV.aliases, queue = G_ENV._loaderQueue, firstArg = args[0], YArray = Y.Array, config = Y.config, boot = config.bootstrap, missing = [], i, r = [], ret = true, fetchCSS = config.fetchCSS, process = function(names, skip) { var i = 0, a = [], name, len, m, req, use; if (!names.length) { return; } if (aliases) { len = names.length; for (i = 0; i < len; i++) { if (aliases[names[i]] && !mods[names[i]]) { a = [].concat(a, aliases[names[i]]); } else { a.push(names[i]); } } names = a; } len = names.length; for (i = 0; i < len; i++) { name = names[i]; if (!skip) { r.push(name); } // only attach a module once if (used[name]) { continue; } m = mods[name]; req = null; use = null; if (m) { used[name] = true; req = m.details.requires; use = m.details.use; } else { // CSS files don't register themselves, see if it has // been loaded if (!G_ENV._loaded[VERSION][name]) { missing.push(name); } else { used[name] = true; // probably css } } // make sure requirements are attached if (req && req.length) { process(req); } // make sure we grab the submodule dependencies too if (use && use.length) { process(use, 1); } } }, handleLoader = function(fromLoader) { var response = fromLoader || { success: true, msg: 'not dynamic' }, redo, origMissing, ret = true, data = response.data; Y._loading = false; if (data) { origMissing = missing; missing = []; r = []; process(data); redo = missing.length; if (redo) { if ([].concat(missing).sort().join() == origMissing.sort().join()) { redo = false; } } } if (redo && data) { Y._loading = true; Y._use(missing, function() { Y.log('Nested use callback: ' + data, 'info', 'yui'); if (Y._attach(data)) { Y._notify(callback, response, data); } }); } else { if (data) { // Y.log('attaching from loader: ' + data, 'info', 'yui'); ret = Y._attach(data); } if (ret) { Y._notify(callback, response, args); } } if (Y._useQueue && Y._useQueue.size() && !Y._loading) { Y._use.apply(Y, Y._useQueue.next()); } }; // Y.log(Y.id + ': use called: ' + a + ' :: ' + callback, 'info', 'yui'); // YUI().use('*'); // bind everything available if (firstArg === '*') { args = []; for (i in mods) { if (mods.hasOwnProperty(i)) { args.push(i); } } ret = Y._attach(args); if (ret) { handleLoader(); } return Y; } if ((mods.loader || mods['loader-base']) && !Y.Loader) { Y.log('Loader was found in meta, but it is not attached. Attaching..', 'info', 'yui'); Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]); } // Y.log('before loader requirements: ' + args, 'info', 'yui'); // use loader to expand dependencies and sort the // requirements if it is available. if (boot && Y.Loader && args.length) { Y.log('Using loader to expand dependencies', 'info', 'yui'); loader = getLoader(Y); loader.require(args); loader.ignoreRegistered = true; loader._boot = true; loader.calculate(null, (fetchCSS) ? null : 'js'); args = loader.sorted; loader._boot = false; } process(args); len = missing.length; if (len) { missing = YArray.dedupe(missing); len = missing.length; Y.log('Modules missing: ' + missing + ', ' + missing.length, 'info', 'yui'); } // dynamic load if (boot && len && Y.Loader) { // Y.log('Using loader to fetch missing deps: ' + missing, 'info', 'yui'); Y.log('Using Loader', 'info', 'yui'); Y._loading = true; loader = getLoader(Y); loader.onEnd = handleLoader; loader.context = Y; loader.data = args; loader.ignoreRegistered = false; loader.require(missing); loader.insert(null, (fetchCSS) ? null : 'js'); } else if (boot && len && Y.Get && !Env.bootstrapped) { Y._loading = true; handleBoot = function() { Y._loading = false; queue.running = false; Env.bootstrapped = true; G_ENV._bootstrapping = false; if (Y._attach(['loader'])) { Y._use(args, callback); } }; if (G_ENV._bootstrapping) { Y.log('Waiting for loader', 'info', 'yui'); queue.add(handleBoot); } else { G_ENV._bootstrapping = true; Y.log('Fetching loader: ' + config.base + config.loaderPath, 'info', 'yui'); Y.Get.script(config.base + config.loaderPath, { onEnd: handleBoot }); } } else { Y.log('Attaching available dependencies: ' + args, 'info', 'yui'); ret = Y._attach(args); if (ret) { handleLoader(); } } return Y; }, /** Utility method for safely creating namespaces if they don't already exist. May be called statically on the YUI global object or as a method on a YUI instance. When called statically, a namespace will be created on the YUI global object: // Create `YUI.your.namespace.here` as nested objects, preserving any // objects that already exist instead of overwriting them. YUI.namespace('your.namespace.here'); When called as a method on a YUI instance, a namespace will be created on that instance: // Creates `Y.property.package`. Y.namespace('property.package'); Dots in the input string cause `namespace` to create nested objects for each token. If any part of the requested namespace already exists, the current object will be left in place and will not be overwritten. This allows multiple calls to `namespace` to preserve existing namespaced properties. If the first token in the namespace string is "YAHOO", that token is discarded. This is legacy behavior for backwards compatibility with YUI 2. Be careful with namespace tokens. Reserved words may work in some browsers and not others. For instance, the following will fail in some browsers because the supported version of JavaScript reserves the word "long": Y.namespace('really.long.nested.namespace'); Note: If you pass multiple arguments to create multiple namespaces, only the last one created is returned from this function. @method namespace @param {String} namespace* One or more namespaces to create. @return {Object} Reference to the last namespace object created. **/ namespace: function() { var a = arguments, o, i = 0, j, d, arg; for (; i < a.length; i++) { o = this; //Reset base object per argument or it will get reused from the last arg = a[i]; if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present d = arg.split(PERIOD); for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) { o[d[j]] = o[d[j]] || {}; o = o[d[j]]; } } else { o[arg] = o[arg] || {}; o = o[arg]; //Reset base object to the new object so it's returned } } return o; }, // this is replaced if the log module is included log: NOOP, message: NOOP, // this is replaced if the dump module is included dump: function (o) { return ''+o; }, /** Reports an error. The reporting mechanism is controlled by the `throwFail` configuration attribute. If `throwFail` is falsy, the message is logged. If `throwFail` is truthy, a JS exception is thrown. If an `errorFn` is specified in the config it must return `true` to indicate that the exception was handled and keep it from being thrown. @method error @param {String} msg Error message. @param {Error|String} [e] JavaScript error object or an error string. @param {String} [src] Source of the error (such as the name of the module in which the error occurred). @chainable **/ error: function(msg, e, src) { //TODO Add check for window.onerror here var Y = this, ret; if (Y.config.errorFn) { ret = Y.config.errorFn.apply(Y, arguments); } if (!ret) { throw (e || new Error(msg)); } else { Y.message(msg, 'error', ''+src); // don't scrub this one } return Y; }, /** Generates an id string that is unique among all YUI instances in this execution context. @method guid @param {String} [pre] Prefix. @return {String} Unique id. **/ guid: function(pre) { var id = this.Env._guidp + '_' + (++this.Env._uidx); return (pre) ? (pre + id) : id; }, /** Returns a unique id associated with the given object and (if *readOnly* is falsy) stamps the object with that id so it can be identified in the future. Stamping an object involves adding a `_yuid` property to it that contains the object's id. One exception to this is that in Internet Explorer, DOM nodes have a `uniqueID` property that contains a browser-generated unique id, which will be used instead of a YUI-generated id when available. @method stamp @param {Object} o Object to stamp. @param {Boolean} readOnly If truthy and the given object has not already been stamped, the object will not be modified and `null` will be returned. @return {String} Object's unique id, or `null` if *readOnly* was truthy and the given object was not already stamped. **/ stamp: function(o, readOnly) { var uid; if (!o) { return o; } // IE generates its own unique ID for dom nodes // The uniqueID property of a document node returns a new ID if (o.uniqueID && o.nodeType && o.nodeType !== 9) { uid = o.uniqueID; } else { uid = (typeof o === 'string') ? o : o._yuid; } if (!uid) { uid = this.guid(); if (!readOnly) { try { o._yuid = uid; } catch (e) { uid = null; } } } return uid; }, /** Destroys this YUI instance. @method destroy @since 3.3.0 **/ destroy: function() { var Y = this; if (Y.Event) { Y.Event._unload(); } delete instances[Y.id]; delete Y.Env; delete Y.config; } /** Safe `instanceof` wrapper that works around a memory leak in IE when the object being tested is `window` or `document`. Unless you are testing objects that may be `window` or `document`, you should use the native `instanceof` operator instead of this method. @method instanceOf @param {Object} o Object to check. @param {Object} type Class to check against. @since 3.3.0 **/ }; YUI.prototype = proto; // inheritance utilities are not available yet for (prop in proto) { if (proto.hasOwnProperty(prop)) { YUI[prop] = proto[prop]; } } /** Applies a configuration to all YUI instances in this execution context. The main use case for this method is in "mashups" where several third-party scripts need to write to a global YUI config, but cannot share a single centrally-managed config object. This way they can all call `YUI.applyConfig({})` instead of overwriting the single global config. @example YUI.applyConfig({ modules: { davglass: { fullpath: './davglass.js' } } }); YUI.applyConfig({ modules: { foo: { fullpath: './foo.js' } } }); YUI().use('davglass', function (Y) { // Module davglass will be available here. }); @method applyConfig @param {Object} o Configuration object to apply. @static @since 3.5.0 **/ YUI.applyConfig = function(o) { if (!o) { return; } //If there is a GlobalConfig, apply it first to set the defaults if (YUI.GlobalConfig) { this.prototype.applyConfig.call(this, YUI.GlobalConfig); } //Apply this config to it this.prototype.applyConfig.call(this, o); //Reset GlobalConfig to the combined config YUI.GlobalConfig = this.config; }; // set up the environment YUI._init(); if (hasWin) { // add a window load event at load time so we can capture // the case where it fires before dynamic loading is // complete. add(window, 'load', handleLoad); } else { handleLoad(); } YUI.Env.add = add; YUI.Env.remove = remove; /*global exports*/ // Support the CommonJS method for exporting our single global if (typeof exports == 'object') { exports.YUI = YUI; /** * Set a method to be called when `Get.script` is called in Node.js * `Get` will open the file, then pass it's content and it's path * to this method before attaching it. Commonly used for code coverage * instrumentation. <strong>Calling this multiple times will only * attach the last hook method</strong>. This method is only * available in Node.js. * @method setLoadHook * @static * @param {Function} fn The function to set * @param {String} fn.data The content of the file * @param {String} fn.path The file path of the file */ YUI.setLoadHook = function(fn) { YUI._getLoadHook = fn; }; /** * Load hook for `Y.Get.script` in Node.js, see `YUI.setLoadHook` * @method _getLoadHook * @private * @param {String} data The content of the file * @param {String} path The file path of the file */ YUI._getLoadHook = null; } }()); /** Config object that contains all of the configuration options for this `YUI` instance. This object is supplied by the implementer when instantiating YUI. Some properties have default values if they are not supplied by the implementer. This object should not be updated directly because some values are cached. Use `applyConfig()` to update the config object on a YUI instance that has already been configured. @class config @static **/ /** If `true` (the default), YUI will "bootstrap" the YUI Loader and module metadata if they're needed to load additional dependencies and aren't already available. Setting this to `false` will prevent YUI from automatically loading the Loader and module metadata, so you will need to manually ensure that they're available or handle dependency resolution yourself. @property {Boolean} bootstrap @default true **/ /** If `true`, `Y.log()` messages will be written to the browser's debug console when available and when `useBrowserConsole` is also `true`. @property {Boolean} debug @default true **/ /** Log messages to the browser console if `debug` is `true` and the browser has a supported console. @property {Boolean} useBrowserConsole @default true **/ /** A hash of log sources that should be logged. If specified, only messages from these sources will be logged. Others will be discarded. @property {Object} logInclude @type object **/ /** A hash of log sources that should be not be logged. If specified, all sources will be logged *except* those on this list. @property {Object} logExclude **/ /** When the YUI seed file is dynamically loaded after the `window.onload` event has fired, set this to `true` to tell YUI that it shouldn't wait for `window.onload` to occur. This ensures that components that rely on `window.onload` and the `domready` custom event will work as expected even when YUI is dynamically injected. @property {Boolean} injected @default false **/ /** If `true`, `Y.error()` will generate or re-throw a JavaScript error. Otherwise, errors are merely logged silently. @property {Boolean} throwFail @default true **/ /** Reference to the global object for this execution context. In a browser, this is the current `window` object. In Node.js, this is the Node.js `global` object. @property {Object} global **/ /** The browser window or frame that this YUI instance should operate in. When running in Node.js, this property is `undefined`, since there is no `window` object. Use `global` to get a reference to the global object that will work in both browsers and Node.js. @property {Window} win **/ /** The browser `document` object associated with this YUI instance's `win` object. When running in Node.js, this property is `undefined`, since there is no `document` object. @property {Document} doc **/ /** A list of modules that defines the YUI core (overrides the default list). @property {Array} core @type Array @default ['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'] **/ /** A list of languages to use in order of preference. This list is matched against the list of available languages in modules that the YUI instance uses to determine the best possible localization of language sensitive modules. Languages are represented using BCP 47 language tags, such as "en-GB" for English as used in the United Kingdom, or "zh-Hans-CN" for simplified Chinese as used in China. The list may be provided as a comma-separated string or as an array. @property {String|String[]} lang **/ /** Default date format. @property {String} dateFormat @deprecated Use configuration in `DataType.Date.format()` instead. **/ /** Default locale. @property {String} locale @deprecated Use `config.lang` instead. **/ /** Default generic polling interval in milliseconds. @property {Number} pollInterval @default 20 **/ /** The number of dynamic `<script>` nodes to insert by default before automatically removing them when loading scripts. This applies only to script nodes because removing the node will not make the evaluated script unavailable. Dynamic CSS nodes are not auto purged, because removing a linked style sheet will also remove the style definitions. @property {Number} purgethreshold @default 20 **/ /** Delay in milliseconds to wait after a window `resize` event before firing the event. If another `resize` event occurs before this delay has elapsed, the delay will start over to ensure that `resize` events are throttled. @property {Number} windowResizeDelay @default 40 **/ /** Base directory for dynamic loading. @property {String} base **/ /** Base URL for a dynamic combo handler. This will be used to make combo-handled module requests if `combine` is set to `true. @property {String} comboBase @default "http://yui.yahooapis.com/combo?" **/ /** Root path to prepend to each module path when creating a combo-handled request. This is updated for each YUI release to point to a specific version of the library; for example: "3.8.0/build/". @property {String} root **/ /** Filter to apply to module urls. This filter will modify the default path for all modules. The default path for the YUI library is the minified version of the files (e.g., event-min.js). The filter property can be a predefined filter or a custom filter. The valid predefined filters are: - **debug**: Loads debug versions of modules (e.g., event-debug.js). - **raw**: Loads raw, non-minified versions of modules without debug logging (e.g., event.js). You can also define a custom filter, which must be an object literal containing a search regular expression and a replacement string: myFilter: { searchExp : "-min\\.js", replaceStr: "-debug.js" } @property {Object|String} filter **/ /** Skin configuration and customizations. @property {Object} skin @param {String} [skin.defaultSkin='sam'] Default skin name. This skin will be applied automatically to skinnable components if not overridden by a component-specific skin name. @param {String} [skin.base='assets/skins/'] Default base path for a skin, relative to Loader's `base` path. @param {Object} [skin.overrides] Component-specific skin name overrides. Specify a component name as the key and, as the value, a string or array of strings for a skin or skins that should be loaded for that component instead of the `defaultSkin`. **/ /** Hash of per-component filter specifications. If specified for a given component, this overrides the global `filter` config. @property {Object} filters **/ /** If `true`, YUI will use a combo handler to load multiple modules in as few requests as possible. The YUI CDN (which YUI uses by default) supports combo handling, but other servers may not. If the server from which you're loading YUI does not support combo handling, set this to `false`. Providing a value for the `base` config property will cause `combine` to default to `false` instead of `true`. @property {Boolean} combine @default true */ /** Array of module names that should never be dynamically loaded. @property {String[]} ignore **/ /** Array of module names that should always be loaded when required, even if already present on the page. @property {String[]} force **/ /** DOM element or id that should be used as the insertion point for dynamically added `<script>` and `<link>` nodes. @property {HTMLElement|String} insertBefore **/ /** Object hash containing attributes to add to dynamically added `<script>` nodes. @property {Object} jsAttributes **/ /** Object hash containing attributes to add to dynamically added `<link>` nodes. @property {Object} cssAttributes **/ /** Timeout in milliseconds before a dynamic JS or CSS request will be considered a failure. If not set, no timeout will be enforced. @property {Number} timeout **/ /** Callback for the 'CSSComplete' event. When dynamically loading YUI components with CSS, this property fires when the CSS is finished loading. This provides an opportunity to enhance the presentation of a loading page a little bit before the entire loading process is done. @property {Function} onCSS **/ /** A hash of module definitions to add to the list of available YUI modules. These modules can then be dynamically loaded via the `use()` method. This is a hash in which keys are module names and values are objects containing module metadata. See `Loader.addModule()` for the supported module metadata fields. Also see `groups`, which provides a way to configure the base and combo spec for a set of modules. @example modules: { mymod1: { requires: ['node'], fullpath: '/mymod1/mymod1.js' }, mymod2: { requires: ['mymod1'], fullpath: '/mymod2/mymod2.js' }, mymod3: '/js/mymod3.js', mycssmod: '/css/mycssmod.css' } @property {Object} modules **/ /** Aliases are dynamic groups of modules that can be used as shortcuts. @example YUI({ aliases: { davglass: [ 'node', 'yql', 'dd' ], mine: [ 'davglass', 'autocomplete'] } }).use('mine', function (Y) { // Node, YQL, DD & AutoComplete available here. }); @property {Object} aliases **/ /** A hash of module group definitions. For each group you can specify a list of modules and the base path and combo spec to use when dynamically loading the modules. @example groups: { yui2: { // specify whether or not this group has a combo service combine: true, // The comboSeperator to use with this group's combo handler comboSep: ';', // The maxURLLength for this server maxURLLength: 500, // the base path for non-combo paths base: 'http://yui.yahooapis.com/2.8.0r4/build/', // the path to the combo service comboBase: 'http://yui.yahooapis.com/combo?', // a fragment to prepend to the path attribute when // when building combo urls root: '2.8.0r4/build/', // the module definitions modules: { yui2_yde: { path: "yahoo-dom-event/yahoo-dom-event.js" }, yui2_anim: { path: "animation/animation.js", requires: ['yui2_yde'] } } } } @property {Object} groups **/ /** Path to the Loader JS file, relative to the `base` path. This is used to dynamically bootstrap the Loader when it's needed and isn't yet available. @property {String} loaderPath @default "loader/loader-min.js" **/ /** If `true`, YUI will attempt to load CSS dependencies and skins. Set this to `false` to prevent YUI from loading any CSS, or set it to the string `"force"` to force CSS dependencies to be loaded even if their associated JS modules are already loaded. @property {Boolean|String} fetchCSS @default true **/ /** Default gallery version used to build gallery module urls. @property {String} gallery @since 3.1.0 **/ /** Default YUI 2 version used to build YUI 2 module urls. This is used for intrinsic YUI 2 support via the 2in3 project. Also see the `2in3` config for pulling different revisions of the wrapped YUI 2 modules. @property {String} yui2 @default "2.9.0" @since 3.1.0 **/ /** Revision number of YUI 2in3 modules that should be used when loading YUI 2in3. @property {String} 2in3 @default "4" @since 3.1.0 **/ /** Alternate console log function that should be used in environments without a supported native console. This function is executed with the YUI instance as its `this` object. @property {Function} logFn @since 3.1.0 **/ /** The minimum log level to log messages for. Log levels are defined incrementally. Messages greater than or equal to the level specified will be shown. All others will be discarded. The order of log levels in increasing priority is: debug info warn error @property {String} logLevel @default 'debug' @since 3.10.0 **/ /** Callback to execute when `Y.error()` is called. It receives the error message and a JavaScript error object if one was provided. This function is executed with the YUI instance as its `this` object. Returning `true` from this function will prevent an exception from being thrown. @property {Function} errorFn @param {String} errorFn.msg Error message @param {Object} [errorFn.err] Error object (if one was provided). @since 3.2.0 **/ /** A callback to execute when Loader fails to load one or more resources. This could be because of a script load failure. It could also be because a module fails to register itself when the `requireRegistration` config is `true`. If this function is defined, the `use()` callback will only be called when the loader succeeds. Otherwise, `use()` will always executes unless there was a JavaScript error when attaching a module. @property {Function} loadErrorFn @since 3.3.0 **/ /** If `true`, Loader will expect all loaded scripts to be first-class YUI modules that register themselves with the YUI global, and will trigger a failure if a loaded script does not register a YUI module. @property {Boolean} requireRegistration @default false @since 3.3.0 **/ /** Cache serviced use() requests. @property {Boolean} cacheUse @default true @since 3.3.0 @deprecated No longer used. **/ /** Whether or not YUI should use native ES5 functionality when available for features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will always use its own fallback implementations instead of relying on ES5 functionality, even when ES5 functionality is available. @property {Boolean} useNativeES5 @default true @since 3.5.0 **/ /** * Leverage native JSON stringify if the browser has a native * implementation. In general, this is a good idea. See the Known Issues * section in the JSON user guide for caveats. The default value is true * for browsers with native JSON support. * * @property useNativeJSONStringify * @type Boolean * @default true * @since 3.8.0 */ /** * Leverage native JSON parse if the browser has a native implementation. * In general, this is a good idea. See the Known Issues section in the * JSON user guide for caveats. The default value is true for browsers with * native JSON support. * * @property useNativeJSONParse * @type Boolean * @default true * @since 3.8.0 */ /** Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`) @property {Object|String} delayUntil @since 3.6.0 @example You can use `load` or `domready` strings by default: YUI({ delayUntil: 'domready' }, function (Y) { // This will not execute until 'domeready' occurs. }); Or you can delay until a node is available (with `available` or `contentready`): YUI({ delayUntil: { event: 'available', args : '#foo' } }, function (Y) { // This will not execute until a node matching the selector "#foo" is // available in the DOM. }); **/ YUI.add('yui-base', function (Y, NAME) { /* * YUI stub * @module yui * @submodule yui-base */ /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * Provides core language utilites and extensions used throughout YUI. * * @class Lang * @static */ var L = Y.Lang || (Y.Lang = {}), STRING_PROTO = String.prototype, TOSTRING = Object.prototype.toString, TYPES = { 'undefined' : 'undefined', 'number' : 'number', 'boolean' : 'boolean', 'string' : 'string', '[object Function]': 'function', '[object RegExp]' : 'regexp', '[object Array]' : 'array', '[object Date]' : 'date', '[object Error]' : 'error' }, SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g, WHITESPACE = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF", WHITESPACE_CLASS = "[\x09-\x0D\x20\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+", TRIM_LEFT_REGEX = new RegExp("^" + WHITESPACE_CLASS), TRIM_RIGHT_REGEX = new RegExp(WHITESPACE_CLASS + "$"), TRIMREGEX = new RegExp(TRIM_LEFT_REGEX.source + "|" + TRIM_RIGHT_REGEX.source, "g"), NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i; // -- Protected Methods -------------------------------------------------------- /** Returns `true` if the given function appears to be implemented in native code, `false` otherwise. Will always return `false` -- even in ES5-capable browsers -- if the `useNativeES5` YUI config option is set to `false`. This isn't guaranteed to be 100% accurate and won't work for anything other than functions, but it can be useful for determining whether a function like `Array.prototype.forEach` is native or a JS shim provided by another library. There's a great article by @kangax discussing certain flaws with this technique: <http://perfectionkills.com/detecting-built-in-host-methods/> While his points are valid, it's still possible to benefit from this function as long as it's used carefully and sparingly, and in such a way that false negatives have minimal consequences. It's used internally to avoid using potentially broken non-native ES5 shims that have been added to the page by other libraries. @method _isNative @param {Function} fn Function to test. @return {Boolean} `true` if _fn_ appears to be native, `false` otherwise. @static @protected @since 3.5.0 **/ L._isNative = function (fn) { return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn)); }; // -- Public Methods ----------------------------------------------------------- /** * Determines whether or not the provided item is an array. * * Returns `false` for array-like collections such as the function `arguments` * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to * test for an array-like collection. * * @method isArray * @param o The object to test. * @return {boolean} true if o is an array. * @static */ L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) { return L.type(o) === 'array'; }; /** * Determines whether or not the provided item is a boolean. * @method isBoolean * @static * @param o The object to test. * @return {boolean} true if o is a boolean. */ L.isBoolean = function(o) { return typeof o === 'boolean'; }; /** * Determines whether or not the supplied item is a date instance. * @method isDate * @static * @param o The object to test. * @return {boolean} true if o is a date. */ L.isDate = function(o) { return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o); }; /** * <p> * Determines whether or not the provided item is a function. * Note: Internet Explorer thinks certain functions are objects: * </p> * * <pre> * var obj = document.createElement("object"); * Y.Lang.isFunction(obj.getAttribute) // reports false in IE * &nbsp; * var input = document.createElement("input"); // append to body * Y.Lang.isFunction(input.focus) // reports false in IE * </pre> * * <p> * You will have to implement additional tests if these functions * matter to you. * </p> * * @method isFunction * @static * @param o The object to test. * @return {boolean} true if o is a function. */ L.isFunction = function(o) { return L.type(o) === 'function'; }; /** * Determines whether or not the provided item is null. * @method isNull * @static * @param o The object to test. * @return {boolean} true if o is null. */ L.isNull = function(o) { return o === null; }; /** * Determines whether or not the provided item is a legal number. * @method isNumber * @static * @param o The object to test. * @return {boolean} true if o is a number. */ L.isNumber = function(o) { return typeof o === 'number' && isFinite(o); }; /** * Determines whether or not the provided item is of type object * or function. Note that arrays are also objects, so * <code>Y.Lang.isObject([]) === true</code>. * @method isObject * @static * @param o The object to test. * @param failfn {boolean} fail if the input is a function. * @return {boolean} true if o is an object. * @see isPlainObject */ L.isObject = function(o, failfn) { var t = typeof o; return (o && (t === 'object' || (!failfn && (t === 'function' || L.isFunction(o))))) || false; }; /** * Determines whether or not the provided item is a string. * @method isString * @static * @param o The object to test. * @return {boolean} true if o is a string. */ L.isString = function(o) { return typeof o === 'string'; }; /** * Determines whether or not the provided item is undefined. * @method isUndefined * @static * @param o The object to test. * @return {boolean} true if o is undefined. */ L.isUndefined = function(o) { return typeof o === 'undefined'; }; /** * A convenience method for detecting a legitimate non-null value. * Returns false for null/undefined/NaN, true for other values, * including 0/false/'' * @method isValue * @static * @param o The item to test. * @return {boolean} true if it is not null/undefined/NaN || false. */ L.isValue = function(o) { var t = L.type(o); switch (t) { case 'number': return isFinite(o); case 'null': // fallthru case 'undefined': return false; default: return !!t; } }; /** * Returns the current time in milliseconds. * * @method now * @return {Number} Current time in milliseconds. * @static * @since 3.3.0 */ L.now = Date.now || function () { return new Date().getTime(); }; /** * Lightweight version of <code>Y.substitute</code>. Uses the same template * structure as <code>Y.substitute</code>, but doesn't support recursion, * auto-object coersion, or formats. * @method sub * @param {string} s String to be modified. * @param {object} o Object containing replacement values. * @return {string} the substitute result. * @static * @since 3.2.0 */ L.sub = function(s, o) { return s.replace ? s.replace(SUBREGEX, function (match, key) { return L.isUndefined(o[key]) ? match : o[key]; }) : s; }; /** * Returns a string without any leading or trailing whitespace. If * the input is not a string, the input will be returned untouched. * @method trim * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trim = L._isNative(STRING_PROTO.trim) && !WHITESPACE.trim() ? function(s) { return s && s.trim ? s.trim() : s; } : function (s) { try { return s.replace(TRIMREGEX, ''); } catch (e) { return s; } }; /** * Returns a string without any leading whitespace. * @method trimLeft * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trimLeft = L._isNative(STRING_PROTO.trimLeft) && !WHITESPACE.trimLeft() ? function (s) { return s.trimLeft(); } : function (s) { return s.replace(TRIM_LEFT_REGEX, ''); }; /** * Returns a string without any trailing whitespace. * @method trimRight * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trimRight = L._isNative(STRING_PROTO.trimRight) && !WHITESPACE.trimRight() ? function (s) { return s.trimRight(); } : function (s) { return s.replace(TRIM_RIGHT_REGEX, ''); }; /** Returns one of the following strings, representing the type of the item passed in: * "array" * "boolean" * "date" * "error" * "function" * "null" * "number" * "object" * "regexp" * "string" * "undefined" Known issues: * `typeof HTMLElementCollection` returns function in Safari, but `Y.Lang.type()` reports "object", which could be a good thing -- but it actually caused the logic in <code>Y.Lang.isObject</code> to fail. @method type @param o the item to test. @return {string} the detected type. @static **/ L.type = function(o) { return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null'); }; /** @module yui @submodule yui-base */ var Lang = Y.Lang, Native = Array.prototype, hasOwn = Object.prototype.hasOwnProperty; /** Provides utility methods for working with arrays. Additional array helpers can be found in the `collection` and `array-extras` modules. `Y.Array(thing)` returns a native array created from _thing_. Depending on _thing_'s type, one of the following will happen: * Arrays are returned unmodified unless a non-zero _startIndex_ is specified. * Array-like collections (see `Array.test()`) are converted to arrays. * For everything else, a new array is created with _thing_ as the sole item. Note: elements that are also collections, such as `<form>` and `<select>` elements, are not automatically converted to arrays. To force a conversion, pass `true` as the value of the _force_ parameter. @class Array @constructor @param {Any} thing The thing to arrayify. @param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like collection, a subset of items starting at the specified index will be returned. @param {Boolean} [force=false] If `true`, _thing_ will be treated as an array-like collection no matter what. @return {Array} A native array created from _thing_, according to the rules described above. **/ function YArray(thing, startIndex, force) { var len, result; /*jshint expr: true*/ startIndex || (startIndex = 0); if (force || YArray.test(thing)) { // IE throws when trying to slice HTMLElement collections. try { return Native.slice.call(thing, startIndex); } catch (ex) { result = []; for (len = thing.length; startIndex < len; ++startIndex) { result.push(thing[startIndex]); } return result; } } return [thing]; } Y.Array = YArray; /** Dedupes an array of strings, returning an array that's guaranteed to contain only one copy of a given string. This method differs from `Array.unique()` in that it's optimized for use only with arrays consisting entirely of strings or entirely of numbers, whereas `unique` may be used with other value types (but is slower). Using `dedupe()` with values other than strings or numbers, or with arrays containing a mix of strings and numbers, may result in unexpected behavior. @method dedupe @param {String[]|Number[]} array Array of strings or numbers to dedupe. @return {Array} Copy of _array_ containing no duplicate values. @static @since 3.4.0 **/ YArray.dedupe = Lang._isNative(Object.create) ? function (array) { var hash = Object.create(null), results = [], i, item, len; for (i = 0, len = array.length; i < len; ++i) { item = array[i]; if (!hash[item]) { hash[item] = 1; results.push(item); } } return results; } : function (array) { var hash = {}, results = [], i, item, len; for (i = 0, len = array.length; i < len; ++i) { item = array[i]; if (!hasOwn.call(hash, item)) { hash[item] = 1; results.push(item); } } return results; }; /** Executes the supplied function on each item in the array. This method wraps the native ES5 `Array.forEach()` method if available. @method each @param {Array} array Array to iterate. @param {Function} fn Function to execute on each item in the array. The function will receive the following arguments: @param {Any} fn.item Current array item. @param {Number} fn.index Current array index. @param {Array} fn.array Array being iterated. @param {Object} [thisObj] `this` object to use when calling _fn_. @return {YUI} The YUI instance. @static **/ YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) { Native.forEach.call(array || [], fn, thisObj || Y); return Y; } : function (array, fn, thisObj) { for (var i = 0, len = (array && array.length) || 0; i < len; ++i) { if (i in array) { fn.call(thisObj || Y, array[i], i, array); } } return Y; }; /** Alias for `each()`. @method forEach @static **/ /** Returns an object using the first array as keys and the second as values. If the second array is not provided, or if it doesn't contain the same number of values as the first array, then `true` will be used in place of the missing values. @example Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']); // => {a: 'foo', b: 'bar', c: true} @method hash @param {String[]} keys Array of strings to use as keys. @param {Array} [values] Array to use as values. @return {Object} Hash using the first array as keys and the second as values. @static **/ YArray.hash = function (keys, values) { var hash = {}, vlen = (values && values.length) || 0, i, len; for (i = 0, len = keys.length; i < len; ++i) { if (i in keys) { hash[keys[i]] = vlen > i && i in values ? values[i] : true; } } return hash; }; /** Returns the index of the first item in the array that's equal (using a strict equality check) to the specified _value_, or `-1` if the value isn't found. This method wraps the native ES5 `Array.indexOf()` method if available. @method indexOf @param {Array} array Array to search. @param {Any} value Value to search for. @param {Number} [from=0] The index at which to begin the search. @return {Number} Index of the item strictly equal to _value_, or `-1` if not found. @static **/ YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) { return Native.indexOf.call(array, value, from); } : function (array, value, from) { // http://es5.github.com/#x15.4.4.14 var len = array.length; from = +from || 0; from = (from > 0 || -1) * Math.floor(Math.abs(from)); if (from < 0) { from += len; if (from < 0) { from = 0; } } for (; from < len; ++from) { if (from in array && array[from] === value) { return from; } } return -1; }; /** Numeric sort convenience function. The native `Array.prototype.sort()` function converts values to strings and sorts them in lexicographic order, which is unsuitable for sorting numeric values. Provide `Array.numericSort` as a custom sort function when you want to sort values in numeric order. @example [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort); // => [4, 8, 15, 16, 23, 42] @method numericSort @param {Number} a First value to compare. @param {Number} b Second value to compare. @return {Number} Difference between _a_ and _b_. @static **/ YArray.numericSort = function (a, b) { return a - b; }; /** Executes the supplied function on each item in the array. Returning a truthy value from the function will stop the processing of remaining items. @method some @param {Array} array Array to iterate over. @param {Function} fn Function to execute on each item. The function will receive the following arguments: @param {Any} fn.value Current array item. @param {Number} fn.index Current array index. @param {Array} fn.array Array being iterated over. @param {Object} [thisObj] `this` object to use when calling _fn_. @return {Boolean} `true` if the function returns a truthy value on any of the items in the array; `false` otherwise. @static **/ YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) { return Native.some.call(array, fn, thisObj); } : function (array, fn, thisObj) { for (var i = 0, len = array.length; i < len; ++i) { if (i in array && fn.call(thisObj, array[i], i, array)) { return true; } } return false; }; /** Evaluates _obj_ to determine if it's an array, an array-like collection, or something else. This is useful when working with the function `arguments` collection and `HTMLElement` collections. Note: This implementation doesn't consider elements that are also collections, such as `<form>` and `<select>`, to be array-like. @method test @param {Object} obj Object to test. @return {Number} A number indicating the results of the test: * 0: Neither an array nor an array-like collection. * 1: Real array. * 2: Array-like collection. @static **/ YArray.test = function (obj) { var result = 0; if (Lang.isArray(obj)) { result = 1; } else if (Lang.isObject(obj)) { try { // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug). if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {} } return result; }; /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * A simple FIFO queue. Items are added to the Queue with add(1..n items) and * removed using next(). * * @class Queue * @constructor * @param {MIXED} item* 0..n items to seed the queue. */ function Queue() { this._init(); this.add.apply(this, arguments); } Queue.prototype = { /** * Initialize the queue * * @method _init * @protected */ _init: function() { /** * The collection of enqueued items * * @property _q * @type Array * @protected */ this._q = []; }, /** * Get the next item in the queue. FIFO support * * @method next * @return {MIXED} the next item in the queue. */ next: function() { return this._q.shift(); }, /** * Get the last in the queue. LIFO support. * * @method last * @return {MIXED} the last item in the queue. */ last: function() { return this._q.pop(); }, /** * Add 0..n items to the end of the queue. * * @method add * @param {MIXED} item* 0..n items. * @return {object} this queue. */ add: function() { this._q.push.apply(this._q, arguments); return this; }, /** * Returns the current number of queued items. * * @method size * @return {Number} The size. */ size: function() { return this._q.length; } }; Y.Queue = Queue; YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue(); /** The YUI module contains the components required for building the YUI seed file. This includes the script loading mechanism, a simple queue, and the core utilities for the library. @module yui @submodule yui-base **/ var CACHED_DELIMITER = '__', hasOwn = Object.prototype.hasOwnProperty, isObject = Y.Lang.isObject; /** Returns a wrapper for a function which caches the return value of that function, keyed off of the combined string representation of the argument values provided when the wrapper is called. Calling this function again with the same arguments will return the cached value rather than executing the wrapped function. Note that since the cache is keyed off of the string representation of arguments passed to the wrapper function, arguments that aren't strings and don't provide a meaningful `toString()` method may result in unexpected caching behavior. For example, the objects `{}` and `{foo: 'bar'}` would both be converted to the string `[object Object]` when used as a cache key. @method cached @param {Function} source The function to memoize. @param {Object} [cache={}] Object in which to store cached values. You may seed this object with pre-existing cached values if desired. @param {any} [refetch] If supplied, this value is compared with the cached value using a `==` comparison. If the values are equal, the wrapped function is executed again even though a cached value exists. @return {Function} Wrapped function. @for YUI **/ Y.cached = function (source, cache, refetch) { /*jshint expr: true*/ cache || (cache = {}); return function (arg) { var key = arguments.length > 1 ? Array.prototype.join.call(arguments, CACHED_DELIMITER) : String(arg); /*jshint eqeqeq: false*/ if (!(key in cache) || (refetch && cache[key] == refetch)) { cache[key] = source.apply(source, arguments); } return cache[key]; }; }; /** Returns the `location` object from the window/frame in which this YUI instance operates, or `undefined` when executing in a non-browser environment (e.g. Node.js). It is _not_ recommended to hold references to the `window.location` object outside of the scope of a function in which its properties are being accessed or its methods are being called. This is because of a nasty bug/issue that exists in both Safari and MobileSafari browsers: [WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679). @method getLocation @return {location} The `location` object from the window/frame in which this YUI instance operates. @since 3.5.0 **/ Y.getLocation = function () { // It is safer to look this up every time because yui-base is attached to a // YUI instance before a user's config is applied; i.e. `Y.config.win` does // not point the correct window object when this file is loaded. var win = Y.config.win; // It is not safe to hold a reference to the `location` object outside the // scope in which it is being used. The WebKit engine used in Safari and // MobileSafari will "disconnect" the `location` object from the `window` // when a page is restored from back/forward history cache. return win && win.location; }; /** Returns a new object containing all of the properties of all the supplied objects. The properties from later objects will overwrite those in earlier objects. Passing in a single object will create a shallow copy of it. For a deep copy, use `clone()`. @method merge @param {Object} objects* One or more objects to merge. @return {Object} A new merged object. **/ Y.merge = function () { var i = 0, len = arguments.length, result = {}, key, obj; for (; i < len; ++i) { obj = arguments[i]; for (key in obj) { if (hasOwn.call(obj, key)) { result[key] = obj[key]; } } } return result; }; /** Mixes _supplier_'s properties into _receiver_. Properties on _receiver_ or _receiver_'s prototype will not be overwritten or shadowed unless the _overwrite_ parameter is `true`, and will not be merged unless the _merge_ parameter is `true`. In the default mode (0), only properties the supplier owns are copied (prototype properties are not copied). The following copying modes are available: * `0`: _Default_. Object to object. * `1`: Prototype to prototype. * `2`: Prototype to prototype and object to object. * `3`: Prototype to object. * `4`: Object to prototype. @method mix @param {Function|Object} receiver The object or function to receive the mixed properties. @param {Function|Object} supplier The object or function supplying the properties to be mixed. @param {Boolean} [overwrite=false] If `true`, properties that already exist on the receiver will be overwritten with properties from the supplier. @param {String[]} [whitelist] An array of property names to copy. If specified, only the whitelisted properties will be copied, and all others will be ignored. @param {Number} [mode=0] Mix mode to use. See above for available modes. @param {Boolean} [merge=false] If `true`, objects and arrays that already exist on the receiver will have the corresponding object/array from the supplier merged into them, rather than being skipped or overwritten. When both _overwrite_ and _merge_ are `true`, _merge_ takes precedence. @return {Function|Object|YUI} The receiver, or the YUI instance if the specified receiver is falsy. **/ Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) { var alwaysOverwrite, exists, from, i, key, len, to; // If no supplier is given, we return the receiver. If no receiver is given, // we return Y. Returning Y doesn't make much sense to me, but it's // grandfathered in for backcompat reasons. if (!receiver || !supplier) { return receiver || Y; } if (mode) { // In mode 2 (prototype to prototype and object to object), we recurse // once to do the proto to proto mix. The object to object mix will be // handled later on. if (mode === 2) { Y.mix(receiver.prototype, supplier.prototype, overwrite, whitelist, 0, merge); } // Depending on which mode is specified, we may be copying from or to // the prototypes of the supplier and receiver. from = mode === 1 || mode === 3 ? supplier.prototype : supplier; to = mode === 1 || mode === 4 ? receiver.prototype : receiver; // If either the supplier or receiver doesn't actually have a // prototype property, then we could end up with an undefined `from` // or `to`. If that happens, we abort and return the receiver. if (!from || !to) { return receiver; } } else { from = supplier; to = receiver; } // If `overwrite` is truthy and `merge` is falsy, then we can skip a // property existence check on each iteration and save some time. alwaysOverwrite = overwrite && !merge; if (whitelist) { for (i = 0, len = whitelist.length; i < len; ++i) { key = whitelist[i]; // We call `Object.prototype.hasOwnProperty` instead of calling // `hasOwnProperty` on the object itself, since the object's // `hasOwnProperty` method may have been overridden or removed. // Also, some native objects don't implement a `hasOwnProperty` // method. if (!hasOwn.call(from, key)) { continue; } // The `key in to` check here is (sadly) intentional for backwards // compatibility reasons. It prevents undesired shadowing of // prototype members on `to`. exists = alwaysOverwrite ? false : key in to; if (merge && exists && isObject(to[key], true) && isObject(from[key], true)) { // If we're in merge mode, and the key is present on both // objects, and the value on both objects is either an object or // an array (but not a function), then we recurse to merge the // `from` value into the `to` value instead of overwriting it. // // Note: It's intentional that the whitelist isn't passed to the // recursive call here. This is legacy behavior that lots of // code still depends on. Y.mix(to[key], from[key], overwrite, null, 0, merge); } else if (overwrite || !exists) { // We're not in merge mode, so we'll only copy the `from` value // to the `to` value if we're in overwrite mode or if the // current key doesn't exist on the `to` object. to[key] = from[key]; } } } else { for (key in from) { // The code duplication here is for runtime performance reasons. // Combining whitelist and non-whitelist operations into a single // loop or breaking the shared logic out into a function both result // in worse performance, and Y.mix is critical enough that the byte // tradeoff is worth it. if (!hasOwn.call(from, key)) { continue; } // The `key in to` check here is (sadly) intentional for backwards // compatibility reasons. It prevents undesired shadowing of // prototype members on `to`. exists = alwaysOverwrite ? false : key in to; if (merge && exists && isObject(to[key], true) && isObject(from[key], true)) { Y.mix(to[key], from[key], overwrite, null, 0, merge); } else if (overwrite || !exists) { to[key] = from[key]; } } // If this is an IE browser with the JScript enumeration bug, force // enumeration of the buggy properties by making a recursive call with // the buggy properties as the whitelist. if (Y.Object._hasEnumBug) { Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge); } } return receiver; }; /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * Adds utilities to the YUI instance for working with objects. * * @class Object */ var Lang = Y.Lang, hasOwn = Object.prototype.hasOwnProperty, UNDEFINED, // <-- Note the comma. We're still declaring vars. /** * Returns a new object that uses _obj_ as its prototype. This method wraps the * native ES5 `Object.create()` method if available, but doesn't currently * pass through `Object.create()`'s second argument (properties) in order to * ensure compatibility with older browsers. * * @method () * @param {Object} obj Prototype object. * @return {Object} New object using _obj_ as its prototype. * @static */ O = Y.Object = Lang._isNative(Object.create) ? function (obj) { // We currently wrap the native Object.create instead of simply aliasing it // to ensure consistency with our fallback shim, which currently doesn't // support Object.create()'s second argument (properties). Once we have a // safe fallback for the properties arg, we can stop wrapping // Object.create(). return Object.create(obj); } : (function () { // Reusable constructor function for the Object.create() shim. function F() {} // The actual shim. return function (obj) { F.prototype = obj; return new F(); }; }()), /** * Property names that IE doesn't enumerate in for..in loops, even when they * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to * manually enumerate these properties. * * @property _forceEnum * @type String[] * @protected * @static */ forceEnum = O._forceEnum = [ 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toString', 'toLocaleString', 'valueOf' ], /** * `true` if this browser has the JScript enumeration bug that prevents * enumeration of the properties named in the `_forceEnum` array, `false` * otherwise. * * See: * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug> * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation> * * @property _hasEnumBug * @type Boolean * @protected * @static */ hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'), /** * `true` if this browser incorrectly considers the `prototype` property of * functions to be enumerable. Currently known to affect Opera 11.50 and Android 2.3.x. * * @property _hasProtoEnumBug * @type Boolean * @protected * @static */ hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'), /** * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or * exists only on _obj_'s prototype. This is essentially a safer version of * `obj.hasOwnProperty()`. * * @method owns * @param {Object} obj Object to test. * @param {String} key Property name to look for. * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise. * @static */ owns = O.owns = function (obj, key) { return !!obj && hasOwn.call(obj, key); }; // <-- End of var declarations. /** * Alias for `owns()`. * * @method hasKey * @param {Object} obj Object to test. * @param {String} key Property name to look for. * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise. * @static */ O.hasKey = owns; /** * Returns an array containing the object's enumerable keys. Does not include * prototype keys or non-enumerable keys. * * Note that keys are returned in enumeration order (that is, in the same order * that they would be enumerated by a `for-in` loop), which may not be the same * as the order in which they were defined. * * This method is an alias for the native ES5 `Object.keys()` method if * available and non-buggy. The Opera 11.50 and Android 2.3.x versions of * `Object.keys()` have an inconsistency as they consider `prototype` to be * enumerable, so a non-native shim is used to rectify the difference. * * @example * * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'}); * // => ['a', 'b', 'c'] * * @method keys * @param {Object} obj An object. * @return {String[]} Array of keys. * @static */ O.keys = Lang._isNative(Object.keys) && !hasProtoEnumBug ? Object.keys : function (obj) { if (!Lang.isObject(obj)) { throw new TypeError('Object.keys called on a non-object'); } var keys = [], i, key, len; if (hasProtoEnumBug && typeof obj === 'function') { for (key in obj) { if (owns(obj, key) && key !== 'prototype') { keys.push(key); } } } else { for (key in obj) { if (owns(obj, key)) { keys.push(key); } } } if (hasEnumBug) { for (i = 0, len = forceEnum.length; i < len; ++i) { key = forceEnum[i]; if (owns(obj, key)) { keys.push(key); } } } return keys; }; /** * Returns an array containing the values of the object's enumerable keys. * * Note that values are returned in enumeration order (that is, in the same * order that they would be enumerated by a `for-in` loop), which may not be the * same as the order in which they were defined. * * @example * * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'}); * // => ['foo', 'bar', 'baz'] * * @method values * @param {Object} obj An object. * @return {Array} Array of values. * @static */ O.values = function (obj) { var keys = O.keys(obj), i = 0, len = keys.length, values = []; for (; i < len; ++i) { values.push(obj[keys[i]]); } return values; }; /** * Returns the number of enumerable keys owned by an object. * * @method size * @param {Object} obj An object. * @return {Number} The object's size. * @static */ O.size = function (obj) { try { return O.keys(obj).length; } catch (ex) { return 0; // Legacy behavior for non-objects. } }; /** * Returns `true` if the object owns an enumerable property with the specified * value. * * @method hasValue * @param {Object} obj An object. * @param {any} value The value to search for. * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise. * @static */ O.hasValue = function (obj, value) { return Y.Array.indexOf(O.values(obj), value) > -1; }; /** * Executes a function on each enumerable property in _obj_. The function * receives the value, the key, and the object itself as parameters (in that * order). * * By default, only properties owned by _obj_ are enumerated. To include * prototype properties, set the _proto_ parameter to `true`. * * @method each * @param {Object} obj Object to enumerate. * @param {Function} fn Function to execute on each enumerable property. * @param {mixed} fn.value Value of the current property. * @param {String} fn.key Key of the current property. * @param {Object} fn.obj Object being enumerated. * @param {Object} [thisObj] `this` object to use when calling _fn_. * @param {Boolean} [proto=false] Include prototype properties. * @return {YUI} the YUI instance. * @chainable * @static */ O.each = function (obj, fn, thisObj, proto) { var key; for (key in obj) { if (proto || owns(obj, key)) { fn.call(thisObj || Y, obj[key], key, obj); } } return Y; }; /** * Executes a function on each enumerable property in _obj_, but halts if the * function returns a truthy value. The function receives the value, the key, * and the object itself as paramters (in that order). * * By default, only properties owned by _obj_ are enumerated. To include * prototype properties, set the _proto_ parameter to `true`. * * @method some * @param {Object} obj Object to enumerate. * @param {Function} fn Function to execute on each enumerable property. * @param {mixed} fn.value Value of the current property. * @param {String} fn.key Key of the current property. * @param {Object} fn.obj Object being enumerated. * @param {Object} [thisObj] `this` object to use when calling _fn_. * @param {Boolean} [proto=false] Include prototype properties. * @return {Boolean} `true` if any execution of _fn_ returns a truthy value, * `false` otherwise. * @static */ O.some = function (obj, fn, thisObj, proto) { var key; for (key in obj) { if (proto || owns(obj, key)) { if (fn.call(thisObj || Y, obj[key], key, obj)) { return true; } } } return false; }; /** * Retrieves the sub value at the provided path, * from the value object provided. * * @method getValue * @static * @param o The object from which to extract the property value. * @param path {Array} A path array, specifying the object traversal path * from which to obtain the sub value. * @return {Any} The value stored in the path, undefined if not found, * undefined if the source is not an object. Returns the source object * if an empty path is provided. */ O.getValue = function(o, path) { if (!Lang.isObject(o)) { return UNDEFINED; } var i, p = Y.Array(path), l = p.length; for (i = 0; o !== UNDEFINED && i < l; i++) { o = o[p[i]]; } return o; }; /** * Sets the sub-attribute value at the provided path on the * value object. Returns the modified value object, or * undefined if the path is invalid. * * @method setValue * @static * @param o The object on which to set the sub value. * @param path {Array} A path array, specifying the object traversal path * at which to set the sub value. * @param val {Any} The new value for the sub-attribute. * @return {Object} The modified object, with the new sub value set, or * undefined, if the path was invalid. */ O.setValue = function(o, path, val) { var i, p = Y.Array(path), leafIdx = p.length - 1, ref = o; if (leafIdx >= 0) { for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) { ref = ref[p[i]]; } if (ref !== UNDEFINED) { ref[p[i]] = val; } else { return UNDEFINED; } } return o; }; /** * Returns `true` if the object has no enumerable properties of its own. * * @method isEmpty * @param {Object} obj An object. * @return {Boolean} `true` if the object is empty. * @static * @since 3.2.0 */ O.isEmpty = function (obj) { return !O.keys(Object(obj)).length; }; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and the * core utilities for the library. * @module yui * @submodule yui-base */ /** * YUI user agent detection. * Do not fork for a browser if it can be avoided. Use feature detection when * you can. Use the user agent as a last resort. For all fields listed * as @type float, UA stores a version number for the browser engine, * 0 otherwise. This value may or may not map to the version number of * the browser using the engine. The value is presented as a float so * that it can easily be used for boolean evaluation as well as for * looking for a particular range of versions. Because of this, * some of the granularity of the version info may be lost. The fields that * are @type string default to null. The API docs list the values that * these fields can have. * @class UA * @static */ /** * Static method on `YUI.Env` for parsing a UA string. Called at instantiation * to populate `Y.UA`. * * @static * @method parseUA * @param {String} [subUA=navigator.userAgent] UA string to parse * @return {Object} The Y.UA object */ YUI.Env.parseUA = function(subUA) { var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() { return (c++ === 1) ? '' : '.'; })); }, win = Y.config.win, nav = win && win.navigator, o = { /** * Internet Explorer version number or 0. Example: 6 * @property ie * @type float * @static */ ie: 0, /** * Opera version number or 0. Example: 9.2 * @property opera * @type float * @static */ opera: 0, /** * Gecko engine revision number. Will evaluate to 1 if Gecko * is detected but the revision could not be found. Other browsers * will be 0. Example: 1.8 * <pre> * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7 * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8 * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81 * Firefox 3.0 <-- 1.9 * Firefox 3.5 <-- 1.91 * </pre> * @property gecko * @type float * @static */ gecko: 0, /** * AppleWebKit version. KHTML browsers that are not WebKit browsers * will evaluate to 1, other browsers 0. Example: 418.9 * <pre> * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the * latest available for Mac OSX 10.3. * Safari 2.0.2: 416 <-- hasOwnProperty introduced * Safari 2.0.4: 418 <-- preventDefault fixed * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run * different versions of webkit * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been * updated, but not updated * to the latest patch. * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native * SVG and many major issues fixed). * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic * update from 2.x via the 10.4.11 OS patch. * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event. * yahoo.com user agent hack removed. * </pre> * http://en.wikipedia.org/wiki/Safari_version_history * @property webkit * @type float * @static */ webkit: 0, /** * Safari will be detected as webkit, but this property will also * be populated with the Safari version number * @property safari * @type float * @static */ safari: 0, /** * Chrome will be detected as webkit, but this property will also * be populated with the Chrome version number * @property chrome * @type float * @static */ chrome: 0, /** * The mobile property will be set to a string containing any relevant * user agent information when a modern mobile browser is detected. * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series * devices with the WebKit-based browser, and Opera Mini. * @property mobile * @type string * @default null * @static */ mobile: null, /** * Adobe AIR version number or 0. Only populated if webkit is detected. * Example: 1.0 * @property air * @type float */ air: 0, /** * PhantomJS version number or 0. Only populated if webkit is detected. * Example: 1.0 * @property phantomjs * @type float */ phantomjs: 0, /** * Detects Apple iPad's OS version * @property ipad * @type float * @static */ ipad: 0, /** * Detects Apple iPhone's OS version * @property iphone * @type float * @static */ iphone: 0, /** * Detects Apples iPod's OS version * @property ipod * @type float * @static */ ipod: 0, /** * General truthy check for iPad, iPhone or iPod * @property ios * @type Boolean * @default null * @static */ ios: null, /** * Detects Googles Android OS version * @property android * @type float * @static */ android: 0, /** * Detects Kindle Silk * @property silk * @type float * @static */ silk: 0, /** * Detects Kindle Silk Acceleration * @property accel * @type Boolean * @static */ accel: false, /** * Detects Palms WebOS version * @property webos * @type float * @static */ webos: 0, /** * Google Caja version number or 0. * @property caja * @type float */ caja: nav && nav.cajaVersion, /** * Set to true if the page appears to be in SSL * @property secure * @type boolean * @static */ secure: false, /** * The operating system. Currently only detecting windows or macintosh * @property os * @type string * @default null * @static */ os: null, /** * The Nodejs Version * @property nodejs * @type float * @default 0 * @static */ nodejs: 0, /** * Window8/IE10 Application host environment * @property winjs * @type Boolean * @static */ winjs: !!((typeof Windows !== "undefined") && Windows.System), /** * Are touch/msPointer events available on this device * @property touchEnabled * @type Boolean * @static */ touchEnabled: false }, ua = subUA || nav && nav.userAgent, loc = win && win.location, href = loc && loc.href, m; /** * The User Agent string that was parsed * @property userAgent * @type String * @static */ o.userAgent = ua; o.secure = href && (href.toLowerCase().indexOf('https') === 0); if (ua) { if ((/windows|win32/i).test(ua)) { o.os = 'windows'; } else if ((/macintosh|mac_powerpc/i).test(ua)) { o.os = 'macintosh'; } else if ((/android/i).test(ua)) { o.os = 'android'; } else if ((/symbos/i).test(ua)) { o.os = 'symbos'; } else if ((/linux/i).test(ua)) { o.os = 'linux'; } else if ((/rhino/i).test(ua)) { o.os = 'rhino'; } // Modern KHTML browsers should qualify as Safari X-Grade if ((/KHTML/).test(ua)) { o.webkit = 1; } if ((/IEMobile|XBLWP7/).test(ua)) { o.mobile = 'windows'; } if ((/Fennec/).test(ua)) { o.mobile = 'gecko'; } // Modern WebKit browsers are at least X-Grade m = ua.match(/AppleWebKit\/([^\s]*)/); if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit; if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) { o.phantomjs = numberify(m[1]); } } // Mobile browser check if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) { o.mobile = 'Apple'; // iPhone or iPod Touch m = ua.match(/OS ([^\s]*)/); if (m && m[1]) { m = numberify(m[1].replace('_', '.')); } o.ios = m; o.os = 'ios'; o.ipad = o.ipod = o.iphone = 0; m = ua.match(/iPad|iPod|iPhone/); if (m && m[0]) { o[m[0].toLowerCase()] = o.ios; } } else { m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/); if (m) { // Nokia N-series, webOS, ex: NokiaN95 o.mobile = m[0]; } if (/webOS/.test(ua)) { o.mobile = 'WebOS'; m = ua.match(/webOS\/([^\s]*);/); if (m && m[1]) { o.webos = numberify(m[1]); } } if (/ Android/.test(ua)) { if (/Mobile/.test(ua)) { o.mobile = 'Android'; } m = ua.match(/Android ([^\s]*);/); if (m && m[1]) { o.android = numberify(m[1]); } } if (/Silk/.test(ua)) { m = ua.match(/Silk\/([^\s]*)\)/); if (m && m[1]) { o.silk = numberify(m[1]); } if (!o.android) { o.android = 2.34; //Hack for desktop mode in Kindle o.os = 'Android'; } if (/Accelerated=true/.test(ua)) { o.accel = true; } } } m = ua.match(/OPR\/(\d+\.\d+)/); if (m && m[1]) { // Opera 15+ with Blink (pretends to be both Chrome and Safari) o.opera = numberify(m[1]); } else { m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/); if (m && m[1] && m[2]) { o.chrome = numberify(m[2]); // Chrome o.safari = 0; //Reset safari back to 0 if (m[1] === 'CrMo') { o.mobile = 'chrome'; } } else { m = ua.match(/AdobeAIR\/([^\s]*)/); if (m) { o.air = m[0]; // Adobe AIR 1.0 or better } } } } if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr) if (/Opera/.test(ua)) { m = ua.match(/Opera[\s\/]([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); } m = ua.match(/Version\/([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); // opera 10+ } if (/Opera Mobi/.test(ua)) { o.mobile = 'opera'; m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); } } m = ua.match(/Opera Mini[^;]*/); if (m) { o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit m = ua.match(/MSIE ([^;]*)|Trident.*; rv ([0-9.]+)/); if (m && (m[1] || m[2])) { o.ie = numberify(m[1] || m[2]); } else { // not opera, webkit, or ie m = ua.match(/Gecko\/([^\s]*)/); if (m) { o.gecko = 1; // Gecko detected, look for revision m = ua.match(/rv:([^\s\)]*)/); if (m && m[1]) { o.gecko = numberify(m[1]); if (/Mobile|Tablet/.test(ua)) { o.mobile = "ffos"; } } } } } } } //Check for known properties to tell if touch events are enabled on this device or if //the number of MSPointer touchpoints on this device is greater than 0. if (win && nav && !(o.chrome && o.chrome < 6)) { o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0))); } //It was a parsed UA, do not assign the global value. if (!subUA) { if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS o.os = process.platform; o.nodejs = numberify(process.versions.node); } } YUI.Env.UA = o; } return o; }; Y.UA = YUI.Env.UA || YUI.Env.parseUA(); /** Performs a simple comparison between two version numbers, accounting for standard versioning logic such as the fact that "535.8" is a lower version than "535.24", even though a simple numerical comparison would indicate that it's greater. Also accounts for cases such as "1.1" vs. "1.1.0", which are considered equivalent. Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent, 1 if _a_ is higher than _b_. Versions may be numbers or strings containing numbers and dots. For example, both `535` and `"535.8.10"` are acceptable. A version string containing non-numeric characters, like `"535.8.beta"`, may produce unexpected results. @method compareVersions @param {Number|String} a First version number to compare. @param {Number|String} b Second version number to compare. @return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is higher than _b_. **/ Y.UA.compareVersions = function (a, b) { var aPart, aParts, bPart, bParts, i, len; if (a === b) { return 0; } aParts = (a + '').split('.'); bParts = (b + '').split('.'); for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) { aPart = parseInt(aParts[i], 10); bPart = parseInt(bParts[i], 10); /*jshint expr: true*/ isNaN(aPart) && (aPart = 0); isNaN(bPart) && (bPart = 0); if (aPart < bPart) { return -1; } if (aPart > bPart) { return 1; } } return 0; }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"], "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "attribute-events": ["attribute-observable"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"], "axes": ["axis-numeric","axis-category","axis-time","axis-stacked"], "axes-base": ["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"], "base": ["base-base","base-pluginhost","base-build"], "cache": ["cache-base","cache-offline","cache-plugin"], "charts": ["charts-base"], "collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"], "color": ["color-base","color-hsl","color-harmony"], "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-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatype": ["datatype-date","datatype-number","datatype-xml"], "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "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-tap"], "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"], "template": ["template-base","template-micro"], "text": ["text-accentfold","text-wordbreak"], "widget": ["widget-base","widget-htmlparser","widget-skin","widget-uievents"] }; }, '@VERSION@', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */ /** Provides dynamic loading of remote JavaScript and CSS resources. @module get @class Get @static **/ var Lang = Y.Lang, CUSTOM_ATTRS, // defined lazily in Y.Get.Transaction._createNode() Get, Transaction; Y.Get = Get = { // -- Public Properties ---------------------------------------------------- /** Default options for CSS requests. Options specified here will override global defaults for CSS requests. See the `options` property for all available options. @property cssOptions @type Object @static @since 3.5.0 **/ cssOptions: { attributes: { rel: 'stylesheet' }, doc : Y.config.linkDoc || Y.config.doc, pollInterval: 50 }, /** Default options for JS requests. Options specified here will override global defaults for JS requests. See the `options` property for all available options. @property jsOptions @type Object @static @since 3.5.0 **/ jsOptions: { autopurge: true, doc : Y.config.scriptDoc || Y.config.doc }, /** Default options to use for all requests. Note that while all available options are documented here for ease of discovery, some options (like callback functions) only make sense at the transaction level. Callback functions specified via the options object or the `options` parameter of the `css()`, `js()`, or `load()` methods will receive the transaction object as a parameter. See `Y.Get.Transaction` for details on the properties and methods available on transactions. @static @since 3.5.0 @property {Object} options @property {Boolean} [options.async=false] Whether or not to load scripts asynchronously, meaning they're requested in parallel and execution order is not guaranteed. Has no effect on CSS, since CSS is always loaded asynchronously. @property {Object} [options.attributes] HTML attribute name/value pairs that should be added to inserted nodes. By default, the `charset` attribute will be set to "utf-8" and nodes will be given an auto-generated `id` attribute, but you can override these with your own values if desired. @property {Boolean} [options.autopurge] Whether or not to automatically purge inserted nodes after the purge threshold is reached. This is `true` by default for JavaScript, but `false` for CSS since purging a CSS node will also remove any styling applied by the referenced file. @property {Object} [options.context] `this` object to use when calling callback functions. Defaults to the transaction object. @property {Mixed} [options.data] Arbitrary data object to pass to "on*" callbacks. @property {Document} [options.doc] Document into which nodes should be inserted. By default, the current document is used. @property {HTMLElement|String} [options.insertBefore] HTML element or id string of an element before which all generated nodes should be inserted. If not specified, Get will automatically determine the best place to insert nodes for maximum compatibility. @property {Function} [options.onEnd] Callback to execute after a transaction is complete, regardless of whether it succeeded or failed. @property {Function} [options.onFailure] Callback to execute after a transaction fails, times out, or is aborted. @property {Function} [options.onProgress] Callback to execute after each individual request in a transaction either succeeds or fails. @property {Function} [options.onSuccess] Callback to execute after a transaction completes successfully with no errors. Note that in browsers that don't support the `error` event on CSS `<link>` nodes, a failed CSS request may still be reported as a success because in these browsers it can be difficult or impossible to distinguish between success and failure for CSS resources. @property {Function} [options.onTimeout] Callback to execute after a transaction times out. @property {Number} [options.pollInterval=50] Polling interval (in milliseconds) for detecting CSS load completion in browsers that don't support the `load` event on `<link>` nodes. This isn't used for JavaScript. @property {Number} [options.purgethreshold=20] Number of nodes to insert before triggering an automatic purge when `autopurge` is `true`. @property {Number} [options.timeout] Number of milliseconds to wait before aborting a transaction. When a timeout occurs, the `onTimeout` callback is called, followed by `onFailure` and finally `onEnd`. By default, there is no timeout. @property {String} [options.type] Resource type ("css" or "js"). This option is set automatically by the `css()` and `js()` functions and will be ignored there, but may be useful when using the `load()` function. If not specified, the type will be inferred from the URL, defaulting to "js" if the URL doesn't contain a recognizable file extension. **/ options: { attributes: { charset: 'utf-8' }, purgethreshold: 20 }, // -- Protected Properties ------------------------------------------------- /** Regex that matches a CSS URL. Used to guess the file type when it's not specified. @property REGEX_CSS @type RegExp @final @protected @static @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i, /** Regex that matches a JS URL. Used to guess the file type when it's not specified. @property REGEX_JS @type RegExp @final @protected @static @since 3.5.0 **/ REGEX_JS : /\.js(?:[?;].*)?$/i, /** Contains information about the current environment, such as what script and link injection features it supports. This object is created and populated the first time the `_getEnv()` method is called. @property _env @type Object @protected @static @since 3.5.0 **/ /** Mapping of document _yuid strings to <head> or <base> node references so we don't have to look the node up each time we want to insert a request node. @property _insertCache @type Object @protected @static @since 3.5.0 **/ _insertCache: {}, /** Information about the currently pending transaction, if any. This is actually an object with two properties: `callback`, containing the optional callback passed to `css()`, `load()`, or `js()`; and `transaction`, containing the actual transaction instance. @property _pending @type Object @protected @static @since 3.5.0 **/ _pending: null, /** HTML nodes eligible to be purged next time autopurge is triggered. @property _purgeNodes @type HTMLElement[] @protected @static @since 3.5.0 **/ _purgeNodes: [], /** Queued transactions and associated callbacks. @property _queue @type Object[] @protected @static @since 3.5.0 **/ _queue: [], // -- Public Methods ------------------------------------------------------- /** Aborts the specified transaction. This will cause the transaction's `onFailure` callback to be called and will prevent any new script and link nodes from being added to the document, but any resources that have already been requested will continue loading (there's no safe way to prevent this, unfortunately). *Note:* This method is deprecated as of 3.5.0, and will be removed in a future version of YUI. Use the transaction-level `abort()` method instead. @method abort @param {Get.Transaction} transaction Transaction to abort. @deprecated Use the `abort()` method on the transaction instead. @static **/ abort: function (transaction) { var i, id, item, len, pending; Y.log('`Y.Get.abort()` is deprecated as of 3.5.0. Use the `abort()` method on the transaction instead.', 'warn', 'get'); if (!transaction.abort) { id = transaction; pending = this._pending; transaction = null; if (pending && pending.transaction.id === id) { transaction = pending.transaction; this._pending = null; } else { for (i = 0, len = this._queue.length; i < len; ++i) { item = this._queue[i].transaction; if (item.id === id) { transaction = item; this._queue.splice(i, 1); break; } } } } transaction && transaction.abort(); }, /** Loads one or more CSS files. The _urls_ parameter may be provided as a URL string, a request object, or an array of URL strings and/or request objects. A request object is just an object that contains a `url` property and zero or more options that should apply specifically to that request. Request-specific options take priority over transaction-level options and default options. URLs may be relative or absolute, and do not have to have the same origin as the current page. The `options` parameter may be omitted completely and a callback passed in its place, if desired. @example // Load a single CSS file and log a message on completion. Y.Get.css('foo.css', function (err) { if (err) { Y.log('foo.css failed to load!'); } else { Y.log('foo.css was loaded successfully'); } }); // Load multiple CSS files and log a message when all have finished // loading. var urls = ['foo.css', 'http://example.com/bar.css', 'baz/quux.css']; Y.Get.css(urls, function (err) { if (err) { Y.log('one or more files failed to load!'); } else { Y.log('all files loaded successfully'); } }); // Specify transaction-level options, which will apply to all requests // within the transaction. Y.Get.css(urls, { attributes: {'class': 'my-css'}, timeout : 5000 }); // Specify per-request options, which override transaction-level and // default options. Y.Get.css([ {url: 'foo.css', attributes: {id: 'foo'}}, {url: 'bar.css', attributes: {id: 'bar', charset: 'iso-8859-1'}} ]); @method css @param {String|Object|Array} urls URL string, request object, or array of URLs and/or request objects to load. @param {Object} [options] Options for this transaction. See the `Y.Get.options` property for a complete list of available options. @param {Function} [callback] Callback function to be called on completion. This is a general callback and will be called before any more granular callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options` object. @param {Array|null} callback.err Array of errors that occurred during the transaction, or `null` on success. @param {Get.Transaction} callback.transaction Transaction object. @return {Get.Transaction} Transaction object. @static **/ css: function (urls, options, callback) { return this._load('css', urls, options, callback); }, /** Loads one or more JavaScript resources. The _urls_ parameter may be provided as a URL string, a request object, or an array of URL strings and/or request objects. A request object is just an object that contains a `url` property and zero or more options that should apply specifically to that request. Request-specific options take priority over transaction-level options and default options. URLs may be relative or absolute, and do not have to have the same origin as the current page. The `options` parameter may be omitted completely and a callback passed in its place, if desired. Scripts will be executed in the order they're specified unless the `async` option is `true`, in which case they'll be loaded in parallel and executed in whatever order they finish loading. @example // Load a single JS file and log a message on completion. Y.Get.js('foo.js', function (err) { if (err) { Y.log('foo.js failed to load!'); } else { Y.log('foo.js was loaded successfully'); } }); // Load multiple JS files, execute them in order, and log a message when // all have finished loading. var urls = ['foo.js', 'http://example.com/bar.js', 'baz/quux.js']; Y.Get.js(urls, function (err) { if (err) { Y.log('one or more files failed to load!'); } else { Y.log('all files loaded successfully'); } }); // Specify transaction-level options, which will apply to all requests // within the transaction. Y.Get.js(urls, { attributes: {'class': 'my-js'}, timeout : 5000 }); // Specify per-request options, which override transaction-level and // default options. Y.Get.js([ {url: 'foo.js', attributes: {id: 'foo'}}, {url: 'bar.js', attributes: {id: 'bar', charset: 'iso-8859-1'}} ]); @method js @param {String|Object|Array} urls URL string, request object, or array of URLs and/or request objects to load. @param {Object} [options] Options for this transaction. See the `Y.Get.options` property for a complete list of available options. @param {Function} [callback] Callback function to be called on completion. This is a general callback and will be called before any more granular callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options` object. @param {Array|null} callback.err Array of errors that occurred during the transaction, or `null` on success. @param {Get.Transaction} callback.transaction Transaction object. @return {Get.Transaction} Transaction object. @since 3.5.0 @static **/ js: function (urls, options, callback) { return this._load('js', urls, options, callback); }, /** Loads one or more CSS and/or JavaScript resources in the same transaction. Use this method when you want to load both CSS and JavaScript in a single transaction and be notified when all requested URLs have finished loading, regardless of type. Behavior and options are the same as for the `css()` and `js()` methods. If a resource type isn't specified in per-request options or transaction-level options, Get will guess the file type based on the URL's extension (`.css` or `.js`, with or without a following query string). If the file type can't be guessed from the URL, a warning will be logged and Get will assume the URL is a JavaScript resource. @example // Load both CSS and JS files in a single transaction, and log a message // when all files have finished loading. Y.Get.load(['foo.css', 'bar.js', 'baz.css'], function (err) { if (err) { Y.log('one or more files failed to load!'); } else { Y.log('all files loaded successfully'); } }); @method load @param {String|Object|Array} urls URL string, request object, or array of URLs and/or request objects to load. @param {Object} [options] Options for this transaction. See the `Y.Get.options` property for a complete list of available options. @param {Function} [callback] Callback function to be called on completion. This is a general callback and will be called before any more granular callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options` object. @param {Array|null} err Array of errors that occurred during the transaction, or `null` on success. @param {Get.Transaction} Transaction object. @return {Get.Transaction} Transaction object. @since 3.5.0 @static **/ load: function (urls, options, callback) { return this._load(null, urls, options, callback); }, // -- Protected Methods ---------------------------------------------------- /** Triggers an automatic purge if the purge threshold has been reached. @method _autoPurge @param {Number} threshold Purge threshold to use, in milliseconds. @protected @since 3.5.0 @static **/ _autoPurge: function (threshold) { if (threshold && this._purgeNodes.length >= threshold) { Y.log('autopurge triggered after ' + this._purgeNodes.length + ' nodes', 'info', 'get'); this._purge(this._purgeNodes); } }, /** Populates the `_env` property with information about the current environment. @method _getEnv @return {Object} Environment information. @protected @since 3.5.0 @static **/ _getEnv: function () { var doc = Y.config.doc, ua = Y.UA; // Note: some of these checks require browser sniffs since it's not // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = { // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes // IE10 doesn't return true for the MDN feature test, so setting it explicitly, // because it is async by default, and allows you to disable async by setting it to false async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10), // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected // link node finishes loading. This is currently true for IE, Opera, // Firefox 9+, and WebKit 535.24+. Note that IE versions <9 fire the // DOM 0 "onload" event, but not "load". All versions of IE fire // "onload". // davglass: Seems that Chrome on Android needs this to be false. cssLoad: ( (!ua.gecko && !ua.webkit) || ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0 ) && !(ua.chrome && ua.chrome <= 18), // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution. preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, _getTransaction: function (urls, options) { var requests = [], i, len, req, url; if (!Lang.isArray(urls)) { urls = [urls]; } options = Y.merge(this.options, options); // Clone the attributes object so we don't end up modifying it by ref. options.attributes = Y.merge(this.options.attributes, options.attributes); for (i = 0, len = urls.length; i < len; ++i) { url = urls[i]; req = {attributes: {}}; // If `url` is a string, we create a URL object for it, then mix in // global options and request-specific options. If it's an object // with a "url" property, we assume it's a request object containing // URL-specific options. if (typeof url === 'string') { req.url = url; } else if (url.url) { // URL-specific options override both global defaults and // request-specific options. Y.mix(req, url, false, null, 0, true); url = url.url; // Make url a string so we can use it later. } else { Y.log('URL must be a string or an object with a `url` property.', 'error', 'get'); continue; } Y.mix(req, options, false, null, 0, true); // If we didn't get an explicit type for this URL either in the // request options or the URL-specific options, try to determine // one from the file extension. if (!req.type) { if (this.REGEX_CSS.test(url)) { req.type = 'css'; } else { if (!this.REGEX_JS.test(url)) { Y.log("Can't guess file type from URL. Assuming JS: " + url, 'warn', 'get'); } req.type = 'js'; } } // Mix in type-specific default options, but don't overwrite any // options that have already been set. Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions, false, null, 0, true); // Give the node an id attribute if it doesn't already have one. req.attributes.id || (req.attributes.id = Y.guid()); // Backcompat for <3.5.0 behavior. if (req.win) { Y.log('The `win` option is deprecated as of 3.5.0. Use `doc` instead.', 'warn', 'get'); req.doc = req.win.document; } else { req.win = req.doc.defaultView || req.doc.parentWindow; } if (req.charset) { Y.log('The `charset` option is deprecated as of 3.5.0. Set `attributes.charset` instead.', 'warn', 'get'); req.attributes.charset = req.charset; } requests.push(req); } return new Transaction(requests, options); }, _load: function (type, urls, options, callback) { var transaction; // Allow callback as third param. if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); options.type = type; options._onFinish = Get._onTransactionFinish; if (!this._env) { this._getEnv(); } transaction = this._getTransaction(urls, options); this._queue.push({ callback : callback, transaction: transaction }); this._next(); return transaction; }, _onTransactionFinish : function() { Get._pending = null; Get._next(); }, _next: function () { var item; if (this._pending) { return; } item = this._queue.shift(); if (item) { this._pending = item; item.transaction.execute(item.callback); } }, _purge: function (nodes) { var purgeNodes = this._purgeNodes, isTransaction = nodes !== purgeNodes, index, node; while (node = nodes.pop()) { // assignment // Don't purge nodes that haven't finished loading (or errored out), // since this can hang the transaction. if (!node._yuiget_finished) { continue; } node.parentNode && node.parentNode.removeChild(node); // If this is a transaction-level purge and this node also exists in // the Get-level _purgeNodes array, we need to remove it from // _purgeNodes to avoid creating a memory leak. The indexOf lookup // sucks, but until we get WeakMaps, this is the least troublesome // way to do this (we can't just hold onto node ids because they may // not be in the same document). if (isTransaction) { index = Y.Array.indexOf(purgeNodes, node); if (index > -1) { purgeNodes.splice(index, 1); } } } } }; /** Alias for `js()`. @method script @static **/ Get.script = Get.js; /** Represents a Get transaction, which may contain requests for one or more JS or CSS files. This class should not be instantiated manually. Instances will be created and returned as needed by Y.Get's `css()`, `js()`, and `load()` methods. @class Get.Transaction @constructor @since 3.5.0 **/ Get.Transaction = Transaction = function (requests, options) { var self = this; self.id = Transaction._lastId += 1; self.data = options.data; self.errors = []; self.nodes = []; self.options = options; self.requests = requests; self._callbacks = []; // callbacks to call after execution finishes self._queue = []; self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead. self.win = options.win || Y.config.win; }; /** Arbitrary data object associated with this transaction. This object comes from the options passed to `Get.css()`, `Get.js()`, or `Get.load()`, and will be `undefined` if no data object was specified. @property {Object} data **/ /** Array of errors that have occurred during this transaction, if any. @since 3.5.0 @property {Object[]} errors @property {String} errors.error Error message. @property {Object} errors.request Request object related to the error. **/ /** Numeric id for this transaction, unique among all transactions within the same YUI sandbox in the current pageview. @property {Number} id @since 3.5.0 **/ /** HTMLElement nodes (native ones, not YUI Node instances) that have been inserted during the current transaction. @property {HTMLElement[]} nodes **/ /** Options associated with this transaction. See `Get.options` for the full list of available options. @property {Object} options @since 3.5.0 **/ /** Request objects contained in this transaction. Each request object represents one CSS or JS URL that will be (or has been) requested and loaded into the page. @property {Object} requests @since 3.5.0 **/ /** Id of the most recent transaction. @property _lastId @type Number @protected @static **/ Transaction._lastId = 0; Transaction.prototype = { // -- Public Properties ---------------------------------------------------- /** Current state of this transaction. One of "new", "executing", or "done". @property _state @type String @protected **/ _state: 'new', // "new", "executing", or "done" // -- Public Methods ------------------------------------------------------- /** Aborts this transaction. This will cause the transaction's `onFailure` callback to be called and will prevent any new script and link nodes from being added to the document, but any resources that have already been requested will continue loading (there's no safe way to prevent this, unfortunately). @method abort @param {String} [msg="Aborted."] Optional message to use in the `errors` array describing why the transaction was aborted. **/ abort: function (msg) { this._pending = null; this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = []; this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish(); }, /** Begins execting the transaction. There's usually no reason to call this manually, since Get will call it automatically when other pending transactions have finished. If you really want to execute your transaction before Get does, you can, but be aware that this transaction's scripts may end up executing before the scripts in other pending transactions. If the transaction is already executing, the specified callback (if any) will be queued and called after execution finishes. If the transaction has already finished, the callback will be called immediately (the transaction will not be executed again). @method execute @param {Function} callback Callback function to execute after all requests in the transaction are complete, or after the transaction is aborted. **/ execute: function (callback) { var self = this, requests = self.requests, state = self._state, i, len, queue, req; if (state === 'done') { callback && callback(self.errors.length ? self.errors : null, self); return; } else { callback && self._callbacks.push(callback); if (state === 'executing') { return; } } self._state = 'executing'; self._queue = queue = []; if (self.options.timeout) { self._timeout = setTimeout(function () { self.abort('Timeout'); }, self.options.timeout); } self._reqsWaiting = requests.length; for (i = 0, len = requests.length; i < len; ++i) { req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS. self._insert(req); } else { queue.push(req); } } self._next(); }, /** Manually purges any `<script>` or `<link>` nodes this transaction has created. Be careful when purging a transaction that contains CSS requests, since removing `<link>` nodes will also remove any styles they applied. @method purge **/ purge: function () { Get._purge(this.nodes); }, // -- Protected Methods ---------------------------------------------------- _createNode: function (name, attrs, doc) { var node = doc.createElement(name), attr, testEl; if (!CUSTOM_ATTRS) { // IE6 and IE7 expect property names rather than attribute names for // certain attributes. Rather than sniffing, we do a quick feature // test the first time _createNode() runs to determine whether we // need to provide a workaround. testEl = doc.createElement('div'); testEl.setAttribute('class', 'a'); CUSTOM_ATTRS = testEl.className === 'a' ? {} : { 'for' : 'htmlFor', 'class': 'className' }; } for (attr in attrs) { if (attrs.hasOwnProperty(attr)) { node.setAttribute(CUSTOM_ATTRS[attr] || attr, attrs[attr]); } } return node; }, _finish: function () { var errors = this.errors.length ? this.errors : null, options = this.options, thisObj = options.context || this, data, i, len; if (this._state === 'done') { return; } this._state = 'done'; for (i = 0, len = this._callbacks.length; i < len; ++i) { this._callbacks[i].call(thisObj, errors, this); } data = this._getEventData(); if (errors) { if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') { options.onTimeout.call(thisObj, data); } if (options.onFailure) { options.onFailure.call(thisObj, data); } } else if (options.onSuccess) { options.onSuccess.call(thisObj, data); } if (options.onEnd) { options.onEnd.call(thisObj, data); } if (options._onFinish) { options._onFinish(); } }, _getEventData: function (req) { if (req) { // This merge is necessary for backcompat. I hate it. return Y.merge(this, { abort : this.abort, // have to copy these because the prototype isn't preserved purge : this.purge, request: req, url : req.url, win : req.win }); } else { return this; } }, _getInsertBefore: function (req) { var doc = req.doc, el = req.insertBefore, cache, docStamp; if (el) { return typeof el === 'string' ? doc.getElementById(el) : el; } cache = Get._insertCache; docStamp = Y.stamp(doc); if ((el = cache[docStamp])) { // assignment return el; } // Inserting before a <base> tag apparently works around an IE bug // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what // bug that is, exactly. Better safe than sorry? if ((el = doc.getElementsByTagName('base')[0])) { // assignment return (cache[docStamp] = el); } // Look for a <head> element. el = doc.head || doc.getElementsByTagName('head')[0]; if (el) { // Create a marker node at the end of <head> to use as an insertion // point. Inserting before this node will ensure that all our CSS // gets inserted in the correct order, to maintain style precedence. el.appendChild(doc.createTextNode('')); return (cache[docStamp] = el.lastChild); } // If all else fails, just insert before the first script node on the // page, which is virtually guaranteed to exist. return (cache[docStamp] = doc.getElementsByTagName('script')[0]); }, _insert: function (req) { var env = Get._env, insertBefore = this._getInsertBefore(req), isScript = req.type === 'js', node = req.node, self = this, ua = Y.UA, cssTimeout, nodeType; if (!node) { if (isScript) { nodeType = 'script'; } else if (!env.cssLoad && ua.gecko) { nodeType = 'style'; } else { nodeType = 'link'; } node = req.node = this._createNode(nodeType, req.attributes, req.doc); } function onError() { self._progress('Failed to load ' + req.url, req); } function onLoad() { if (cssTimeout) { clearTimeout(cssTimeout); } self._progress(null, req); } // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url); if (req.async) { // Explicitly indicate that we want the browser to execute this // script asynchronously. This is necessary for older browsers // like Firefox <4. node.async = true; } else { if (env.async) { // This browser treats injected scripts as async by default // (standard HTML5 behavior) but asynchronous loading isn't // desired, so tell the browser not to mark this script as // async. node.async = false; } // If this browser doesn't preserve script execution order based // on insertion order, we'll need to avoid inserting other // scripts until this one finishes loading. if (!env.preservesScriptOrder) { this._pending = req; } } } else { if (!env.cssLoad && ua.gecko) { // In Firefox <9, we can import the requested URL into a <style> // node and poll for the existence of node.sheet.cssRules. This // gives us a reliable way to determine CSS load completion that // also works for cross-domain stylesheets. // // Props to Zach Leatherman for calling my attention to this // technique. node.innerHTML = (req.attributes.charset ? '@charset "' + req.attributes.charset + '";' : '') + '@import "' + req.url + '";'; } else { node.setAttribute('href', req.url); } } // Inject the node. if (isScript && ua.ie && (ua.ie < 9 || (document.documentMode && document.documentMode < 9))) { // Script on IE < 9, and IE 9+ when in IE 8 or older modes, including quirks mode. node.onreadystatechange = function () { if (/loaded|complete/.test(node.readyState)) { node.onreadystatechange = null; onLoad(); } }; } else if (!isScript && !env.cssLoad) { // CSS on Firefox <9 or WebKit. this._poll(req); } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs. if (ua.ie >= 10) { // We currently need to introduce a timeout for IE10, since it // calls onerror/onload synchronously for 304s - messing up existing // program flow. // Remove this block if the following bug gets fixed by GA /*jshint maxlen: 1500 */ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload node.onerror = function() { setTimeout(onError, 0); }; node.onload = function() { setTimeout(onLoad, 0); }; } else { node.onerror = onError; node.onload = onLoad; } // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) { cssTimeout = setTimeout(onError, req.timeout || 3000); } } this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); }, _next: function () { if (this._pending) { return; } // If there are requests in the queue, insert the next queued request. // Otherwise, if we're waiting on already-inserted requests to finish, // wait longer. If there are no queued requests and we're not waiting // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift()); } else if (!this._reqsWaiting) { this._finish(); } }, _poll: function (newReq) { var self = this, pendingCSS = self._pendingCSS, isWebKit = Y.UA.webkit, i, hasRules, j, nodeHref, req, sheets; if (newReq) { pendingCSS || (pendingCSS = self._pendingCSS = []); pendingCSS.push(newReq); if (self._pollTimer) { // A poll timeout is already pending, so no need to create a // new one. return; } } self._pollTimer = null; // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s // will still be treated as a success. There's no good workaround for // this. for (i = 0; i < pendingCSS.length; ++i) { req = pendingCSS[i]; if (isWebKit) { // Look for a stylesheet matching the pending URL. sheets = req.doc.styleSheets; j = sheets.length; nodeHref = req.node.href; while (--j >= 0) { if (sheets[j].href === nodeHref) { pendingCSS.splice(i, 1); i -= 1; self._progress(null, req); break; } } } else { // Many thanks to Zach Leatherman for calling my attention to // the @import-based cross-domain technique used here, and to // Oleg Slobodskoi for an earlier same-domain implementation. // // See Zach's blog for more details: // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/ try { // We don't really need to store this value since we never // use it again, but if we don't store it, Closure Compiler // assumes the code is useless and removes it. hasRules = !!req.node.sheet.cssRules; // If we get here, the stylesheet has loaded. pendingCSS.splice(i, 1); i -= 1; self._progress(null, req); } catch (ex) { // An exception means the stylesheet is still loading. } } } if (pendingCSS.length) { self._pollTimer = setTimeout(function () { self._poll.call(self); }, self.options.pollInterval); } }, _progress: function (err, req) { var options = this.options; if (err) { req.error = err; this.errors.push({ error : err, request: req }); Y.log(err, 'error', 'get'); } req.node._yuiget_finished = req.finished = true; if (options.onProgress) { options.onProgress.call(options.context || this, this._getEventData(req)); } if (req.autopurge) { // Pre-3.5.0 Get always excludes the most recent node from an // autopurge. I find this odd, but I'm keeping that behavior for // the sake of backcompat. Get._autoPurge(this.options.purgethreshold); Get._purgeNodes.push(req.node); } if (this._pending === req) { this._pending = null; } this._reqsWaiting -= 1; this._next(); } }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {}; /** Contains the core of YUI's feature test architecture. @module features */ /** * Feature detection * @class Features * @static */ Y.mix(Y.namespace('Features'), { /** * Object hash of all registered feature tests * @property tests * @type Object */ tests: feature_tests, /** * Add a test to the system * * ``` * Y.Features.add("load", "1", {}); * ``` * * @method add * @param {String} cat The category, right now only 'load' is supported * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3 * @param {Object} o Object containing test properties * @param {String} o.name The name of the test * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance * @param {String} o.trigger The module that triggers this test. */ add: function(cat, name, o) { feature_tests[cat] = feature_tests[cat] || {}; feature_tests[cat][name] = o; }, /** * Execute all tests of a given category and return the serialized results * * ``` * caps=1:1;2:1;3:0 * ``` * @method all * @param {String} cat The category to execute * @param {Array} args The arguments to pass to the test function * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0 */ all: function(cat, args) { var cat_o = feature_tests[cat], // results = {}; result = []; if (cat_o) { Y.Object.each(cat_o, function(v, k) { result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0)); }); } return (result.length) ? result.join(';') : ''; }, /** * Run a sepecific test and return a Boolean response. * * ``` * Y.Features.test("load", "1"); * ``` * * @method test * @param {String} cat The category of the test to run * @param {String} name The name of the test to run * @param {Array} args The arguments to pass to the test function * @return {Boolean} True or false if the test passed/failed. */ test: function(cat, name, args) { args = args || []; var result, ua, test, cat_o = feature_tests[cat], feature = cat_o && cat_o[name]; if (!feature) { Y.log('Feature test ' + cat + ', ' + name + ' not found'); } else { result = feature.result; if (Y.Lang.isUndefined(result)) { ua = feature.ua; if (ua) { result = (Y.UA[ua]); } test = feature.test; if (test && ((!ua) || result)) { result = test.apply(Y, args); } feature.result = result; } } return result; } }); // Y.Features.add("load", "1", {}); // Y.Features.test("load", "1"); // caps=1:1;2:0;3:1; /* This file is auto-generated by (yogi loader --yes --mix --start ../) */ /*jshint maxlen:900, eqeqeq: false */ var add = Y.Features.add; // app-transitions-native add('load', '0', { "name": "app-transitions-native", "test": function (Y) { var doc = Y.config.doc, node = doc ? doc.documentElement : null; if (node && node.style) { return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false; }, "trigger": "app-transitions" }); // autocomplete-list-keys add('load', '1', { "name": "autocomplete-list-keys", "test": function (Y) { // Only add keyboard support to autocomplete-list if this doesn't appear to // be an iOS or Android-based mobile device. // // There's currently no feasible way to actually detect whether a device has // a hardware keyboard, so this sniff will have to do. It can easily be // overridden by manually loading the autocomplete-list-keys module. // // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari // doesn't fire the keyboard events used by AutoCompleteList, so there's // no point loading the -keys module even when a bluetooth keyboard may be // available. return !(Y.UA.ios || Y.UA.android); }, "trigger": "autocomplete-list" }); // dd-gestures add('load', '2', { "name": "dd-gestures", "trigger": "dd-drag", "ua": "touchEnabled" }); // dom-style-ie add('load', '3', { "name": "dom-style-ie", "test": function (Y) { var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win, DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', ret = false; addFeature('style', 'computedStyle', { test: function() { return WINDOW && 'getComputedStyle' in WINDOW; } }); addFeature('style', 'opacity', { test: function() { return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); return ret; }, "trigger": "dom-style" }); // editor-para-ie add('load', '4', { "name": "editor-para-ie", "trigger": "editor-para", "ua": "ie", "when": "instead" }); // event-base-ie add('load', '5', { "name": "event-base-ie", "test": function(Y) { var imp = Y.config.doc && Y.config.doc.implementation; return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }); // graphics-canvas add('load', '6', { "name": "graphics-canvas", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-canvas-default add('load', '7', { "name": "graphics-canvas-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-svg add('load', '8', { "name": "graphics-svg", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // graphics-svg-default add('load', '9', { "name": "graphics-svg-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // graphics-vml add('load', '10', { "name": "graphics-vml", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // graphics-vml-default add('load', '11', { "name": "graphics-vml-default", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // history-hash-ie add('load', '12', { "name": "history-hash-ie", "test": function (Y) { var docMode = Y.config.doc && Y.config.doc.documentMode; return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }); // io-nodejs add('load', '13', { "name": "io-nodejs", "trigger": "io-base", "ua": "nodejs" }); // json-parse-shim add('load', '14', { "name": "json-parse-shim", "test": function (Y) { var _JSON = Y.config.global.JSON, Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, nativeSupport = Y.config.useNativeJSONParse !== false && !!Native; function workingNative( k, v ) { return k === "ok" ? true : v; } // Double check basic functionality. This is mainly to catch early broken // implementations of the JSON API in Firefox 3.1 beta1 and beta2 if ( nativeSupport ) { try { nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok; } catch ( e ) { nativeSupport = false; } } return !nativeSupport; }, "trigger": "json-parse" }); // json-stringify-shim add('load', '15', { "name": "json-stringify-shim", "test": function (Y) { var _JSON = Y.config.global.JSON, Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native; // Double check basic native functionality. This is primarily to catch broken // early JSON API implementations in Firefox 3.1 beta1 and beta2. if ( nativeSupport ) { try { nativeSupport = ( '0' === Native.stringify(0) ); } catch ( e ) { nativeSupport = false; } } return !nativeSupport; }, "trigger": "json-stringify" }); // scrollview-base-ie add('load', '16', { "name": "scrollview-base-ie", "trigger": "scrollview-base", "ua": "ie" }); // selector-css2 add('load', '17', { "name": "selector-css2", "test": function (Y) { var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); return ret; }, "trigger": "selector" }); // transition-timer add('load', '18', { "name": "transition-timer", "test": function (Y) { var DOCUMENT = Y.config.doc, node = (DOCUMENT) ? DOCUMENT.documentElement: null, ret = true; if (node && node.style) { ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return ret; }, "trigger": "transition" }); // widget-base-ie add('load', '19', { "name": "widget-base-ie", "trigger": "widget-base", "ua": "ie" }); // yql-jsonp add('load', '20', { "name": "yql-jsonp", "test": function (Y) { /* Only load the JSONP module when not in nodejs or winjs TODO Make the winjs module a CORS module */ return (!Y.UA.nodejs && !Y.UA.winjs); }, "trigger": "yql", "when": "after" }); // yql-nodejs add('load', '21', { "name": "yql-nodejs", "trigger": "yql", "ua": "nodejs", "when": "after" }); // yql-winjs add('load', '22', { "name": "yql-winjs", "trigger": "yql", "ua": "winjs", "when": "after" }); }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /** * The Intl utility provides a central location for managing sets of * localized resources (strings and formatting patterns). * * @class Intl * @uses EventTarget * @static */ var SPLIT_REGEX = /[, ]/; Y.mix(Y.namespace('Intl'), { /** * Returns the language among those available that * best matches the preferred language list, using the Lookup * algorithm of BCP 47. * If none of the available languages meets the user's preferences, * then "" is returned. * Extended language ranges are not supported. * * @method lookupBestLang * @param {String[] | String} preferredLanguages The list of preferred * languages in descending preference order, represented as BCP 47 * language tags. A string array or a comma-separated list. * @param {String[]} availableLanguages The list of languages * that the application supports, represented as BCP 47 language * tags. * * @return {String} The available language that best matches the * preferred language list, or "". * @since 3.1.0 */ lookupBestLang: function(preferredLanguages, availableLanguages) { var i, language, result, index; // check whether the list of available languages contains language; // if so return it function scan(language) { var i; for (i = 0; i < availableLanguages.length; i += 1) { if (language.toLowerCase() === availableLanguages[i].toLowerCase()) { return availableLanguages[i]; } } } if (Y.Lang.isString(preferredLanguages)) { preferredLanguages = preferredLanguages.split(SPLIT_REGEX); } for (i = 0; i < preferredLanguages.length; i += 1) { language = preferredLanguages[i]; if (!language || language === '*') { continue; } // check the fallback sequence for one language while (language.length > 0) { result = scan(language); if (result) { return result; } else { index = language.lastIndexOf('-'); if (index >= 0) { language = language.substring(0, index); // one-character subtags get cut along with the // following subtag if (index >= 2 && language.charAt(index - 2) === '-') { language = language.substring(0, index - 2); } } else { // nothing available for this language break; } } } } return ''; } }); }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /** * Provides console log capability and exposes a custom event for * console implementations. This module is a `core` YUI module, * <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>. * * @module yui * @submodule yui-log */ var INSTANCE = Y, LOGEVENT = 'yui:log', UNDEFINED = 'undefined', LEVELS = { debug: 1, info: 2, warn: 4, error: 8 }; /** * If the 'debug' config is true, a 'yui:log' event will be * dispatched, which the Console widget and anything else * can consume. If the 'useBrowserConsole' config is true, it will * write to the browser console if available. YUI-specific log * messages will only be present in the -debug versions of the * JS files. The build system is supposed to remove log statements * from the raw and minified versions of the files. * * @method log * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.log = function(msg, cat, src, silent) { var bail, excl, incl, m, f, minlevel, Y = INSTANCE, c = Y.config, publisher = (Y.fire) ? Y : YUI.Env.globalEvents; // suppress log message if the config is off or the event stack // or the event call stack contains a consumer of the yui:log event if (c.debug) { // apply source filters src = src || ""; if (typeof src !== "undefined") { excl = c.logExclude; incl = c.logInclude; if (incl && !(src in incl)) { bail = 1; } else if (incl && (src in incl)) { bail = !incl[src]; } else if (excl && (src in excl)) { bail = excl[src]; } // Determine the current minlevel as defined in configuration Y.config.logLevel = Y.config.logLevel || 'debug'; minlevel = LEVELS[Y.config.logLevel.toLowerCase()]; if (cat in LEVELS && LEVELS[cat] < minlevel) { // Skip this message if the we don't meet the defined minlevel bail = 1; } } if (!bail) { if (c.useBrowserConsole) { m = (src) ? src + ': ' + msg : msg; if (Y.Lang.isFunction(c.logFn)) { c.logFn.call(Y, msg, cat, src); } else if (typeof console !== UNDEFINED && console.log) { f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log'; console[f](m); } else if (typeof opera !== UNDEFINED) { opera.postError(m); } } if (publisher && !silent) { if (publisher === Y && (!publisher.getEvent(LOGEVENT))) { publisher.publish(LOGEVENT, { broadcast: 2 }); } publisher.fire(LOGEVENT, { msg: msg, cat: cat, src: src }); } } } return Y; }; /** * Write a system message. This message will be preserved in the * minified and raw versions of the YUI files, unlike log statements. * @method message * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.message = function() { return INSTANCE.log.apply(INSTANCE, arguments); }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /** * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, * <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>. * * @module yui * @submodule yui-later */ var NO_ARGS = []; /** * Executes the supplied function in the context of the supplied * object 'when' milliseconds later. Executes the function a * single time unless periodic is set to true. * @for YUI * @method later * @param when {int} the number of milliseconds to wait until the fn * is executed. * @param o the context object. * @param fn {Function|String} the function to execute or the name of * the method in the 'o' object to execute. * @param data [Array] data that is provided to the function. This * accepts either a single item or an array. If an array is provided, * the function is executed with one parameter for each array item. * If you need to pass a single array parameter, it needs to be wrapped * in an array [myarray]. * * Note: native methods in IE may not have the call and apply methods. * In this case, it will work, but you are limited to four arguments. * * @param periodic {boolean} if true, executes continuously at supplied * interval until canceled. * @return {object} a timer object. Call the cancel() method on this * object to stop the timer. */ Y.later = function(when, o, fn, data, periodic) { when = when || 0; data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS; o = o || Y.config.win || Y; var cancelled = false, method = (o && Y.Lang.isString(fn)) ? o[fn] : fn, wrapper = function() { // IE 8- may execute a setInterval callback one last time // after clearInterval was called, so in order to preserve // the cancel() === no more runny-run, we have to jump through // an extra hoop. if (!cancelled) { if (!method.apply) { method(data[0], data[1], data[2], data[3]); } else { method.apply(o, data || NO_ARGS); } } }, id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when); return { id: id, interval: periodic, cancel: function() { cancelled = true; if (this.interval) { clearInterval(id); } else { clearTimeout(id); } } }; }; Y.Lang.later = Y.later; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('yui', function (Y, NAME) {}, '@VERSION@', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('oop', function (Y, NAME) { /** Adds object inheritance and manipulation utilities to the YUI instance. This module is required by most YUI components. @module oop **/ var L = Y.Lang, A = Y.Array, OP = Object.prototype, CLONE_MARKER = '_~yuim~_', hasOwn = OP.hasOwnProperty, toString = OP.toString; function dispatch(o, f, c, proto, action) { if (o && o[action] && o !== Y) { return o[action].call(o, f, c); } else { switch (A.test(o)) { case 1: return A[action](o, f, c); case 2: return A[action](Y.Array(o, 0, true), f, c); default: return Y.Object[action](o, f, c, proto); } } } /** Augments the _receiver_ with prototype properties from the _supplier_. The receiver may be a constructor function or an object. The supplier must be a constructor function. If the _receiver_ is an object, then the _supplier_ constructor will be called immediately after _receiver_ is augmented, with _receiver_ as the `this` object. If the _receiver_ is a constructor function, then all prototype methods of _supplier_ that are copied to _receiver_ will be sequestered, and the _supplier_ constructor will not be called immediately. The first time any sequestered method is called on the _receiver_'s prototype, all sequestered methods will be immediately copied to the _receiver_'s prototype, the _supplier_'s constructor will be executed, and finally the newly unsequestered method that was called will be executed. This sequestering logic sounds like a bunch of complicated voodoo, but it makes it cheap to perform frequent augmentation by ensuring that suppliers' constructors are only called if a supplied method is actually used. If none of the supplied methods is ever used, then there's no need to take the performance hit of calling the _supplier_'s constructor. @method augment @param {Function|Object} receiver Object or function to be augmented. @param {Function} supplier Function that supplies the prototype properties with which to augment the _receiver_. @param {Boolean} [overwrite=false] If `true`, properties already on the receiver will be overwritten if found on the supplier's prototype. @param {String[]} [whitelist] An array of property names. If specified, only the whitelisted prototype properties will be applied to the receiver, and all others will be ignored. @param {Array|any} [args] Argument or array of arguments to pass to the supplier's constructor when initializing. @return {Function} Augmented object. @for YUI **/ Y.augment = function (receiver, supplier, overwrite, whitelist, args) { var rProto = receiver.prototype, sequester = rProto && supplier, sProto = supplier.prototype, to = rProto || receiver, copy, newPrototype, replacements, sequestered, unsequester; args = args ? Y.Array(args) : []; if (sequester) { newPrototype = {}; replacements = {}; sequestered = {}; copy = function (value, key) { if (overwrite || !(key in rProto)) { if (toString.call(value) === '[object Function]') { sequestered[key] = value; newPrototype[key] = replacements[key] = function () { return unsequester(this, value, arguments); }; } else { newPrototype[key] = value; } } }; unsequester = function (instance, fn, fnArgs) { // Unsequester all sequestered functions. for (var key in sequestered) { if (hasOwn.call(sequestered, key) && instance[key] === replacements[key]) { instance[key] = sequestered[key]; } } // Execute the supplier constructor. supplier.apply(instance, args); // Finally, execute the original sequestered function. return fn.apply(instance, fnArgs); }; if (whitelist) { Y.Array.each(whitelist, function (name) { if (name in sProto) { copy(sProto[name], name); } }); } else { Y.Object.each(sProto, copy, null, true); } } Y.mix(to, newPrototype || sProto, overwrite, whitelist); if (!sequester) { supplier.apply(to, args); } return receiver; }; /** * Copies object properties from the supplier to the receiver. If the target has * the property, and the property is an object, the target object will be * augmented with the supplier's value. * * @method aggregate * @param {Object} receiver Object to receive the augmentation. * @param {Object} supplier Object that supplies the properties with which to * augment the receiver. * @param {Boolean} [overwrite=false] If `true`, properties already on the receiver * will be overwritten if found on the supplier. * @param {String[]} [whitelist] Whitelist. If supplied, only properties in this * list will be applied to the receiver. * @return {Object} Augmented object. */ Y.aggregate = function(r, s, ov, wl) { return Y.mix(r, s, ov, wl, 0, true); }; /** * Utility to set up the prototype, constructor and superclass properties to * support an inheritance strategy that can chain constructors and methods. * Static members will not be inherited. * * @method extend * @param {function} r the object to modify. * @param {function} s the object to inherit. * @param {object} px prototype properties to add/override. * @param {object} sx static properties to add/override. * @return {object} the extended object. */ Y.extend = function(r, s, px, sx) { if (!s || !r) { Y.error('extend failed, verify dependencies'); } var sp = s.prototype, rp = Y.Object(sp); r.prototype = rp; rp.constructor = r; r.superclass = sp; // assign constructor property if (s != Object && sp.constructor == OP.constructor) { sp.constructor = s; } // add prototype overrides if (px) { Y.mix(rp, px, true); } // add object overrides if (sx) { Y.mix(r, sx, true); } return r; }; /** * Executes the supplied function for each item in * a collection. Supports arrays, objects, and * NodeLists * @method each * @param {object} o the object to iterate. * @param {function} f the function to execute. This function * receives the value, key, and object as parameters. * @param {object} c the execution context for the function. * @param {boolean} proto if true, prototype properties are * iterated on objects. * @return {YUI} the YUI instance. */ Y.each = function(o, f, c, proto) { return dispatch(o, f, c, proto, 'each'); }; /** * Executes the supplied function for each item in * a collection. The operation stops if the function * returns true. Supports arrays, objects, and * NodeLists. * @method some * @param {object} o the object to iterate. * @param {function} f the function to execute. This function * receives the value, key, and object as parameters. * @param {object} c the execution context for the function. * @param {boolean} proto if true, prototype properties are * iterated on objects. * @return {boolean} true if the function ever returns true, * false otherwise. */ Y.some = function(o, f, c, proto) { return dispatch(o, f, c, proto, 'some'); }; /** Deep object/array copy. Function clones are actually wrappers around the original function. Array-like objects are treated as arrays. Primitives are returned untouched. Optionally, a function can be provided to handle other data types, filter keys, validate values, etc. **Note:** Cloning a non-trivial object is a reasonably heavy operation, due to the need to recursively iterate down non-primitive properties. Clone should be used only when a deep clone down to leaf level properties is explicitly required. This method will also In many cases (for example, when trying to isolate objects used as hashes for configuration properties), a shallow copy, using `Y.merge()` is normally sufficient. If more than one level of isolation is required, `Y.merge()` can be used selectively at each level which needs to be isolated from the original without going all the way to leaf properties. @method clone @param {object} o what to clone. @param {boolean} safe if true, objects will not have prototype items from the source. If false, they will. In this case, the original is initially protected, but the clone is not completely immune from changes to the source object prototype. Also, cloned prototype items that are deleted from the clone will result in the value of the source prototype being exposed. If operating on a non-safe clone, items should be nulled out rather than deleted. @param {function} f optional function to apply to each item in a collection; it will be executed prior to applying the value to the new object. Return false to prevent the copy. @param {object} c optional execution context for f. @param {object} owner Owner object passed when clone is iterating an object. Used to set up context for cloned functions. @param {object} cloned hash of previously cloned objects to avoid multiple clones. @return {Array|Object} the cloned object. **/ Y.clone = function(o, safe, f, c, owner, cloned) { var o2, marked, stamp; // Does not attempt to clone: // // * Non-typeof-object values, "primitive" values don't need cloning. // // * YUI instances, cloning complex object like YUI instances is not // advised, this is like cloning the world. // // * DOM nodes (#2528250), common host objects like DOM nodes cannot be // "subclassed" in Firefox and old versions of IE. Trying to use // `Object.create()` or `Y.extend()` on a DOM node will throw an error in // these browsers. // // Instad, the passed-in `o` will be return as-is when it matches one of the // above criteria. if (!L.isObject(o) || Y.instanceOf(o, YUI) || (o.addEventListener || o.attachEvent)) { return o; } marked = cloned || {}; switch (L.type(o)) { case 'date': return new Date(o); case 'regexp': // if we do this we need to set the flags too // return new RegExp(o.source); return o; case 'function': // o2 = Y.bind(o, owner); // break; return o; case 'array': o2 = []; break; default: // #2528250 only one clone of a given object should be created. if (o[CLONE_MARKER]) { return marked[o[CLONE_MARKER]]; } stamp = Y.guid(); o2 = (safe) ? {} : Y.Object(o); o[CLONE_MARKER] = stamp; marked[stamp] = o; } Y.each(o, function(v, k) { if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) { if (k !== CLONE_MARKER) { if (k == 'prototype') { // skip the prototype // } else if (o[k] === o) { // this[k] = this; } else { this[k] = Y.clone(v, safe, f, c, owner || o, marked); } } } }, o2); if (!cloned) { Y.Object.each(marked, function(v, k) { if (v[CLONE_MARKER]) { try { delete v[CLONE_MARKER]; } catch (e) { v[CLONE_MARKER] = null; } } }, this); marked = null; } return o2; }; /** * Returns a function that will execute the supplied function in the * supplied object's context, optionally adding any additional * supplied parameters to the beginning of the arguments collection the * supplied to the function. * * @method bind * @param {Function|String} f the function to bind, or a function name * to execute on the context object. * @param {object} c the execution context. * @param {any} args* 0..n arguments to include before the arguments the * function is executed with. * @return {function} the wrapped function. */ Y.bind = function(f, c) { var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null; return function() { var fn = L.isString(f) ? c[f] : f, args = (xargs) ? xargs.concat(Y.Array(arguments, 0, true)) : arguments; return fn.apply(c || fn, args); }; }; /** * Returns a function that will execute the supplied function in the * supplied object's context, optionally adding any additional * supplied parameters to the end of the arguments the function * is executed with. * * @method rbind * @param {Function|String} f the function to bind, or a function name * to execute on the context object. * @param {object} c the execution context. * @param {any} args* 0..n arguments to append to the end of * arguments collection supplied to the function. * @return {function} the wrapped function. */ Y.rbind = function(f, c) { var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null; return function() { var fn = L.isString(f) ? c[f] : f, args = (xargs) ? Y.Array(arguments, 0, true).concat(xargs) : arguments; return fn.apply(c || fn, args); }; }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {}; /** Contains the core of YUI's feature test architecture. @module features */ /** * Feature detection * @class Features * @static */ Y.mix(Y.namespace('Features'), { /** * Object hash of all registered feature tests * @property tests * @type Object */ tests: feature_tests, /** * Add a test to the system * * ``` * Y.Features.add("load", "1", {}); * ``` * * @method add * @param {String} cat The category, right now only 'load' is supported * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3 * @param {Object} o Object containing test properties * @param {String} o.name The name of the test * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance * @param {String} o.trigger The module that triggers this test. */ add: function(cat, name, o) { feature_tests[cat] = feature_tests[cat] || {}; feature_tests[cat][name] = o; }, /** * Execute all tests of a given category and return the serialized results * * ``` * caps=1:1;2:1;3:0 * ``` * @method all * @param {String} cat The category to execute * @param {Array} args The arguments to pass to the test function * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0 */ all: function(cat, args) { var cat_o = feature_tests[cat], // results = {}; result = []; if (cat_o) { Y.Object.each(cat_o, function(v, k) { result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0)); }); } return (result.length) ? result.join(';') : ''; }, /** * Run a sepecific test and return a Boolean response. * * ``` * Y.Features.test("load", "1"); * ``` * * @method test * @param {String} cat The category of the test to run * @param {String} name The name of the test to run * @param {Array} args The arguments to pass to the test function * @return {Boolean} True or false if the test passed/failed. */ test: function(cat, name, args) { args = args || []; var result, ua, test, cat_o = feature_tests[cat], feature = cat_o && cat_o[name]; if (!feature) { Y.log('Feature test ' + cat + ', ' + name + ' not found'); } else { result = feature.result; if (Y.Lang.isUndefined(result)) { ua = feature.ua; if (ua) { result = (Y.UA[ua]); } test = feature.test; if (test && ((!ua) || result)) { result = test.apply(Y, args); } feature.result = result; } } return result; } }); // Y.Features.add("load", "1", {}); // Y.Features.test("load", "1"); // caps=1:1;2:0;3:1; /* This file is auto-generated by (yogi loader --yes --mix --start ../) */ /*jshint maxlen:900, eqeqeq: false */ var add = Y.Features.add; // app-transitions-native add('load', '0', { "name": "app-transitions-native", "test": function (Y) { var doc = Y.config.doc, node = doc ? doc.documentElement : null; if (node && node.style) { return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false; }, "trigger": "app-transitions" }); // autocomplete-list-keys add('load', '1', { "name": "autocomplete-list-keys", "test": function (Y) { // Only add keyboard support to autocomplete-list if this doesn't appear to // be an iOS or Android-based mobile device. // // There's currently no feasible way to actually detect whether a device has // a hardware keyboard, so this sniff will have to do. It can easily be // overridden by manually loading the autocomplete-list-keys module. // // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari // doesn't fire the keyboard events used by AutoCompleteList, so there's // no point loading the -keys module even when a bluetooth keyboard may be // available. return !(Y.UA.ios || Y.UA.android); }, "trigger": "autocomplete-list" }); // dd-gestures add('load', '2', { "name": "dd-gestures", "trigger": "dd-drag", "ua": "touchEnabled" }); // dom-style-ie add('load', '3', { "name": "dom-style-ie", "test": function (Y) { var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win, DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', ret = false; addFeature('style', 'computedStyle', { test: function() { return WINDOW && 'getComputedStyle' in WINDOW; } }); addFeature('style', 'opacity', { test: function() { return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); return ret; }, "trigger": "dom-style" }); // editor-para-ie add('load', '4', { "name": "editor-para-ie", "trigger": "editor-para", "ua": "ie", "when": "instead" }); // event-base-ie add('load', '5', { "name": "event-base-ie", "test": function(Y) { var imp = Y.config.doc && Y.config.doc.implementation; return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }); // graphics-canvas add('load', '6', { "name": "graphics-canvas", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-canvas-default add('load', '7', { "name": "graphics-canvas-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-svg add('load', '8', { "name": "graphics-svg", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // graphics-svg-default add('load', '9', { "name": "graphics-svg-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // graphics-vml add('load', '10', { "name": "graphics-vml", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // graphics-vml-default add('load', '11', { "name": "graphics-vml-default", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // history-hash-ie add('load', '12', { "name": "history-hash-ie", "test": function (Y) { var docMode = Y.config.doc && Y.config.doc.documentMode; return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }); // io-nodejs add('load', '13', { "name": "io-nodejs", "trigger": "io-base", "ua": "nodejs" }); // json-parse-shim add('load', '14', { "name": "json-parse-shim", "test": function (Y) { var _JSON = Y.config.global.JSON, Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, nativeSupport = Y.config.useNativeJSONParse !== false && !!Native; function workingNative( k, v ) { return k === "ok" ? true : v; } // Double check basic functionality. This is mainly to catch early broken // implementations of the JSON API in Firefox 3.1 beta1 and beta2 if ( nativeSupport ) { try { nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok; } catch ( e ) { nativeSupport = false; } } return !nativeSupport; }, "trigger": "json-parse" }); // json-stringify-shim add('load', '15', { "name": "json-stringify-shim", "test": function (Y) { var _JSON = Y.config.global.JSON, Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native; // Double check basic native functionality. This is primarily to catch broken // early JSON API implementations in Firefox 3.1 beta1 and beta2. if ( nativeSupport ) { try { nativeSupport = ( '0' === Native.stringify(0) ); } catch ( e ) { nativeSupport = false; } } return !nativeSupport; }, "trigger": "json-stringify" }); // scrollview-base-ie add('load', '16', { "name": "scrollview-base-ie", "trigger": "scrollview-base", "ua": "ie" }); // selector-css2 add('load', '17', { "name": "selector-css2", "test": function (Y) { var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); return ret; }, "trigger": "selector" }); // transition-timer add('load', '18', { "name": "transition-timer", "test": function (Y) { var DOCUMENT = Y.config.doc, node = (DOCUMENT) ? DOCUMENT.documentElement: null, ret = true; if (node && node.style) { ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return ret; }, "trigger": "transition" }); // widget-base-ie add('load', '19', { "name": "widget-base-ie", "trigger": "widget-base", "ua": "ie" }); // yql-jsonp add('load', '20', { "name": "yql-jsonp", "test": function (Y) { /* Only load the JSONP module when not in nodejs or winjs TODO Make the winjs module a CORS module */ return (!Y.UA.nodejs && !Y.UA.winjs); }, "trigger": "yql", "when": "after" }); // yql-nodejs add('load', '21', { "name": "yql-nodejs", "trigger": "yql", "ua": "nodejs", "when": "after" }); // yql-winjs add('load', '22', { "name": "yql-winjs", "trigger": "yql", "ua": "winjs", "when": "after" }); }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('dom-core', function (Y, NAME) { var NODE_TYPE = 'nodeType', OWNER_DOCUMENT = 'ownerDocument', DOCUMENT_ELEMENT = 'documentElement', DEFAULT_VIEW = 'defaultView', PARENT_WINDOW = 'parentWindow', TAG_NAME = 'tagName', PARENT_NODE = 'parentNode', PREVIOUS_SIBLING = 'previousSibling', NEXT_SIBLING = 'nextSibling', CONTAINS = 'contains', COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition', EMPTY_ARRAY = [], // IE < 8 throws on node.contains(textNode) supportsContainsTextNode = (function() { var node = Y.config.doc.createElement('div'), textNode = node.appendChild(Y.config.doc.createTextNode('')), result = false; try { result = node.contains(textNode); } catch(e) {} return result; })(), /** * The DOM utility provides a cross-browser abtraction layer * normalizing DOM tasks, and adds extra helper functionality * for other common tasks. * @module dom * @main dom * @submodule dom-base * @for DOM * */ /** * Provides DOM helper methods. * @class DOM * */ Y_DOM = { /** * Returns the HTMLElement with the given ID (Wrapper for document.getElementById). * @method byId * @param {String} id the id attribute * @param {Object} doc optional The document to search. Defaults to current document * @return {HTMLElement | null} The HTMLElement with the id, or null if none found. */ byId: function(id, doc) { // handle dupe IDs and IE name collision return Y_DOM.allById(id, doc)[0] || null; }, getId: function(node) { var id; // HTMLElement returned from FORM when INPUT name === "id" // IE < 8: HTMLCollection returned when INPUT id === "id" // via both getAttribute and form.id if (node.id && !node.id.tagName && !node.id.item) { id = node.id; } else if (node.attributes && node.attributes.id) { id = node.attributes.id.value; } return id; }, setId: function(node, id) { if (node.setAttribute) { node.setAttribute('id', id); } else { node.id = id; } }, /* * Finds the ancestor of the element. * @method ancestor * @param {HTMLElement} element The html element. * @param {Function} fn optional An optional boolean test to apply. * The optional function is passed the current DOM node being tested as its only argument. * If no function is given, the parentNode is returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @return {HTMLElement | null} The matching DOM node or null if none found. */ ancestor: function(element, fn, testSelf, stopFn) { var ret = null; if (testSelf) { ret = (!fn || fn(element)) ? element : null; } return ret || Y_DOM.elementByAxis(element, PARENT_NODE, fn, null, stopFn); }, /* * Finds the ancestors of the element. * @method ancestors * @param {HTMLElement} element The html element. * @param {Function} fn optional An optional boolean test to apply. * The optional function is passed the current DOM node being tested as its only argument. * If no function is given, all ancestors are returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @return {Array} An array containing all matching DOM nodes. */ ancestors: function(element, fn, testSelf, stopFn) { var ancestor = element, ret = []; while ((ancestor = Y_DOM.ancestor(ancestor, fn, testSelf, stopFn))) { testSelf = false; if (ancestor) { ret.unshift(ancestor); if (stopFn && stopFn(ancestor)) { return ret; } } } return ret; }, /** * Searches the element by the given axis for the first matching element. * @method elementByAxis * @param {HTMLElement} element The html element. * @param {String} axis The axis to search (parentNode, nextSibling, previousSibling). * @param {Function} fn optional An optional boolean test to apply. * @param {Boolean} all optional Whether all node types should be returned, or just element nodes. * The optional function is passed the current HTMLElement being tested as its only argument. * If no function is given, the first element is returned. * @return {HTMLElement | null} The matching element or null if none found. */ elementByAxis: function(element, axis, fn, all, stopAt) { while (element && (element = element[axis])) { // NOTE: assignment if ( (all || element[TAG_NAME]) && (!fn || fn(element)) ) { return element; } if (stopAt && stopAt(element)) { return null; } } return null; }, /** * Determines whether or not one HTMLElement is or contains another HTMLElement. * @method contains * @param {HTMLElement} element The containing html element. * @param {HTMLElement} needle The html element that may be contained. * @return {Boolean} Whether or not the element is or contains the needle. */ contains: function(element, needle) { var ret = false; if ( !needle || !element || !needle[NODE_TYPE] || !element[NODE_TYPE]) { ret = false; } else if (element[CONTAINS] && // IE < 8 throws on node.contains(textNode) so fall back to brute. // Falling back for other nodeTypes as well. (needle[NODE_TYPE] === 1 || supportsContainsTextNode)) { ret = element[CONTAINS](needle); } else if (element[COMPARE_DOCUMENT_POSITION]) { // Match contains behavior (node.contains(node) === true). // Needed for Firefox < 4. if (element === needle || !!(element[COMPARE_DOCUMENT_POSITION](needle) & 16)) { ret = true; } } else { ret = Y_DOM._bruteContains(element, needle); } return ret; }, /** * Determines whether or not the HTMLElement is part of the document. * @method inDoc * @param {HTMLElement} element The containing html element. * @param {HTMLElement} doc optional The document to check. * @return {Boolean} Whether or not the element is attached to the document. */ inDoc: function(element, doc) { var ret = false, rootNode; if (element && element.nodeType) { (doc) || (doc = element[OWNER_DOCUMENT]); rootNode = doc[DOCUMENT_ELEMENT]; // contains only works with HTML_ELEMENT if (rootNode && rootNode.contains && element.tagName) { ret = rootNode.contains(element); } else { ret = Y_DOM.contains(rootNode, element); } } return ret; }, allById: function(id, root) { root = root || Y.config.doc; var nodes = [], ret = [], i, node; if (root.querySelectorAll) { ret = root.querySelectorAll('[id="' + id + '"]'); } else if (root.all) { nodes = root.all(id); if (nodes) { // root.all may return HTMLElement or HTMLCollection. // some elements are also HTMLCollection (FORM, SELECT). if (nodes.nodeName) { if (nodes.id === id) { // avoid false positive on name ret.push(nodes); nodes = EMPTY_ARRAY; // done, no need to filter } else { // prep for filtering nodes = [nodes]; } } if (nodes.length) { // filter out matches on node.name // and element.id as reference to element with id === 'id' for (i = 0; node = nodes[i++];) { if (node.id === id || (node.attributes && node.attributes.id && node.attributes.id.value === id)) { ret.push(node); } } } } } else { ret = [Y_DOM._getDoc(root).getElementById(id)]; } return ret; }, isWindow: function(obj) { return !!(obj && obj.scrollTo && obj.document); }, _removeChildNodes: function(node) { while (node.firstChild) { node.removeChild(node.firstChild); } }, siblings: function(node, fn) { var nodes = [], sibling = node; while ((sibling = sibling[PREVIOUS_SIBLING])) { if (sibling[TAG_NAME] && (!fn || fn(sibling))) { nodes.unshift(sibling); } } sibling = node; while ((sibling = sibling[NEXT_SIBLING])) { if (sibling[TAG_NAME] && (!fn || fn(sibling))) { nodes.push(sibling); } } return nodes; }, /** * Brute force version of contains. * Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc). * @method _bruteContains * @private * @param {HTMLElement} element The containing html element. * @param {HTMLElement} needle The html element that may be contained. * @return {Boolean} Whether or not the element is or contains the needle. */ _bruteContains: function(element, needle) { while (needle) { if (element === needle) { return true; } needle = needle.parentNode; } return false; }, // TODO: move to Lang? /** * Memoizes dynamic regular expressions to boost runtime performance. * @method _getRegExp * @private * @param {String} str The string to convert to a regular expression. * @param {String} flags optional An optinal string of flags. * @return {RegExp} An instance of RegExp */ _getRegExp: function(str, flags) { flags = flags || ''; Y_DOM._regexCache = Y_DOM._regexCache || {}; if (!Y_DOM._regexCache[str + flags]) { Y_DOM._regexCache[str + flags] = new RegExp(str, flags); } return Y_DOM._regexCache[str + flags]; }, // TODO: make getDoc/Win true privates? /** * returns the appropriate document. * @method _getDoc * @private * @param {HTMLElement} element optional Target element. * @return {Object} The document for the given element or the default document. */ _getDoc: function(element) { var doc = Y.config.doc; if (element) { doc = (element[NODE_TYPE] === 9) ? element : // element === document element[OWNER_DOCUMENT] || // element === DOM node element.document || // element === window Y.config.doc; // default } return doc; }, /** * returns the appropriate window. * @method _getWin * @private * @param {HTMLElement} element optional Target element. * @return {Object} The window for the given element or the default window. */ _getWin: function(element) { var doc = Y_DOM._getDoc(element); return doc[DEFAULT_VIEW] || doc[PARENT_WINDOW] || Y.config.win; }, _batch: function(nodes, fn, arg1, arg2, arg3, etc) { fn = (typeof fn === 'string') ? Y_DOM[fn] : fn; var result, i = 0, node, ret; if (fn && nodes) { while ((node = nodes[i++])) { result = result = fn.call(Y_DOM, node, arg1, arg2, arg3, etc); if (typeof result !== 'undefined') { (ret) || (ret = []); ret.push(result); } } } return (typeof ret !== 'undefined') ? ret : nodes; }, generateID: function(el) { var id = el.id; if (!id) { id = Y.stamp(el); el.id = id; } return id; } }; Y.DOM = Y_DOM; }, '@VERSION@', {"requires": ["oop", "features"]}); YUI.add('dom-base', function (Y, NAME) { /** * @for DOM * @module dom */ var documentElement = Y.config.doc.documentElement, Y_DOM = Y.DOM, TAG_NAME = 'tagName', OWNER_DOCUMENT = 'ownerDocument', EMPTY_STRING = '', addFeature = Y.Features.add, testFeature = Y.Features.test; Y.mix(Y_DOM, { /** * Returns the text content of the HTMLElement. * @method getText * @param {HTMLElement} element The html element. * @return {String} The text content of the element (includes text of any descending elements). */ getText: (documentElement.textContent !== undefined) ? function(element) { var ret = ''; if (element) { ret = element.textContent; } return ret || ''; } : function(element) { var ret = ''; if (element) { ret = element.innerText || element.nodeValue; // might be a textNode } return ret || ''; }, /** * Sets the text content of the HTMLElement. * @method setText * @param {HTMLElement} element The html element. * @param {String} content The content to add. */ setText: (documentElement.textContent !== undefined) ? function(element, content) { if (element) { element.textContent = content; } } : function(element, content) { if ('innerText' in element) { element.innerText = content; } else if ('nodeValue' in element) { element.nodeValue = content; } }, CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8 'for': 'htmlFor', 'class': 'className' } : { // w3c 'htmlFor': 'for', 'className': 'class' }, /** * Provides a normalized attribute interface. * @method setAttribute * @param {HTMLElement} el The target element for the attribute. * @param {String} attr The attribute to set. * @param {String} val The value of the attribute. */ setAttribute: function(el, attr, val, ieAttr) { if (el && attr && el.setAttribute) { attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr; el.setAttribute(attr, val, ieAttr); } else { Y.log('bad input to setAttribute', 'warn', 'dom'); } }, /** * Provides a normalized attribute interface. * @method getAttribute * @param {HTMLElement} el The target element for the attribute. * @param {String} attr The attribute to get. * @return {String} The current value of the attribute. */ getAttribute: function(el, attr, ieAttr) { ieAttr = (ieAttr !== undefined) ? ieAttr : 2; var ret = ''; if (el && attr && el.getAttribute) { attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr; ret = el.getAttribute(attr, ieAttr); if (ret === null) { ret = ''; // per DOM spec } } else { Y.log('bad input to getAttribute', 'warn', 'dom'); } return ret; }, VALUE_SETTERS: {}, VALUE_GETTERS: {}, getValue: function(node) { var ret = '', // TODO: return null? getter; if (node && node[TAG_NAME]) { getter = Y_DOM.VALUE_GETTERS[node[TAG_NAME].toLowerCase()]; if (getter) { ret = getter(node); } else { ret = node.value; } } // workaround for IE8 JSON stringify bug // which converts empty string values to null if (ret === EMPTY_STRING) { ret = EMPTY_STRING; // for real } return (typeof ret === 'string') ? ret : ''; }, setValue: function(node, val) { var setter; if (node && node[TAG_NAME]) { setter = Y_DOM.VALUE_SETTERS[node[TAG_NAME].toLowerCase()]; if (setter) { setter(node, val); } else { node.value = val; } } }, creators: {} }); addFeature('value-set', 'select', { test: function() { var node = Y.config.doc.createElement('select'); node.innerHTML = '<option>1</option><option>2</option>'; node.value = '2'; return (node.value && node.value === '2'); } }); if (!testFeature('value-set', 'select')) { Y_DOM.VALUE_SETTERS.select = function(node, val) { for (var i = 0, options = node.getElementsByTagName('option'), option; option = options[i++];) { if (Y_DOM.getValue(option) === val) { option.selected = true; //Y_DOM.setAttribute(option, 'selected', 'selected'); break; } } }; } Y.mix(Y_DOM.VALUE_GETTERS, { button: function(node) { return (node.attributes && node.attributes.value) ? node.attributes.value.value : ''; } }); Y.mix(Y_DOM.VALUE_SETTERS, { // IE: node.value changes the button text, which should be handled via innerHTML button: function(node, val) { var attr = node.attributes.value; if (!attr) { attr = node[OWNER_DOCUMENT].createAttribute('value'); node.setAttributeNode(attr); } attr.value = val; } }); Y.mix(Y_DOM.VALUE_GETTERS, { option: function(node) { var attrs = node.attributes; return (attrs.value && attrs.value.specified) ? node.value : node.text; }, select: function(node) { var val = node.value, options = node.options; if (options && options.length) { // TODO: implement multipe select if (node.multiple) { Y.log('multiple select normalization not implemented', 'warn', 'DOM'); } else if (node.selectedIndex > -1) { val = Y_DOM.getValue(options[node.selectedIndex]); } } return val; } }); var addClass, hasClass, removeClass; Y.mix(Y.DOM, { /** * Determines whether a DOM element has the given className. * @method hasClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to search for * @return {Boolean} Whether or not the element has the given class. */ hasClass: function(node, className) { var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)'); return re.test(node.className); }, /** * Adds a class name to a given DOM element. * @method addClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to add to the class attribute */ addClass: function(node, className) { if (!Y.DOM.hasClass(node, className)) { // skip if already present node.className = Y.Lang.trim([node.className, className].join(' ')); } }, /** * Removes a class name from a given element. * @method removeClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to remove from the class attribute */ removeClass: function(node, className) { if (className && hasClass(node, className)) { node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)'), ' ')); if ( hasClass(node, className) ) { // in case of multiple adjacent removeClass(node, className); } } }, /** * Replace a class with another class for a given element. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @for DOM * @param {HTMLElement} element The DOM element * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name */ replaceClass: function(node, oldC, newC) { //Y.log('replaceClass replacing ' + oldC + ' with ' + newC, 'info', 'Node'); removeClass(node, oldC); // remove first in case oldC === newC addClass(node, newC); }, /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @for DOM * @param {HTMLElement} element The DOM element * @param {String} className the class name to be toggled * @param {Boolean} addClass optional boolean to indicate whether class * should be added or removed regardless of current state */ toggleClass: function(node, className, force) { var add = (force !== undefined) ? force : !(hasClass(node, className)); if (add) { addClass(node, className); } else { removeClass(node, className); } } }); hasClass = Y.DOM.hasClass; removeClass = Y.DOM.removeClass; addClass = Y.DOM.addClass; var re_tag = /<([a-z]+)/i, Y_DOM = Y.DOM, addFeature = Y.Features.add, testFeature = Y.Features.test, creators = {}, createFromDIV = function(html, tag) { var div = Y.config.doc.createElement('div'), ret = true; div.innerHTML = html; if (!div.firstChild || div.firstChild.tagName !== tag.toUpperCase()) { ret = false; } return ret; }, re_tbody = /(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/, TABLE_OPEN = '<table>', TABLE_CLOSE = '</table>'; Y.mix(Y.DOM, { _fragClones: {}, _create: function(html, doc, tag) { tag = tag || 'div'; var frag = Y_DOM._fragClones[tag]; if (frag) { frag = frag.cloneNode(false); } else { frag = Y_DOM._fragClones[tag] = doc.createElement(tag); } frag.innerHTML = html; return frag; }, _children: function(node, tag) { var i = 0, children = node.children, childNodes, hasComments, child; if (children && children.tags) { // use tags filter when possible if (tag) { children = node.children.tags(tag); } else { // IE leaks comments into children hasComments = children.tags('!').length; } } if (!children || (!children.tags && tag) || hasComments) { childNodes = children || node.childNodes; children = []; while ((child = childNodes[i++])) { if (child.nodeType === 1) { if (!tag || tag === child.tagName) { children.push(child); } } } } return children || []; }, /** * Creates a new dom node using the provided markup string. * @method create * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {HTMLElement|DocumentFragment} returns a single HTMLElement * when creating one node, and a documentFragment when creating * multiple nodes. */ create: function(html, doc) { if (typeof html === 'string') { html = Y.Lang.trim(html); // match IE which trims whitespace from innerHTML } doc = doc || Y.config.doc; var m = re_tag.exec(html), create = Y_DOM._create, custom = creators, ret = null, creator, tag, nodes; if (html != undefined) { // not undefined or null if (m && m[1]) { creator = custom[m[1].toLowerCase()]; if (typeof creator === 'function') { create = creator; } else { tag = creator; } } nodes = create(html, doc, tag).childNodes; if (nodes.length === 1) { // return single node, breaking parentNode ref from "fragment" ret = nodes[0].parentNode.removeChild(nodes[0]); } else if (nodes[0] && nodes[0].className === 'yui3-big-dummy') { // using dummy node to preserve some attributes (e.g. OPTION not selected) if (nodes.length === 2) { ret = nodes[0].nextSibling; } else { nodes[0].parentNode.removeChild(nodes[0]); ret = Y_DOM._nl2frag(nodes, doc); } } else { // return multiple nodes as a fragment ret = Y_DOM._nl2frag(nodes, doc); } } return ret; }, _nl2frag: function(nodes, doc) { var ret = null, i, len; if (nodes && (nodes.push || nodes.item) && nodes[0]) { doc = doc || nodes[0].ownerDocument; ret = doc.createDocumentFragment(); if (nodes.item) { // convert live list to static array nodes = Y.Array(nodes, 0, true); } for (i = 0, len = nodes.length; i < len; i++) { ret.appendChild(nodes[i]); } } // else inline with log for minification return ret; }, /** * Inserts content in a node at the given location * @method addHTML * @param {HTMLElement} node The node to insert into * @param {HTMLElement | Array | HTMLCollection} content The content to be inserted * @param {HTMLElement} where Where to insert the content * If no "where" is given, content is appended to the node * Possible values for "where" * <dl> * <dt>HTMLElement</dt> * <dd>The element to insert before</dd> * <dt>"replace"</dt> * <dd>Replaces the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts before the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts content before the node</dd> * <dt>"after"</dt> * <dd>Inserts content after the node</dd> * </dl> */ addHTML: function(node, content, where) { var nodeParent = node.parentNode, i = 0, item, ret = content, newNode; if (content != undefined) { // not null or undefined (maybe 0) if (content.nodeType) { // DOM node, just add it newNode = content; } else if (typeof content == 'string' || typeof content == 'number') { ret = newNode = Y_DOM.create(content); } else if (content[0] && content[0].nodeType) { // array or collection newNode = Y.config.doc.createDocumentFragment(); while ((item = content[i++])) { newNode.appendChild(item); // append to fragment for insertion } } } if (where) { if (newNode && where.parentNode) { // insert regardless of relationship to node where.parentNode.insertBefore(newNode, where); } else { switch (where) { case 'replace': while (node.firstChild) { node.removeChild(node.firstChild); } if (newNode) { // allow empty content to clear node node.appendChild(newNode); } break; case 'before': if (newNode) { nodeParent.insertBefore(newNode, node); } break; case 'after': if (newNode) { if (node.nextSibling) { // IE errors if refNode is null nodeParent.insertBefore(newNode, node.nextSibling); } else { nodeParent.appendChild(newNode); } } break; default: if (newNode) { node.appendChild(newNode); } } } } else if (newNode) { node.appendChild(newNode); } return ret; }, wrap: function(node, html) { var parent = (html && html.nodeType) ? html : Y.DOM.create(html), nodes = parent.getElementsByTagName('*'); if (nodes.length) { parent = nodes[nodes.length - 1]; } if (node.parentNode) { node.parentNode.replaceChild(parent, node); } parent.appendChild(node); }, unwrap: function(node) { var parent = node.parentNode, lastChild = parent.lastChild, next = node, grandparent; if (parent) { grandparent = parent.parentNode; if (grandparent) { node = parent.firstChild; while (node !== lastChild) { next = node.nextSibling; grandparent.insertBefore(node, parent); node = next; } grandparent.replaceChild(lastChild, parent); } else { parent.removeChild(node); } } } }); addFeature('innerhtml', 'table', { test: function() { var node = Y.config.doc.createElement('table'); try { node.innerHTML = '<tbody></tbody>'; } catch(e) { return false; } return (node.firstChild && node.firstChild.nodeName === 'TBODY'); } }); addFeature('innerhtml-div', 'tr', { test: function() { return createFromDIV('<tr></tr>', 'tr'); } }); addFeature('innerhtml-div', 'script', { test: function() { return createFromDIV('<script></script>', 'script'); } }); if (!testFeature('innerhtml', 'table')) { // TODO: thead/tfoot with nested tbody // IE adds TBODY when creating TABLE elements (which may share this impl) creators.tbody = function(html, doc) { var frag = Y_DOM.create(TABLE_OPEN + html + TABLE_CLOSE, doc), tb = Y.DOM._children(frag, 'tbody')[0]; if (frag.children.length > 1 && tb && !re_tbody.test(html)) { tb.parentNode.removeChild(tb); // strip extraneous tbody } return frag; }; } if (!testFeature('innerhtml-div', 'script')) { creators.script = function(html, doc) { var frag = doc.createElement('div'); frag.innerHTML = '-' + html; frag.removeChild(frag.firstChild); return frag; }; creators.link = creators.style = creators.script; } if (!testFeature('innerhtml-div', 'tr')) { Y.mix(creators, { option: function(html, doc) { return Y_DOM.create('<select><option class="yui3-big-dummy" selected></option>' + html + '</select>', doc); }, tr: function(html, doc) { return Y_DOM.create('<tbody>' + html + '</tbody>', doc); }, td: function(html, doc) { return Y_DOM.create('<tr>' + html + '</tr>', doc); }, col: function(html, doc) { return Y_DOM.create('<colgroup>' + html + '</colgroup>', doc); }, tbody: 'table' }); Y.mix(creators, { legend: 'fieldset', th: creators.td, thead: creators.tbody, tfoot: creators.tbody, caption: creators.tbody, colgroup: creators.tbody, optgroup: creators.option }); } Y_DOM.creators = creators; Y.mix(Y.DOM, { /** * Sets the width of the element to the given size, regardless * of box model, border, padding, etc. * @method setWidth * @param {HTMLElement} element The DOM element. * @param {String|Number} size The pixel height to size to */ setWidth: function(node, size) { Y.DOM._setSize(node, 'width', size); }, /** * Sets the height of the element to the given size, regardless * of box model, border, padding, etc. * @method setHeight * @param {HTMLElement} element The DOM element. * @param {String|Number} size The pixel height to size to */ setHeight: function(node, size) { Y.DOM._setSize(node, 'height', size); }, _setSize: function(node, prop, val) { val = (val > 0) ? val : 0; var size = 0; node.style[prop] = val + 'px'; size = (prop === 'height') ? node.offsetHeight : node.offsetWidth; if (size > val) { val = val - (size - val); if (val < 0) { val = 0; } node.style[prop] = val + 'px'; } } }); }, '@VERSION@', {"requires": ["dom-core"]}); YUI.add('color-base', function (Y, NAME) { /** Color provides static methods for color conversion. Y.Color.toRGB('f00'); // rgb(255, 0, 0) Y.Color.toHex('rgb(255, 255, 0)'); // #ffff00 @module color @submodule color-base @class Color @since 3.8.0 **/ var REGEX_HEX = /^#?([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})(\ufffe)?/, REGEX_HEX3 = /^#?([\da-fA-F]{1})([\da-fA-F]{1})([\da-fA-F]{1})(\ufffe)?/, REGEX_RGB = /rgba?\(([\d]{1,3}), ?([\d]{1,3}), ?([\d]{1,3}),? ?([.\d]*)?\)/, TYPES = { 'HEX': 'hex', 'RGB': 'rgb', 'RGBA': 'rgba' }, CONVERTS = { 'hex': 'toHex', 'rgb': 'toRGB', 'rgba': 'toRGBA' }; Y.Color = { /** @static @property KEYWORDS @type Object @since 3.8.0 **/ 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' }, /** NOTE: `(\ufffe)?` is added to the Regular Expression to carve out a place for the alpha channel that is returned from toArray without compromising any usage of the Regular Expression @static @property REGEX_HEX @type RegExp @default /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})(\ufffe)?/ @since 3.8.0 **/ REGEX_HEX: REGEX_HEX, /** NOTE: `(\ufffe)?` is added to the Regular Expression to carve out a place for the alpha channel that is returned from toArray without compromising any usage of the Regular Expression @static @property REGEX_HEX3 @type RegExp @default /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})(\ufffe)?/ @since 3.8.0 **/ REGEX_HEX3: REGEX_HEX3, /** @static @property REGEX_RGB @type RegExp @default /rgba?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3}),? ?([.0-9]{1,3})?\)/ @since 3.8.0 **/ REGEX_RGB: REGEX_RGB, re_RGB: REGEX_RGB, re_hex: REGEX_HEX, re_hex3: REGEX_HEX3, /** @static @property STR_HEX @type String @default #{*}{*}{*} @since 3.8.0 **/ STR_HEX: '#{*}{*}{*}', /** @static @property STR_RGB @type String @default rgb({*}, {*}, {*}) @since 3.8.0 **/ STR_RGB: 'rgb({*}, {*}, {*})', /** @static @property STR_RGBA @type String @default rgba({*}, {*}, {*}, {*}) @since 3.8.0 **/ STR_RGBA: 'rgba({*}, {*}, {*}, {*})', /** @static @property TYPES @type Object @default {'rgb':'rgb', 'rgba':'rgba'} @since 3.8.0 **/ TYPES: TYPES, /** @static @property CONVERTS @type Object @default {} @since 3.8.0 **/ CONVERTS: CONVERTS, /** Converts the provided string to the provided type. You can use the `Y.Color.TYPES` to get a valid `to` type. If the color cannot be converted, the original color will be returned. @public @method convert @param {String} str @param {String} to @return {String} @since 3.8.0 **/ convert: function (str, to) { var convert = Y.Color.CONVERTS[to.toLowerCase()], clr = str; if (convert && Y.Color[convert]) { clr = Y.Color[convert](str); } return clr; }, /** Converts provided color value to a hex value string @public @method toHex @param {String} str Hex or RGB value string @return {String} returns array of values or CSS string if options.css is true @since 3.8.0 **/ toHex: function (str) { var clr = Y.Color._convertTo(str, 'hex'), isTransparent = clr.toLowerCase() === 'transparent'; if (clr.charAt(0) !== '#' && !isTransparent) { clr = '#' + clr; } return isTransparent ? clr.toLowerCase() : clr.toUpperCase(); }, /** Converts provided color value to an RGB value string @public @method toRGB @param {String} str Hex or RGB value string @return {String} @since 3.8.0 **/ toRGB: function (str) { var clr = Y.Color._convertTo(str, 'rgb'); return clr.toLowerCase(); }, /** Converts provided color value to an RGB value string @public @method toRGBA @param {String} str Hex or RGB value string @return {String} @since 3.8.0 **/ toRGBA: function (str) { var clr = Y.Color._convertTo(str, 'rgba' ); return clr.toLowerCase(); }, /** Converts the provided color string to an array of values where the last value is the alpha value. Will return an empty array if the provided string is not able to be parsed. NOTE: `(\ufffe)?` is added to `HEX` and `HEX3` Regular Expressions to carve out a place for the alpha channel that is returned from toArray without compromising any usage of the Regular Expression Y.Color.toArray('fff'); // ['ff', 'ff', 'ff', 1] Y.Color.toArray('rgb(0, 0, 0)'); // ['0', '0', '0', 1] Y.Color.toArray('rgba(0, 0, 0, 0)'); // ['0', '0', '0', 1] @public @method toArray @param {String} str @return {Array} @since 3.8.0 **/ toArray: function(str) { // parse with regex and return "matches" array var type = Y.Color.findType(str).toUpperCase(), regex, arr, length, lastItem; if (type === 'HEX' && str.length < 5) { type = 'HEX3'; } if (type.charAt(type.length - 1) === 'A') { type = type.slice(0, -1); } regex = Y.Color['REGEX_' + type]; if (regex) { arr = regex.exec(str) || []; length = arr.length; if (length) { arr.shift(); length--; if (type === 'HEX3') { arr[0] += arr[0]; arr[1] += arr[1]; arr[2] += arr[2]; } lastItem = arr[length - 1]; if (!lastItem) { arr[length - 1] = 1; } } } return arr; }, /** Converts the array of values to a string based on the provided template. @public @method fromArray @param {Array} arr @param {String} template @return {String} @since 3.8.0 **/ fromArray: function(arr, template) { arr = arr.concat(); if (typeof template === 'undefined') { return arr.join(', '); } var replace = '{*}'; template = Y.Color['STR_' + template.toUpperCase()]; if (arr.length === 3 && template.match(/\{\*\}/g).length === 4) { arr.push(1); } while ( template.indexOf(replace) >= 0 && arr.length > 0) { template = template.replace(replace, arr.shift()); } return template; }, /** Finds the value type based on the str value provided. @public @method findType @param {String} str @return {String} @since 3.8.0 **/ findType: function (str) { if (Y.Color.KEYWORDS[str]) { return 'keyword'; } var index = str.indexOf('('), key; if (index > 0) { key = str.substr(0, index); } if (key && Y.Color.TYPES[key.toUpperCase()]) { return Y.Color.TYPES[key.toUpperCase()]; } return 'hex'; }, // return 'keyword', 'hex', 'rgb' /** Retrives the alpha channel from the provided string. If no alpha channel is present, `1` will be returned. @protected @method _getAlpha @param {String} clr @return {Number} @since 3.8.0 **/ _getAlpha: function (clr) { var alpha, arr = Y.Color.toArray(clr); if (arr.length > 3) { alpha = arr.pop(); } return +alpha || 1; }, /** Returns the hex value string if found in the KEYWORDS object @protected @method _keywordToHex @param {String} clr @return {String} @since 3.8.0 **/ _keywordToHex: function (clr) { var keyword = Y.Color.KEYWORDS[clr]; if (keyword) { return keyword; } }, /** Converts the provided color string to the value type provided as `to` @protected @method _convertTo @param {String} clr @param {String} to @return {String} @since 3.8.0 **/ _convertTo: function(clr, to) { if (clr === 'transparent') { return clr; } var from = Y.Color.findType(clr), originalTo = to, needsAlpha, alpha, method, ucTo; if (from === 'keyword') { clr = Y.Color._keywordToHex(clr); from = 'hex'; } if (from === 'hex' && clr.length < 5) { if (clr.charAt(0) === '#') { clr = clr.substr(1); } clr = '#' + clr.charAt(0) + clr.charAt(0) + clr.charAt(1) + clr.charAt(1) + clr.charAt(2) + clr.charAt(2); } if (from === to) { return clr; } if (from.charAt(from.length - 1) === 'a') { from = from.slice(0, -1); } needsAlpha = (to.charAt(to.length - 1) === 'a'); if (needsAlpha) { to = to.slice(0, -1); alpha = Y.Color._getAlpha(clr); } ucTo = to.charAt(0).toUpperCase() + to.substr(1).toLowerCase(); method = Y.Color['_' + from + 'To' + ucTo ]; // check to see if need conversion to rgb first // check to see if there is a direct conversion method // convertions are: hex <-> rgb <-> hsl if (!method) { if (from !== 'rgb' && to !== 'rgb') { clr = Y.Color['_' + from + 'ToRgb'](clr); from = 'rgb'; method = Y.Color['_' + from + 'To' + ucTo ]; } } if (method) { clr = ((method)(clr, needsAlpha)); } // process clr from arrays to strings after conversions if alpha is needed if (needsAlpha) { if (!Y.Lang.isArray(clr)) { clr = Y.Color.toArray(clr); } clr.push(alpha); clr = Y.Color.fromArray(clr, originalTo.toUpperCase()); } return clr; }, /** Processes the hex string into r, g, b values. Will return values as an array, or as an rgb string. @protected @method _hexToRgb @param {String} str @param {Boolean} [toArray] @return {String|Array} @since 3.8.0 **/ _hexToRgb: function (str, toArray) { var r, g, b; /*jshint bitwise:false*/ if (str.charAt(0) === '#') { str = str.substr(1); } str = parseInt(str, 16); r = str >> 16; g = str >> 8 & 0xFF; b = str & 0xFF; if (toArray) { return [r, g, b]; } return 'rgb(' + r + ', ' + g + ', ' + b + ')'; }, /** Processes the rgb string into r, g, b values. Will return values as an array, or as a hex string. @protected @method _rgbToHex @param {String} str @param {Boolean} [toArray] @return {String|Array} @since 3.8.0 **/ _rgbToHex: function (str) { /*jshint bitwise:false*/ var rgb = Y.Color.toArray(str), hex = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16); hex = (+hex).toString(16); while (hex.length < 6) { hex = '0' + hex; } return '#' + hex; } }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('dom-style', function (Y, NAME) { (function(Y) { /** * Add style management functionality to DOM. * @module dom * @submodule dom-style * @for DOM */ var DOCUMENT_ELEMENT = 'documentElement', DEFAULT_VIEW = 'defaultView', OWNER_DOCUMENT = 'ownerDocument', STYLE = 'style', FLOAT = 'float', CSS_FLOAT = 'cssFloat', STYLE_FLOAT = 'styleFloat', TRANSPARENT = 'transparent', GET_COMPUTED_STYLE = 'getComputedStyle', GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect', WINDOW = Y.config.win, DOCUMENT = Y.config.doc, UNDEFINED = undefined, Y_DOM = Y.DOM, TRANSFORM = 'transform', TRANSFORMORIGIN = 'transformOrigin', VENDOR_TRANSFORM = [ 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ], re_color = /color$/i, re_unit = /width|height|top|left|right|bottom|margin|padding/i; Y.Array.each(VENDOR_TRANSFORM, function(val) { if (val in DOCUMENT[DOCUMENT_ELEMENT].style) { TRANSFORM = val; TRANSFORMORIGIN = val + "Origin"; } }); Y.mix(Y_DOM, { DEFAULT_UNIT: 'px', CUSTOM_STYLES: { }, /** * Sets a style property for a given element. * @method setStyle * @param {HTMLElement} An HTMLElement to apply the style to. * @param {String} att The style property to set. * @param {String|Number} val The value. */ setStyle: function(node, att, val, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES; if (style) { if (val === null || val === '') { // normalize unsetting val = ''; } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit val += Y_DOM.DEFAULT_UNIT; } if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].set) { CUSTOM_STYLES[att].set(node, val, style); return; // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } else if (att === '') { // unset inline styles att = 'cssText'; val = ''; } style[att] = val; } }, /** * Returns the current style value for the given property. * @method getStyle * @param {HTMLElement} An HTMLElement to get the style from. * @param {String} att The style property to get. */ getStyle: function(node, att, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES, val = ''; if (style) { if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].get) { return CUSTOM_STYLES[att].get(node, att, style); // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } val = style[att]; if (val === '') { // TODO: is empty string sufficient? val = Y_DOM[GET_COMPUTED_STYLE](node, att); } } return val; }, /** * Sets multiple style properties. * @method setStyles * @param {HTMLElement} node An HTMLElement to apply the styles to. * @param {Object} hash An object literal of property:value pairs. */ setStyles: function(node, hash) { var style = node.style; Y.each(hash, function(v, n) { Y_DOM.setStyle(node, n, v, style); }, Y_DOM); }, /** * Returns the computed style for the given node. * @method getComputedStyle * @param {HTMLElement} An HTMLElement to get the style from. * @param {String} att The style property to get. * @return {String} The computed value of the style property. */ getComputedStyle: function(node, att) { var val = '', doc = node[OWNER_DOCUMENT], computed; if (node[STYLE] && doc[DEFAULT_VIEW] && doc[DEFAULT_VIEW][GET_COMPUTED_STYLE]) { computed = doc[DEFAULT_VIEW][GET_COMPUTED_STYLE](node, null); if (computed) { // FF may be null in some cases (ticket #2530548) val = computed[att]; } } return val; } }); // normalize reserved word float alternatives ("cssFloat" or "styleFloat") if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][CSS_FLOAT] !== UNDEFINED) { Y_DOM.CUSTOM_STYLES[FLOAT] = CSS_FLOAT; } else if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][STYLE_FLOAT] !== UNDEFINED) { Y_DOM.CUSTOM_STYLES[FLOAT] = STYLE_FLOAT; } // fix opera computedStyle default color unit (convert to rgb) if (Y.UA.opera) { Y_DOM[GET_COMPUTED_STYLE] = function(node, att) { var view = node[OWNER_DOCUMENT][DEFAULT_VIEW], val = view[GET_COMPUTED_STYLE](node, '')[att]; if (re_color.test(att)) { val = Y.Color.toRGB(val); } return val; }; } // safari converts transparent to rgba(), others use "transparent" if (Y.UA.webkit) { Y_DOM[GET_COMPUTED_STYLE] = function(node, att) { var view = node[OWNER_DOCUMENT][DEFAULT_VIEW], val = view[GET_COMPUTED_STYLE](node, '')[att]; if (val === 'rgba(0, 0, 0, 0)') { val = TRANSPARENT; } return val; }; } Y.DOM._getAttrOffset = function(node, attr) { var val = Y.DOM[GET_COMPUTED_STYLE](node, attr), offsetParent = node.offsetParent, position, parentOffset, offset; if (val === 'auto') { position = Y.DOM.getStyle(node, 'position'); if (position === 'static' || position === 'relative') { val = 0; } else if (offsetParent && offsetParent[GET_BOUNDING_CLIENT_RECT]) { parentOffset = offsetParent[GET_BOUNDING_CLIENT_RECT]()[attr]; offset = node[GET_BOUNDING_CLIENT_RECT]()[attr]; if (attr === 'left' || attr === 'top') { val = offset - parentOffset; } else { val = parentOffset - node[GET_BOUNDING_CLIENT_RECT]()[attr]; } } } return val; }; Y.DOM._getOffset = function(node) { var pos, xy = null; if (node) { pos = Y_DOM.getStyle(node, 'position'); xy = [ parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'left'), 10), parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'top'), 10) ]; if ( isNaN(xy[0]) ) { // in case of 'auto' xy[0] = parseInt(Y_DOM.getStyle(node, 'left'), 10); // try inline if ( isNaN(xy[0]) ) { // default to offset value xy[0] = (pos === 'relative') ? 0 : node.offsetLeft || 0; } } if ( isNaN(xy[1]) ) { // in case of 'auto' xy[1] = parseInt(Y_DOM.getStyle(node, 'top'), 10); // try inline if ( isNaN(xy[1]) ) { // default to offset value xy[1] = (pos === 'relative') ? 0 : node.offsetTop || 0; } } } return xy; }; Y_DOM.CUSTOM_STYLES.transform = { set: function(node, val, style) { style[TRANSFORM] = val; }, get: function(node, style) { return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORM); } }; Y_DOM.CUSTOM_STYLES.transformOrigin = { set: function(node, val, style) { style[TRANSFORMORIGIN] = val; }, get: function(node, style) { return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORMORIGIN); } }; })(Y); }, '@VERSION@', {"requires": ["dom-base", "color-base"]}); YUI.add('dom-style-ie', function (Y, NAME) { (function(Y) { var HAS_LAYOUT = 'hasLayout', PX = 'px', FILTER = 'filter', FILTERS = 'filters', OPACITY = 'opacity', AUTO = 'auto', BORDER_WIDTH = 'borderWidth', BORDER_TOP_WIDTH = 'borderTopWidth', BORDER_RIGHT_WIDTH = 'borderRightWidth', BORDER_BOTTOM_WIDTH = 'borderBottomWidth', BORDER_LEFT_WIDTH = 'borderLeftWidth', WIDTH = 'width', HEIGHT = 'height', TRANSPARENT = 'transparent', VISIBLE = 'visible', GET_COMPUTED_STYLE = 'getComputedStyle', UNDEFINED = undefined, documentElement = Y.config.doc.documentElement, testFeature = Y.Features.test, addFeature = Y.Features.add, // TODO: unit-less lineHeight (e.g. 1.22) re_unit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i, isIE8 = (Y.UA.ie >= 8), _getStyleObj = function(node) { return node.currentStyle || node.style; }, ComputedStyle = { CUSTOM_STYLES: {}, get: function(el, property) { var value = '', current; if (el) { current = _getStyleObj(el)[property]; if (property === OPACITY && Y.DOM.CUSTOM_STYLES[OPACITY]) { value = Y.DOM.CUSTOM_STYLES[OPACITY].get(el); } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert value = current; } else if (Y.DOM.IE.COMPUTED[property]) { // use compute function value = Y.DOM.IE.COMPUTED[property](el, property); } else if (re_unit.test(current)) { // convert to pixel value = ComputedStyle.getPixel(el, property) + PX; } else { value = current; } } return value; }, sizeOffsets: { width: ['Left', 'Right'], height: ['Top', 'Bottom'], top: ['Top'], bottom: ['Bottom'] }, getOffset: function(el, prop) { var current = _getStyleObj(el)[prop], // value of "width", "top", etc. capped = prop.charAt(0).toUpperCase() + prop.substr(1), // "Width", "Top", etc. offset = 'offset' + capped, // "offsetWidth", "offsetTop", etc. pixel = 'pixel' + capped, // "pixelWidth", "pixelTop", etc. sizeOffsets = ComputedStyle.sizeOffsets[prop], mode = el.ownerDocument.compatMode, value = ''; // IE pixelWidth incorrect for percent // manually compute by subtracting padding and border from offset size // NOTE: clientWidth/Height (size minus border) is 0 when current === AUTO so offsetHeight is used // reverting to auto from auto causes position stacking issues (old impl) if (current === AUTO || current.indexOf('%') > -1) { value = el['offset' + capped]; if (mode !== 'BackCompat') { if (sizeOffsets[0]) { value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[0]); value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[0] + 'Width', 1); } if (sizeOffsets[1]) { value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[1]); value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[1] + 'Width', 1); } } } else { // use style.pixelWidth, etc. to convert to pixels // need to map style.width to currentStyle (no currentStyle.pixelWidth) if (!el.style[pixel] && !el.style[prop]) { el.style[prop] = current; } value = el.style[pixel]; } return value + PX; }, borderMap: { thin: (isIE8) ? '1px' : '2px', medium: (isIE8) ? '3px': '4px', thick: (isIE8) ? '5px' : '6px' }, getBorderWidth: function(el, property, omitUnit) { var unit = omitUnit ? '' : PX, current = el.currentStyle[property]; if (current.indexOf(PX) < 0) { // look up keywords if a border exists if (ComputedStyle.borderMap[current] && el.currentStyle.borderStyle !== 'none') { current = ComputedStyle.borderMap[current]; } else { // otherwise no border (default is "medium") current = 0; } } return (omitUnit) ? parseFloat(current) : current; }, getPixel: function(node, att) { // use pixelRight to convert to px var val = null, style = _getStyleObj(node), styleRight = style.right, current = style[att]; node.style.right = current; val = node.style.pixelRight; node.style.right = styleRight; // revert return val; }, getMargin: function(node, att) { var val, style = _getStyleObj(node); if (style[att] == AUTO) { val = 0; } else { val = ComputedStyle.getPixel(node, att); } return val + PX; }, getVisibility: function(node, att) { var current; while ( (current = node.currentStyle) && current[att] == 'inherit') { // NOTE: assignment in test node = node.parentNode; } return (current) ? current[att] : VISIBLE; }, getColor: function(node, att) { var current = _getStyleObj(node)[att]; if (!current || current === TRANSPARENT) { Y.DOM.elementByAxis(node, 'parentNode', null, function(parent) { current = _getStyleObj(parent)[att]; if (current && current !== TRANSPARENT) { node = parent; return true; } }); } return Y.Color.toRGB(current); }, getBorderColor: function(node, att) { var current = _getStyleObj(node), val = current[att] || current.color; return Y.Color.toRGB(Y.Color.toHex(val)); } }, //fontSize: getPixelFont, IEComputed = {}; addFeature('style', 'computedStyle', { test: function() { return 'getComputedStyle' in Y.config.win; } }); addFeature('style', 'opacity', { test: function() { return 'opacity' in documentElement.style; } }); addFeature('style', 'filter', { test: function() { return 'filters' in documentElement; } }); // use alpha filter for IE opacity if (!testFeature('style', 'opacity') && testFeature('style', 'filter')) { Y.DOM.CUSTOM_STYLES[OPACITY] = { get: function(node) { var val = 100; try { // will error if no DXImageTransform val = node[FILTERS]['DXImageTransform.Microsoft.Alpha'][OPACITY]; } catch(e) { try { // make sure its in the document val = node[FILTERS]('alpha')[OPACITY]; } catch(err) { Y.log('getStyle: IE opacity filter not found; returning 1', 'warn', 'dom-style'); } } return val / 100; }, set: function(node, val, style) { var current, styleObj = _getStyleObj(node), currentFilter = styleObj[FILTER]; style = style || node.style; if (val === '') { // normalize inline style behavior current = (OPACITY in styleObj) ? styleObj[OPACITY] : 1; // revert to original opacity val = current; } if (typeof currentFilter == 'string') { // in case not appended style[FILTER] = currentFilter.replace(/alpha([^)]*\))/gi, '') + ((val < 1) ? 'alpha(' + OPACITY + '=' + val * 100 + ')' : ''); if (!style[FILTER]) { style.removeAttribute(FILTER); } if (!styleObj[HAS_LAYOUT]) { style.zoom = 1; // needs layout } } } }; } try { Y.config.doc.createElement('div').style.height = '-1px'; } catch(e) { // IE throws error on invalid style set; trap common cases Y.DOM.CUSTOM_STYLES.height = { set: function(node, val, style) { var floatVal = parseFloat(val); if (floatVal >= 0 || val === 'auto' || val === '') { style.height = val; } else { Y.log('invalid style value for height: ' + val, 'warn', 'dom-style'); } } }; Y.DOM.CUSTOM_STYLES.width = { set: function(node, val, style) { var floatVal = parseFloat(val); if (floatVal >= 0 || val === 'auto' || val === '') { style.width = val; } else { Y.log('invalid style value for width: ' + val, 'warn', 'dom-style'); } } }; } if (!testFeature('style', 'computedStyle')) { // TODO: top, right, bottom, left IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset; IEComputed.color = IEComputed.backgroundColor = ComputedStyle.getColor; IEComputed[BORDER_WIDTH] = IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] = IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] = ComputedStyle.getBorderWidth; IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom = IEComputed.marginLeft = ComputedStyle.getMargin; IEComputed.visibility = ComputedStyle.getVisibility; IEComputed.borderColor = IEComputed.borderTopColor = IEComputed.borderRightColor = IEComputed.borderBottomColor = IEComputed.borderLeftColor = ComputedStyle.getBorderColor; Y.DOM[GET_COMPUTED_STYLE] = ComputedStyle.get; Y.namespace('DOM.IE'); Y.DOM.IE.COMPUTED = IEComputed; Y.DOM.IE.ComputedStyle = ComputedStyle; } })(Y); }, '@VERSION@', {"requires": ["dom-style"]}); YUI.add('dom-screen', function (Y, NAME) { (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; Y.log('winHeight returning ' + h, 'info', 'dom-screen'); 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; Y.log('winWidth returning ' + w, 'info', 'dom-screen'); return w; }, /** * Document height * @method docHeight * @return {Number} The current height of the document. */ docHeight: function(node) { var h = Y_DOM._getDocSize(node).height; Y.log('docHeight returning ' + h, 'info', 'dom-screen'); 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; Y.log('docWidth returning ' + w, 'info', 'dom-screen'); 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); } } Y.log('setXY setting position to ' + xy, 'info', 'dom-screen'); } else { Y.log('setXY failed to set ' + node + ' to ' + xy, 'info', 'dom-screen'); } }, /** * 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"]}); YUI.add('selector-native', function (Y, NAME) { (function(Y) { /** * The selector-native module provides support for native querySelector * @module dom * @submodule selector-native * @for Selector */ /** * Provides support for using CSS selectors to query the DOM * @class Selector * @static * @for Selector */ Y.namespace('Selector'); // allow native module to standalone var COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition', OWNER_DOCUMENT = 'ownerDocument'; var Selector = { _types: { esc: { token: '\uE000', re: /\\[:\[\]\(\)#\.\'\>+~"]/gi }, attr: { token: '\uE001', re: /(\[[^\]]*\])/g }, pseudo: { token: '\uE002', re: /(\([^\)]*\))/g } }, useNative: true, _escapeId: function(id) { if (id) { id = id.replace(/([:\[\]\(\)#\.'<>+~"])/g,'\\$1'); } return id; }, _compare: ('sourceIndex' in Y.config.doc.documentElement) ? function(nodeA, nodeB) { var a = nodeA.sourceIndex, b = nodeB.sourceIndex; if (a === b) { return 0; } else if (a > b) { return 1; } return -1; } : (Y.config.doc.documentElement[COMPARE_DOCUMENT_POSITION] ? function(nodeA, nodeB) { if (nodeA[COMPARE_DOCUMENT_POSITION](nodeB) & 4) { return -1; } else { return 1; } } : function(nodeA, nodeB) { var rangeA, rangeB, compare; if (nodeA && nodeB) { rangeA = nodeA[OWNER_DOCUMENT].createRange(); rangeA.setStart(nodeA, 0); rangeB = nodeB[OWNER_DOCUMENT].createRange(); rangeB.setStart(nodeB, 0); compare = rangeA.compareBoundaryPoints(1, rangeB); // 1 === Range.START_TO_END } return compare; }), _sort: function(nodes) { if (nodes) { nodes = Y.Array(nodes, 0, true); if (nodes.sort) { nodes.sort(Selector._compare); } } return nodes; }, _deDupe: function(nodes) { var ret = [], i, node; for (i = 0; (node = nodes[i++]);) { if (!node._found) { ret[ret.length] = node; node._found = true; } } for (i = 0; (node = ret[i++]);) { node._found = null; node.removeAttribute('_found'); } return ret; }, /** * Retrieves a set of nodes based on a given CSS selector. * @method query * * @param {string} selector The CSS Selector to test the node against. * @param {HTMLElement} root optional An HTMLElement to start the query from. Defaults to Y.config.doc * @param {Boolean} firstOnly optional Whether or not to return only the first match. * @return {Array} An array of nodes that match the given selector. * @static */ query: function(selector, root, firstOnly, skipNative) { root = root || Y.config.doc; var ret = [], useNative = (Y.Selector.useNative && Y.config.doc.querySelector && !skipNative), queries = [[selector, root]], query, result, i, fn = (useNative) ? Y.Selector._nativeQuery : Y.Selector._bruteQuery; if (selector && fn) { // split group into seperate queries if (!skipNative && // already done if skipping (!useNative || root.tagName)) { // split native when element scoping is needed queries = Selector._splitQueries(selector, root); } for (i = 0; (query = queries[i++]);) { result = fn(query[0], query[1], firstOnly); if (!firstOnly) { // coerce DOM Collection to Array result = Y.Array(result, 0, true); } if (result) { ret = ret.concat(result); } } if (queries.length > 1) { // remove dupes and sort by doc order ret = Selector._sort(Selector._deDupe(ret)); } } Y.log('query: ' + selector + ' returning: ' + ret.length, 'info', 'Selector'); return (firstOnly) ? (ret[0] || null) : ret; }, _replaceSelector: function(selector) { var esc = Y.Selector._parse('esc', selector), // pull escaped colon, brackets, etc. attrs, pseudos; // first replace escaped chars, which could be present in attrs or pseudos selector = Y.Selector._replace('esc', selector); // then replace pseudos before attrs to avoid replacing :not([foo]) pseudos = Y.Selector._parse('pseudo', selector); selector = Selector._replace('pseudo', selector); attrs = Y.Selector._parse('attr', selector); selector = Y.Selector._replace('attr', selector); return { esc: esc, attrs: attrs, pseudos: pseudos, selector: selector }; }, _restoreSelector: function(replaced) { var selector = replaced.selector; selector = Y.Selector._restore('attr', selector, replaced.attrs); selector = Y.Selector._restore('pseudo', selector, replaced.pseudos); selector = Y.Selector._restore('esc', selector, replaced.esc); return selector; }, _replaceCommas: function(selector) { var replaced = Y.Selector._replaceSelector(selector), selector = replaced.selector; if (selector) { selector = selector.replace(/,/g, '\uE007'); replaced.selector = selector; selector = Y.Selector._restoreSelector(replaced); } return selector; }, // allows element scoped queries to begin with combinator // e.g. query('> p', document.body) === query('body > p') _splitQueries: function(selector, node) { if (selector.indexOf(',') > -1) { selector = Y.Selector._replaceCommas(selector); } var groups = selector.split('\uE007'), // split on replaced comma token queries = [], prefix = '', id, i, len; if (node) { // enforce for element scoping if (node.nodeType === 1) { // Elements only id = Y.Selector._escapeId(Y.DOM.getId(node)); if (!id) { id = Y.guid(); Y.DOM.setId(node, id); } prefix = '[id="' + id + '"] '; } for (i = 0, len = groups.length; i < len; ++i) { selector = prefix + groups[i]; queries.push([selector, node]); } } return queries; }, _nativeQuery: function(selector, root, one) { if ( (Y.UA.webkit || Y.UA.opera) && // webkit (chrome, safari) and Opera selector.indexOf(':checked') > -1 && // fail to pick up "selected" with ":checked" (Y.Selector.pseudos && Y.Selector.pseudos.checked) ) { return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query } try { //Y.log('trying native query with: ' + selector, 'info', 'selector-native'); return root['querySelector' + (one ? '' : 'All')](selector); } catch(e) { // fallback to brute if available //Y.log('native query error; reverting to brute query with: ' + selector, 'info', 'selector-native'); return Y.Selector.query(selector, root, one, true); // redo with skipNative true } }, filter: function(nodes, selector) { var ret = [], i, node; if (nodes && selector) { for (i = 0; (node = nodes[i++]);) { if (Y.Selector.test(node, selector)) { ret[ret.length] = node; } } } else { Y.log('invalid filter input (nodes: ' + nodes + ', selector: ' + selector + ')', 'warn', 'Selector'); } return ret; }, test: function(node, selector, root) { var ret = false, useFrag = false, groups, parent, item, items, frag, id, i, j, group; if (node && node.tagName) { // only test HTMLElements if (typeof selector == 'function') { // test with function ret = selector.call(node, node); } else { // test with query // we need a root if off-doc groups = selector.split(','); if (!root && !Y.DOM.inDoc(node)) { parent = node.parentNode; if (parent) { root = parent; } else { // only use frag when no parent to query frag = node[OWNER_DOCUMENT].createDocumentFragment(); frag.appendChild(node); root = frag; useFrag = true; } } root = root || node[OWNER_DOCUMENT]; id = Y.Selector._escapeId(Y.DOM.getId(node)); if (!id) { id = Y.guid(); Y.DOM.setId(node, id); } for (i = 0; (group = groups[i++]);) { // TODO: off-dom test group += '[id="' + id + '"]'; items = Y.Selector.query(group, root); for (j = 0; item = items[j++];) { if (item === node) { ret = true; break; } } if (ret) { break; } } if (useFrag) { // cleanup frag.removeChild(node); } }; } return ret; }, /** * A convenience function to emulate Y.Node's aNode.ancestor(selector). * @param {HTMLElement} element An HTMLElement to start the query from. * @param {String} selector The CSS selector to test the node against. * @return {HTMLElement} The ancestor node matching the selector, or null. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @static * @method ancestor */ ancestor: function (element, selector, testSelf) { return Y.DOM.ancestor(element, function(n) { return Y.Selector.test(n, selector); }, testSelf); }, _parse: function(name, selector) { return selector.match(Y.Selector._types[name].re); }, _replace: function(name, selector) { var o = Y.Selector._types[name]; return selector.replace(o.re, o.token); }, _restore: function(name, selector, items) { if (items) { var token = Y.Selector._types[name].token, i, len; for (i = 0, len = items.length; i < len; ++i) { selector = selector.replace(token, items[i]); } } return selector; } }; Y.mix(Y.Selector, Selector, true); })(Y); }, '@VERSION@', {"requires": ["dom-base"]}); YUI.add('selector', function (Y, NAME) { }, '@VERSION@', {"requires": ["selector-native"]}); YUI.add('event-custom-base', function (Y, NAME) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var DO_BEFORE = 0, DO_AFTER = 1, DO = { /** * Cache of objects touched by the utility * @property objs * @static * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object * replaces the role of this property, but is considered to be private, and * is only mentioned to provide a migration path. * * If you have a use case which warrants migration to the _yuiaop property, * please file a ticket to let us know what it's used for and we can see if * we need to expose hooks for that functionality more formally. */ objs: null, /** * <p>Execute the supplied method before the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt> * <dd>Replace the arguments that the original function will be * called with.</dd> * <dt></code>Y.Do.Prevent(message)</code></dt> * <dd>Don't execute the wrapped function. Other before phase * wrappers will be executed.</dd> * </dl> * * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { // Y.log('Do before: ' + sFn, 'info', 'event'); var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_BEFORE, f, obj, sFn); }, /** * <p>Execute the supplied method after the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt> * <dd>Return <code>returnValue</code> instead of the wrapped * method's original return value. This can be further altered by * other after phase wrappers.</dd> * </dl> * * <p>The static properties <code>Y.Do.originalRetVal</code> and * <code>Y.Do.currentRetVal</code> will be populated for reference.</p> * * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_AFTER, f, obj, sFn); }, /** * Execute the supplied method before or after the specified function. * Used by <code>before</code> and <code>after</code>. * * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (!obj._yuiaop) { // create a map entry for the obj if it doesn't exist, to hold overridden methods obj._yuiaop = {}; } o = obj._yuiaop; if (!o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription. * * @method detach * @param handle {string} the subscription handle * @static */ detach: function(handle) { if (handle.detach) { handle.detach(); } } }; Y.Do = DO; ////////////////////////////////////////////////////////////////////////// /** * Contains the return value from the wrapped method, accessible * by 'after' event listeners. * * @property originalRetVal * @static * @since 3.2.0 */ /** * Contains the current state of the return value, consumable by * 'after' event listeners, and updated if an after subscriber * changes the return value generated by the wrapped function. * * @property currentRetVal * @static * @since 3.2.0 */ ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ DO.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype._delete = function (sid) { // Y.log('Y.Do._delete: ' + sid, 'info', 'Event'); delete this.before[sid]; delete this.after[sid]; }; /** * <p>Execute the wrapped method. All arguments are passed into the wrapping * functions. If any of the before wrappers return an instance of * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped * function nor any after phase subscribers will be executed.</p> * * <p>The return value will be the return value of the wrapped function or one * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or * <code>Y.Do.AlterReturn</code>. * * @method exec * @param arg* {any} Arguments are passed to the wrapping and wrapped functions * @return {any} Return value of wrapped function unless overwritten (see above) */ DO.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case DO.Halt: return ret.retVal; case DO.AlterArgs: args = ret.newArgs; break; case DO.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } DO.originalRetVal = ret; DO.currentRetVal = ret; // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor === DO.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor === DO.AlterReturn) { ret = newRet.newRetVal; // Update the static retval state DO.currentRetVal = ret; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. Useful for Do.before subscribers. An * example would be a service that scrubs out illegal characters prior to * executing the core business logic. * @class Do.AlterArgs * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newArgs {Array} Call parameters to be used for the original method * instead of the arguments originally passed in. */ DO.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller. Useful for Do.after subscribers. * @class Do.AlterReturn * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newRetVal {any} Return value passed to code that invoked the wrapped * function. */ DO.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. Useful for Do.before subscribers. * @class Do.Halt * @constructor * @param msg {String} (optional) Explanation of why the termination was done * @param retVal {any} Return value passed to code that invoked the wrapped * function. */ DO.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute. Useful * for Do.before subscribers. * @class Do.Prevent * @constructor * @param msg {String} (optional) Explanation of why the termination was done */ DO.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param retVal {any} Return value passed to code that invoked the wrapped * function. * @deprecated use Y.Do.Halt or Y.Do.Prevent */ DO.Error = DO.Halt; ////////////////////////////////////////////////////////////////////////// /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ // var onsubscribeType = "_event:onsub", var YArray = Y.Array, AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], CONFIGS_HASH = YArray.hash(CONFIGS), nativeSlice = Array.prototype.slice, YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log', mixConfigs = function(r, s, ov) { var p; for (p in s) { if (CONFIGS_HASH[p] && (ov || !(p in r))) { r[p] = s[p]; } } return r; }; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires. * @param {object} defaults configuration object. * @class CustomEvent * @constructor */ /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ Y.CustomEvent = function(type, defaults) { this._kds = Y.CustomEvent.keepDeprecatedSubs; this.id = Y.guid(); this.type = type; this.silent = this.logSystem = (type === YUI_LOG); if (this._kds) { /** * The subscribers to this event * @property subscribers * @type Subscriber {} * @deprecated */ /** * 'After' subscribers * @property afters * @type Subscriber {} * @deprecated */ this.subscribers = {}; this.afters = {}; } if (defaults) { mixConfigs(this, defaults, true); } }; /** * Static flag to enable population of the <a href="#property_subscribers">`subscribers`</a> * and <a href="#property_subscribers">`afters`</a> properties held on a `CustomEvent` instance. * * These properties were changed to private properties (`_subscribers` and `_afters`), and * converted from objects to arrays for performance reasons. * * Setting this property to true will populate the deprecated `subscribers` and `afters` * properties for people who may be using them (which is expected to be rare). There will * be a performance hit, compared to the new array based implementation. * * If you are using these deprecated properties for a use case which the public API * does not support, please file an enhancement request, and we can provide an alternate * public implementation which doesn't have the performance cost required to maintiain the * properties as objects. * * @property keepDeprecatedSubs * @static * @for CustomEvent * @type boolean * @default false * @deprecated */ Y.CustomEvent.keepDeprecatedSubs = false; Y.CustomEvent.mixConfigs = mixConfigs; Y.CustomEvent.prototype = { constructor: Y.CustomEvent, /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ /** * This event has fired if true * * @property fired * @type boolean * @default false; */ /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ /** * The subscribers to this event * @property _subscribers * @type Subscriber [] * @private */ /** * 'After' subscribers * @property _afters * @type Subscriber [] * @private */ /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ signature : YUI3_SIGNATURE, /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ context : Y, /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ preventable : true, /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ bubbles : true, /** * Returns the number of subscribers for this event as the sum of the on() * subscribers and after() subscribers. * * @method hasSubs * @return Number */ hasSubs: function(when) { var s = 0, a = 0, subs = this._subscribers, afters = this._afters, sib = this.sibling; if (subs) { s = subs.length; } if (afters) { a = afters.length; } if (sib) { subs = sib._subscribers; afters = sib._afters; if (subs) { s += subs.length; } if (afters) { a += afters.length; } } if (when) { return (when === 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = nativeSlice.call(arguments, 0); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @method getSubs * @return {Array} first item is the on subscribers, second the after. */ getSubs: function() { var sibling = this.sibling, subs = this._subscribers, afters = this._afters, siblingSubs, siblingAfters; if (sibling) { siblingSubs = sibling._subscribers; siblingAfters = sibling._afters; } if (siblingSubs) { if (subs) { subs = subs.concat(siblingSubs); } else { subs = siblingSubs.concat(); } } else { if (subs) { subs = subs.concat(); } else { subs = []; } } if (siblingAfters) { if (afters) { afters = afters.concat(siblingAfters); } else { afters = siblingAfters.concat(); } } else { if (afters) { afters = afters.concat(); } else { afters = []; } } return [subs, afters]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply. * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { mixConfigs(this, o, force); }, /** * Create the Subscription for subscribing function, context, and bound * arguments. If this is a fireOnce event, the subscriber is immediately * notified. * * @method _on * @param fn {Function} Subscription callback * @param [context] {Object} Override `this` in the callback * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire() * @param [when] {String} "after" to slot into after subscribers * @return {EventHandle} * @protected */ _on: function(fn, context, args, when) { if (!fn) { this.log('Invalid callback for CE: ' + this.type); } var s = new Y.Subscriber(fn, context, args, when), firedWith; if (this.fireOnce && this.fired) { firedWith = this.firedWith; // It's a little ugly for this to know about facades, // but given the current breakup, not much choice without // moving a whole lot of stuff around. if (this.emitFacade && this._addFacadeToArgs) { this._addFacadeToArgs(firedWith); } if (this.async) { setTimeout(Y.bind(this._notify, this, s, firedWith), 0); } else { this._notify(s, firedWith); } } if (when === AFTER) { if (!this._afters) { this._afters = []; } this._afters.push(s); } else { if (!this._subscribers) { this._subscribers = []; } this._subscribers.push(s); } if (this._kds) { if (when === AFTER) { this.afters[s.id] = s; } else { this.subscribers[s.id] = s; } } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute. * @return {EventHandle} Unsubscribe handle. * @deprecated use on. */ subscribe: function(fn, context) { Y.log('ce.subscribe deprecated, use "on"', 'warn', 'deprecated'); var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s). */ on: function(fn, context) { var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; if (this.monitored && this.host) { this.host._monitor('attach', this, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle. */ after: function(fn, context) { var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed. */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = this._subscribers, afters = this._afters; if (subs) { for (i = subs.length; i >= 0; i--) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s, subs, i); found++; } } } if (afters) { for (i = afters.length; i >= 0; i--) { s = afters[i]; if (s && (!fn || fn === s.fn)) { this._delete(s, afters, i); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed. * @deprecated use detach. */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param {Subscriber} s the subscriber. * @param {Array} args the arguments array to apply to the listener. * @protected */ _notify: function(s, args, ef) { this.log(this.type + '->' + 'sub: ' + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + ' cancelled by subscriber'); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param {string} msg message to log. * @param {string} cat log category. */ log: function(msg, cat) { if (!this.silent) { Y.log(this.id + ': ' + msg, cat || 'info', 'event'); } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise. * */ fire: function() { // push is the fastest way to go from arguments to arrays // for most browsers currently // http://jsperf.com/push-vs-concat-vs-slice/2 var args = []; args.push.apply(args, arguments); return this._fire(args); }, /** * Private internal implementation for `fire`, which is can be used directly by * `EventTarget` and other event module classes which have already converted from * an `arguments` list to an array, to avoid the repeated overhead. * * @method _fire * @private * @param {Array} args The array of arguments passed to be passed to handlers. * @return {boolean} false if one of the subscribers returned false, true otherwise. */ _fire: function(args) { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; if (this.fireOnce) { this.firedWith = args; } if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, /** * Set up for notifying subscribers of non-emitFacade events. * * @method fireSimple * @param args {Array} Arguments passed to fire() * @return Boolean false if a subscriber returned false * @protected */ fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } if (this.broadcast) { this._broadcast(args); } return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { this.log('Missing event-custom-complex needed to emit a facade for: ' + this.type); args[0] = args[0] || {}; return this.fireSimple(args); }, /** * Notifies a list of subscribers. * * @method _procSubs * @param subs {Array} List of subscribers * @param args {Array} Arguments passed to fire() * @param ef {} * @return Boolean false if a subscriber returns false or stops the event * propagation via e.stopPropagation(), * e.stopImmediatePropagation(), or e.halt() * @private */ _procSubs: function(subs, args, ef) { var s, i, l; for (i = 0, l = subs.length; i < l; i++) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped === 2) { return false; } } } return true; }, /** * Notifies the YUI instance if the event is configured with broadcast = 1, * and both the YUI instance and Y.Global if configured with broadcast = 2. * * @method _broadcast * @param args {Array} Arguments sent to fire() * @private */ _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = args.concat(); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast === 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed. * @deprecated use detachAll. */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed. */ detachAll: function() { return this.detach(); }, /** * Deletes the subscriber from the internal store of on() and after() * subscribers. * * @method _delete * @param s subscriber object. * @param subs (optional) on or after subscriber array * @param index (optional) The index found. * @private */ _delete: function(s, subs, i) { var when = s._when; if (!subs) { subs = (when === AFTER) ? this._afters : this._subscribers; } if (subs) { i = YArray.indexOf(subs, s, 0); if (s && subs[i] === s) { subs.splice(i, 1); } } if (this._kds) { if (when === AFTER) { delete this.afters[s.id]; } else { delete this.subscribers[s.id]; } } if (this.monitored && this.host) { this.host._monitor('detach', this, { ce: this, sub: s }); } if (s) { s.deleted = true; } } }; /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute. * @param {Object} context The value of the keyword 'this' in the listener. * @param {Array} args* 0..n additional arguments to supply the listener. * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args, when) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.guid(); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; this._when = when; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { constructor: Y.Subscriber, _notify: function(c, args, ce) { if (this.deleted && !this.postponed) { if (this.postponed) { delete this.fn; delete this.context; } else { delete this.postponed; return null; } } var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber. * @param ce {CustomEvent} The custom event that sent the notification. */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config && Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch (e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute. * @param {Object} context optional 'this' keyword for the listener. * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn === fn) && this.context === context); } else { return (this.fn === fn); } }, valueOf : function() { return this.id; } }; /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param {CustomEvent} evt the custom event. * @param {Subscriber} sub the subscriber. */ Y.EventHandle = function(evt, sub) { /** * The custom event * * @property evt * @type CustomEvent */ this.evt = evt; /** * The subscriber object * * @property sub * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { batch: function(f, c) { f.call(c || this, this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.batch.call(c || h, f); }); } }, /** * Detaches this subscriber * @method detach * @return {int} the number of detached listeners */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { // Y.log('EventHandle.detach: ' + this.sub, 'info', 'Event'); if (Y.Lang.isArray(evt)) { for (i = 0; i < evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {String} the prefix to apply to non-prefixed event names */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', WILD_TYPE_RE = /(.*?)(:)(.*?)/, _wildType = Y.cached(function(type) { return type.replace(WILD_TYPE_RE, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = function(type, pre) { if (!pre || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }, /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t === '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { var etState = this._yuievt, etConfig; if (!etState) { etState = this._yuievt = { events: {}, // PERF: Not much point instantiating lazily. We're bound to have events targets: null, // PERF: Instantiate lazily, if user actually adds target, config: { host: this, context: this }, chain: Y.config.chain }; } etConfig = etState.config; if (opts) { mixConfigs(etConfig, opts, true); if (opts.chain !== undefined) { etState.chain = opts.chain; } if (opts.prefix) { etConfig.prefix = opts.prefix; } } }; ET.prototype = { constructor: ET, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ once: function() { var handle = this.on.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>after</code> except the * listener is immediatelly detached when it is executed. * @method onceAfter * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ onceAfter: function() { var handle = this.after.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Takes the type parameter passed to 'on' and parses out the * various pieces that could be included in the type. If the * event type is passed without a prefix, it will be expanded * to include the prefix one is supplied or the event target * is configured with a default prefix. * @method parseType * @param {String} type the type * @param {String} [pre=this._yuievt.config.prefix] the prefix * @since 3.3.0 * @return {Array} an array containing: * * the detach category, if supplied, * * the prefixed event type, * * whether or not this is an after listener, * * the supplied event type */ parseType: function(type, pre) { return _parseType(type, pre || this._yuievt.config.prefix); }, /** * Subscribe a callback function to a custom event fired by this object or * from an object that bubbles its events to this object. * * Callback functions for events published with `emitFacade = true` will * receive an `EventFacade` as the first argument (typically named "e"). * These callbacks can then call `e.preventDefault()` to disable the * behavior published to that event's `defaultFn`. See the `EventFacade` * API for all available properties and methods. Subscribers to * non-`emitFacade` events will receive the arguments passed to `fire()` * after the event name. * * To subscribe to multiple events at once, pass an object as the first * argument, where the key:value pairs correspond to the eventName:callback, * or pass an array of event names as the first argument to subscribe to * all listed events with the same callback. * * Returning `false` from a callback is supported as an alternative to * calling `e.preventDefault(); e.stopPropagation();`. However, it is * recommended to use the event methods whenever possible. * * @method on * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ on: function(type, fn, context) { var yuievt = this._yuievt, parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = nativeSlice.call(arguments, 0); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) { args = nativeSlice.call(arguments, 0); args.splice(2, 0, Node.getDOMNode(this)); // Y.log("Node detected, redirecting with these args: " + args); return Y.on.apply(Y, args); } type = parts[1]; if (Y.instanceOf(this, YUI)) { adapt = Y.Env.evt.plugins[type]; args = nativeSlice.call(arguments, 0); args[0] = shorttype; if (Node) { n = args[2]; if (Y.instanceOf(n, Y.NodeList)) { n = Y.NodeList.getDOMNodes(n); } else if (Y.instanceOf(n, Node)) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { Y.log('Using adaptor for ' + shorttype + ', ' + n, 'info', 'event'); handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true); // TODO: More robust regex, accounting for category if (type.indexOf("*:") !== -1) { this._hasSiblings = true; } } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { Y.log('EventTarget subscribe() is deprecated, use on()', 'warn', 'deprecated'); return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node)); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = nativeSlice.call(arguments, 0); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (Y.instanceOf(this, YUI)) { args = nativeSlice.call(arguments, 0); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { Y.log('EventTarget unsubscribe() is deprecated, use detach()', 'warn', 'deprecated'); return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {String} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {String} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'deprecated'); return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {String} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var ret, etState = this._yuievt, etConfig = etState.config, pre = etConfig.prefix; if (typeof type === "string") { if (pre) { type = _getType(type, pre); } ret = this._publish(type, etConfig, opts); } else { ret = {}; Y.each(type, function(v, k) { if (pre) { k = _getType(k, pre); } ret[k] = this._publish(k, etConfig, v || opts); }, this); } return ret; }, /** * Returns the fully qualified type, given a short type string. * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix. * * NOTE: This method, unlike _getType, does no checking of the value passed in, and * is designed to be used with the low level _publish() method, for critical path * implementations which need to fast-track publish for performance reasons. * * @method _getFullType * @private * @param {String} type The short type to prefix * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in */ _getFullType : function(type) { var pre = this._yuievt.config.prefix; if (pre) { return pre + PREFIX_DELIMITER + type; } else { return type; } }, /** * The low level event publish implementation. It expects all the massaging to have been done * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast * path publish, which can be used by critical code paths to improve performance. * * @method _publish * @private * @param {String} fullType The prefixed type of the event to publish. * @param {Object} etOpts The EventTarget specific configuration to mix into the published event. * @param {Object} ceOpts The publish specific configuration to mix into the published event. * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will * be the default `CustomEvent` instance, and can be configured independently. */ _publish : function(fullType, etOpts, ceOpts) { var ce, etState = this._yuievt, etConfig = etState.config, host = etConfig.host, context = etConfig.context, events = etState.events; ce = events[fullType]; // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight. if ((etConfig.monitored && !ce) || (ce && ce.monitored)) { this._monitor('publish', fullType, { args: arguments }); } if (!ce) { // Publish event ce = events[fullType] = new Y.CustomEvent(fullType, etOpts); if (!etOpts) { ce.host = host; ce.context = context; } } if (ceOpts) { mixConfigs(ce, ceOpts, true); } return ce; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @method _monitor * @param what {String} 'attach', 'detach', 'fire', or 'publish' * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object. * @param o {Object} Information about the event interaction, such as * fire() args, subscription category, publish config * @private */ _monitor: function(what, eventType, o) { var monitorevt, ce, type; if (eventType) { if (typeof eventType === "string") { type = eventType; ce = this.getEvent(eventType, true); } else { ce = eventType; type = eventType.type; } if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; o.monitored = what; this.fire.call(this, monitorevt, o); } } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {Boolean} True if the whole lifecycle of the event went through, * false if at any point the event propagation was halted. */ fire: function(type) { var typeIncluded = (typeof type === "string"), argCount = arguments.length, t = type, yuievt = this._yuievt, etConfig = yuievt.config, pre = etConfig.prefix, ret, ce, ce2, args; if (typeIncluded && argCount <= 3) { // PERF: Try to avoid slice/iteration for the common signatures // Most common if (argCount === 2) { args = [arguments[1]]; // fire("foo", {}) } else if (argCount === 3) { args = [arguments[1], arguments[2]]; // fire("foo", {}, opts) } else { args = []; // fire("foo") } } else { args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0)); } if (!typeIncluded) { t = (type && type.type); } if (pre) { t = _getType(t, pre); } ce = yuievt.events[t]; if (this._hasSiblings) { ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } } // PERF: trying to avoid function call, since this is a critical path if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { this._monitor('fire', (ce || t), { args: args }); } // this event has not been published or subscribed to if (!ce) { if (yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { if (ce2) { ce.sibling = ce2; } ret = ce._fire(args); } return (yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); ce2 = this.getEvent(type, true); if (ce2) { ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {String} the type, or name of the event * @param prefixed {String} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * * @method after * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ after: function(type, fn) { var a = nativeSlice.call(arguments, 0); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype); ET.call(Y, { bubbles: false }); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? /** `Y.on()` can do many things: <ul> <li>Subscribe to custom events `publish`ed and `fire`d from Y</li> <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and `fire`d from any object in the YUI instance sandbox</li> <li>Subscribe to DOM events</li> <li>Subscribe to the execution of a method on any object, effectively treating that method as an event</li> </ul> For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument. Y.on('io:complete', function () { Y.MyApp.updateStatus('Transaction complete'); }); To subscribe to DOM events, pass the name of a DOM event as the first argument and a CSS selector string as the third argument after the callback function. Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`, array, or simply omitted (the default is the `window` object). Y.on('click', function (e) { e.preventDefault(); // proceed with ajax form submission var url = this.get('action'); ... }, '#my-form'); The `this` object in DOM event callbacks will be the `Node` targeted by the CSS selector or other identifier. `on()` subscribers for DOM events or custom events `publish`ed with a `defaultFn` can prevent the default behavior with `e.preventDefault()` from the event object passed as the first parameter to the subscription callback. To subscribe to the execution of an object method, pass arguments corresponding to the call signature for <a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>. NOTE: The formal parameter list below is for events, not for function injection. See `Y.Do.before` for that signature. @method on @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @see Do.before @for YUI **/ /** Listen for an event one time. Equivalent to `on()`, except that the listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see on @method once @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Listen for an event one time. Equivalent to `once()`, except, like `after()`, the subscription callback executes after all `on()` subscribers and the event's `defaultFn` (if configured) have executed. Like `after()` if any `on()` phase subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()` subscribers will execute. The listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see once @method onceAfter @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Like `on()`, this method creates a subscription to a custom event or to the execution of a method on an object. For events, `after()` subscribers are executed after the event's `defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber. See the <a href="#methods_on">`on()` method</a> for additional subscription options. NOTE: The subscription signature shown is for events, not for function injection. See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a> for that signature. @see on @see Do.after @method after @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [args*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ }, '@VERSION@', {"requires": ["oop"]}); YUI.add('event-custom-complex', function (Y, NAME) { /** * Adds event facades, preventable default behavior, and bubbling. * events. * @module event-custom * @submodule event-custom-complex */ var FACADE, FACADE_KEYS, YObject = Y.Object, key, EMPTY = {}, CEProto = Y.CustomEvent.prototype, ETProto = Y.EventTarget.prototype, mixFacadeProps = function(facade, payload) { var p; for (p in payload) { if (!(FACADE_KEYS.hasOwnProperty(p))) { facade[p] = payload[p]; } } }; /** * Wraps and protects a custom event for use when emitFacade is set to true. * Requires the event-custom-complex module * @class EventFacade * @param e {Event} the custom event * @param currentTarget {HTMLElement} the element the listener was attached to */ Y.EventFacade = function(e, currentTarget) { if (!e) { e = EMPTY; } this._event = e; /** * The arguments passed to fire * @property details * @type Array */ this.details = e.details; /** * The event type, this can be overridden by the fire() payload * @property type * @type string */ this.type = e.type; /** * The real event type * @property _type * @type string * @private */ this._type = e.type; ////////////////////////////////////////////////////// /** * Node reference for the targeted eventtarget * @property target * @type Node */ this.target = e.target; /** * Node reference for the element that the listener was attached to. * @property currentTarget * @type Node */ this.currentTarget = currentTarget; /** * Node reference to the relatedTarget * @property relatedTarget * @type Node */ this.relatedTarget = e.relatedTarget; }; Y.mix(Y.EventFacade.prototype, { /** * Stops the propagation to the next bubble target * @method stopPropagation */ stopPropagation: function() { this._event.stopPropagation(); this.stopped = 1; }, /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ stopImmediatePropagation: function() { this._event.stopImmediatePropagation(); this.stopped = 2; }, /** * Prevents the event's default behavior * @method preventDefault */ preventDefault: function() { this._event.preventDefault(); this.prevented = 1; }, /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ halt: function(immediate) { this._event.halt(immediate); this.prevented = 1; this.stopped = (immediate) ? 2 : 1; } }); CEProto.fireComplex = function(args) { var es, ef, q, queue, ce, ret = true, events, subs, ons, afters, afterQueue, postponed, prevented, preventedFn, defaultFn, self = this, host = self.host || self, next, oldbubble, stack = self.stack, yuievt = host._yuievt, hasPotentialSubscribers; if (stack) { // queue this event if the current item in the queue bubbles if (self.queuable && self.type !== stack.next.type) { self.log('queue ' + self.type); if (!stack.queue) { stack.queue = []; } stack.queue.push([self, args]); return true; } } hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast; self.target = self.target || host; self.currentTarget = host; self.details = args.concat(); if (hasPotentialSubscribers) { es = stack || { id: self.id, // id of the first event in the stack next: self, silent: self.silent, stopped: 0, prevented: 0, bubbling: null, type: self.type, // defaultFnQueue: new Y.Queue(), defaultTargetOnly: self.defaultTargetOnly }; subs = self.getSubs(); ons = subs[0]; afters = subs[1]; self.stopped = (self.type !== es.type) ? 0 : es.stopped; self.prevented = (self.type !== es.type) ? 0 : es.prevented; if (self.stoppedFn) { // PERF TODO: Can we replace with callback, like preventedFn. Look into history events = new Y.EventTarget({ fireOnce: true, context: host }); self.events = events; events.on('stopped', self.stoppedFn); } // self.log("Firing " + self + ", " + "args: " + args); self.log("Firing " + self.type); self._facade = null; // kill facade to eliminate stale properties ef = self._createFacade(args); if (ons) { self._procSubs(ons, args, ef); } // bubble if this is hosted in an event target and propagation has not been stopped if (self.bubbles && host.bubble && !self.stopped) { oldbubble = es.bubbling; es.bubbling = self.type; if (es.type !== self.type) { es.stopped = 0; es.prevented = 0; } ret = host.bubble(self, args, null, es); self.stopped = Math.max(self.stopped, es.stopped); self.prevented = Math.max(self.prevented, es.prevented); es.bubbling = oldbubble; } prevented = self.prevented; if (prevented) { preventedFn = self.preventedFn; if (preventedFn) { preventedFn.apply(host, args); } } else { defaultFn = self.defaultFn; if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) { defaultFn.apply(host, args); } } // broadcast listeners are fired as discreet events on the // YUI instance and potentially the YUI global. if (self.broadcast) { self._broadcast(args); } if (afters && !self.prevented && self.stopped < 2) { // Queue the after afterQueue = es.afterQueue; if (es.id === self.id || self.type !== yuievt.bubbling) { self._procSubs(afters, args, ef); if (afterQueue) { while ((next = afterQueue.last())) { next(); } } } else { postponed = afters; if (es.execDefaultCnt) { postponed = Y.merge(postponed); Y.each(postponed, function(s) { s.postponed = true; }); } if (!afterQueue) { es.afterQueue = new Y.Queue(); } es.afterQueue.add(function() { self._procSubs(postponed, args, ef); }); } } self.target = null; if (es.id === self.id) { queue = es.queue; if (queue) { while (queue.length) { q = queue.pop(); ce = q[0]; // set up stack to allow the next item to be processed es.next = ce; ce._fire(q[1]); } } self.stack = null; } ret = !(self.stopped); if (self.type !== yuievt.bubbling) { es.stopped = 0; es.prevented = 0; self.stopped = 0; self.prevented = 0; } } else { defaultFn = self.defaultFn; if(defaultFn) { ef = self._createFacade(args); if ((!self.defaultTargetOnly) || (host === ef.target)) { defaultFn.apply(host, args); } } } // Kill the cached facade to free up memory. // Otherwise we have the facade from the last fire, sitting around forever. self._facade = null; return ret; }; /** * @method _hasPotentialSubscribers * @for CustomEvent * @private * @return {boolean} Whether the event has potential subscribers or not */ CEProto._hasPotentialSubscribers = function() { return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast; }; /** * Internal utility method to create a new facade instance and * insert it into the fire argument list, accounting for any payload * merging which needs to happen. * * This used to be called `_getFacade`, but the name seemed inappropriate * when it was used without a need for the return value. * * @method _createFacade * @private * @param fireArgs {Array} The arguments passed to "fire", which need to be * shifted (and potentially merged) when the facade is added. * @return {EventFacade} The event facade created. */ // TODO: Remove (private) _getFacade alias, once synthetic.js is updated. CEProto._createFacade = CEProto._getFacade = function(fireArgs) { var userArgs = this.details, firstArg = userArgs && userArgs[0], firstArgIsObj = (firstArg && (typeof firstArg === "object")), ef = this._facade; if (!ef) { ef = new Y.EventFacade(this, this.currentTarget); } if (firstArgIsObj) { // protect the event facade properties mixFacadeProps(ef, firstArg); // Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376 if (firstArg.type) { ef.type = firstArg.type; } if (fireArgs) { fireArgs[0] = ef; } } else { if (fireArgs) { fireArgs.unshift(ef); } } // update the details field with the arguments ef.details = this.details; // use the original target when the event bubbled to this target ef.target = this.originalTarget || this.target; ef.currentTarget = this.currentTarget; ef.stopped = 0; ef.prevented = 0; this._facade = ef; return this._facade; }; /** * Utility method to manipulate the args array passed in, to add the event facade, * if it's not already the first arg. * * @method _addFacadeToArgs * @private * @param {Array} The arguments to manipulate */ CEProto._addFacadeToArgs = function(args) { var e = args[0]; // Trying not to use instanceof, just to avoid potential cross Y edge case issues. if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) { this._createFacade(args); } }; /** * Stop propagation to bubble targets * @for CustomEvent * @method stopPropagation */ CEProto.stopPropagation = function() { this.stopped = 1; if (this.stack) { this.stack.stopped = 1; } if (this.events) { this.events.fire('stopped', this); } }; /** * Stops propagation to bubble targets, and prevents any remaining * subscribers on the current target from executing. * @method stopImmediatePropagation */ CEProto.stopImmediatePropagation = function() { this.stopped = 2; if (this.stack) { this.stack.stopped = 2; } if (this.events) { this.events.fire('stopped', this); } }; /** * Prevents the execution of this event's defaultFn * @method preventDefault */ CEProto.preventDefault = function() { if (this.preventable) { this.prevented = 1; if (this.stack) { this.stack.prevented = 1; } } }; /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ CEProto.halt = function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); }; /** * Registers another EventTarget as a bubble target. Bubble order * is determined by the order registered. Multiple targets can * be specified. * * Events can only bubble if emitFacade is true. * * Included in the event-custom-complex submodule. * * @method addTarget * @param o {EventTarget} the target to add * @for EventTarget */ ETProto.addTarget = function(o) { var etState = this._yuievt; if (!etState.targets) { etState.targets = {}; } etState.targets[Y.stamp(o)] = o; etState.hasTargets = true; }; /** * Returns an array of bubble targets for this object. * @method getTargets * @return EventTarget[] */ ETProto.getTargets = function() { var targets = this._yuievt.targets; return targets ? YObject.values(targets) : []; }; /** * Removes a bubble target * @method removeTarget * @param o {EventTarget} the target to remove * @for EventTarget */ ETProto.removeTarget = function(o) { var targets = this._yuievt.targets; if (targets) { delete targets[Y.stamp(o, true)]; if (YObject.size(targets) === 0) { this._yuievt.hasTargets = false; } } }; /** * Propagate an event. Requires the event-custom-complex module. * @method bubble * @param evt {CustomEvent} the custom event to propagate * @return {boolean} the aggregated return value from Event.Custom.fire * @for EventTarget */ ETProto.bubble = function(evt, args, target, es) { var targs = this._yuievt.targets, ret = true, t, ce, i, bc, ce2, type = evt && evt.type, originalTarget = target || (evt && evt.target) || this, oldbubble; if (!evt || ((!evt.stopped) && targs)) { for (i in targs) { if (targs.hasOwnProperty(i)) { t = targs[i]; ce = t._yuievt.events[type]; if (t._hasSiblings) { ce2 = t.getSibling(type, ce); } if (ce2 && !ce) { ce = t.publish(type); } oldbubble = t._yuievt.bubbling; t._yuievt.bubbling = type; // if this event was not published on the bubble target, // continue propagating the event. if (!ce) { if (t._yuievt.hasTargets) { t.bubble(evt, args, originalTarget, es); } } else { if (ce2) { ce.sibling = ce2; } // set the original target to that the target payload on the facade is correct. ce.target = originalTarget; ce.originalTarget = originalTarget; ce.currentTarget = t; bc = ce.broadcast; ce.broadcast = false; // default publish may not have emitFacade true -- that // shouldn't be what the implementer meant to do ce.emitFacade = true; ce.stack = es; // TODO: See what's getting in the way of changing this to use // the more performant ce._fire(args || evt.details || []). // Something in Widget Parent/Child tests is not happy if we // change it - maybe evt.details related? ret = ret && ce.fire.apply(ce, args || evt.details || []); ce.broadcast = bc; ce.originalTarget = null; // stopPropagation() was called if (ce.stopped) { break; } } t._yuievt.bubbling = oldbubble; } } } return ret; }; /** * @method _hasPotentialSubscribers * @for EventTarget * @private * @param {String} fullType The fully prefixed type name * @return {boolean} Whether the event has potential subscribers or not */ ETProto._hasPotentialSubscribers = function(fullType) { var etState = this._yuievt, e = etState.events[fullType]; if (e) { return e.hasSubs() || etState.hasTargets || e.broadcast; } else { return false; } }; FACADE = new Y.EventFacade(); FACADE_KEYS = {}; // Flatten whitelist for (key in FACADE) { FACADE_KEYS[key] = true; } }, '@VERSION@', {"requires": ["event-custom-base"]}); YUI.add('node-core', function (Y, NAME) { /** * The Node Utility provides a DOM-like interface for interacting with DOM nodes. * @module node * @main node * @submodule node-core */ /** * The Node class provides a wrapper for manipulating DOM Nodes. * Node properties can be accessed via the set/get methods. * Use `Y.one()` to retrieve Node instances. * * <strong>NOTE:</strong> Node properties are accessed using * the <code>set</code> and <code>get</code> methods. * * @class Node * @constructor * @param {DOMNode} node the DOM node to be mapped to the Node instance. * @uses EventTarget */ // "globals" var DOT = '.', NODE_NAME = 'nodeName', NODE_TYPE = 'nodeType', OWNER_DOCUMENT = 'ownerDocument', TAG_NAME = 'tagName', UID = '_yuid', EMPTY_OBJ = {}, _slice = Array.prototype.slice, Y_DOM = Y.DOM, Y_Node = function(node) { if (!this.getDOMNode) { // support optional "new" return new Y_Node(node); } if (typeof node == 'string') { node = Y_Node._fromString(node); if (!node) { return null; // NOTE: return } } var uid = (node.nodeType !== 9) ? node.uniqueID : node[UID]; if (uid && Y_Node._instances[uid] && Y_Node._instances[uid]._node !== node) { node[UID] = null; // unset existing uid to prevent collision (via clone or hack) } uid = uid || Y.stamp(node); if (!uid) { // stamp failed; likely IE non-HTMLElement uid = Y.guid(); } this[UID] = uid; /** * The underlying DOM node bound to the Y.Node instance * @property _node * @type DOMNode * @private */ this._node = node; this._stateProxy = node; // when augmented with Attribute if (this._initPlugins) { // when augmented with Plugin.Host this._initPlugins(); } }, // used with previous/next/ancestor tests _wrapFn = function(fn) { var ret = null; if (fn) { ret = (typeof fn == 'string') ? function(n) { return Y.Selector.test(n, fn); } : function(n) { return fn(Y.one(n)); }; } return ret; }; // end "globals" Y_Node.ATTRS = {}; Y_Node.DOM_EVENTS = {}; Y_Node._fromString = function(node) { if (node) { if (node.indexOf('doc') === 0) { // doc OR document node = Y.config.doc; } else if (node.indexOf('win') === 0) { // win OR window node = Y.config.win; } else { node = Y.Selector.query(node, null, true); } } return node || null; }; /** * The name of the component * @static * @type String * @property NAME */ Y_Node.NAME = 'node'; /* * The pattern used to identify ARIA attributes */ Y_Node.re_aria = /^(?:role$|aria-)/; Y_Node.SHOW_TRANSITION = 'fadeIn'; Y_Node.HIDE_TRANSITION = 'fadeOut'; /** * A list of Node instances that have been created * @private * @type Object * @property _instances * @static * */ Y_Node._instances = {}; /** * Retrieves the DOM node bound to a Node instance * @method getDOMNode * @static * * @param {Node | HTMLNode} node The Node instance or an HTMLNode * @return {HTMLNode} The DOM node bound to the Node instance. If a DOM node is passed * as the node argument, it is simply returned. */ Y_Node.getDOMNode = function(node) { if (node) { return (node.nodeType) ? node : node._node || null; } return null; }; /** * Checks Node return values and wraps DOM Nodes as Y.Node instances * and DOM Collections / Arrays as Y.NodeList instances. * Other return values just pass thru. If undefined is returned (e.g. no return) * then the Node instance is returned for chainability. * @method scrubVal * @static * * @param {any} node The Node instance or an HTMLNode * @return {Node | NodeList | Any} Depends on what is returned from the DOM node. */ Y_Node.scrubVal = function(val, node) { if (val) { // only truthy values are risky if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window val = Y.one(val); } else if ((val.item && !val._nodes) || // dom collection or Node instance (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes val = Y.all(val); } } } else if (typeof val === 'undefined') { val = node; // for chaining } else if (val === null) { val = null; // IE: DOM null not the same as null } return val; }; /** * Adds methods to the Y.Node prototype, routing through scrubVal. * @method addMethod * @static * * @param {String} name The name of the method to add * @param {Function} fn The function that becomes the method * @param {Object} context An optional context to call the method with * (defaults to the Node instance) * @return {any} Depends on what is returned from the DOM node. */ Y_Node.addMethod = function(name, fn, context) { if (name && fn && typeof fn == 'function') { Y_Node.prototype[name] = function() { var args = _slice.call(arguments), node = this, ret; if (args[0] && args[0]._node) { args[0] = args[0]._node; } if (args[1] && args[1]._node) { args[1] = args[1]._node; } args.unshift(node._node); ret = fn.apply(node, args); if (ret) { // scrub truthy ret = Y_Node.scrubVal(ret, node); } (typeof ret != 'undefined') || (ret = node); return ret; }; } else { Y.log('unable to add method: ' + name, 'warn', 'Node'); } }; /** * Imports utility methods to be added as Y.Node methods. * @method importMethod * @static * * @param {Object} host The object that contains the method to import. * @param {String} name The name of the method to import * @param {String} altName An optional name to use in place of the host name * @param {Object} context An optional context to call the method with */ Y_Node.importMethod = function(host, name, altName) { if (typeof name == 'string') { altName = altName || name; Y_Node.addMethod(altName, host[name], host); } else { Y.Array.each(name, function(n) { Y_Node.importMethod(host, n); }); } }; /** * Retrieves a NodeList based on the given CSS selector. * @method all * * @param {string} selector The CSS selector to test against. * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array. * @for YUI */ /** * Returns a single Node instance bound to the node or the * first element matching the given selector. Returns null if no match found. * <strong>Note:</strong> For chaining purposes you may want to * use <code>Y.all</code>, which returns a NodeList when no match is found. * @method one * @param {String | HTMLElement} node a node or Selector * @return {Node | null} a Node instance or null if no match found. * @for YUI */ /** * Returns a single Node instance bound to the node or the * first element matching the given selector. Returns null if no match found. * <strong>Note:</strong> For chaining purposes you may want to * use <code>Y.all</code>, which returns a NodeList when no match is found. * @method one * @static * @param {String | HTMLElement} node a node or Selector * @return {Node | null} a Node instance or null if no match found. * @for Node */ Y_Node.one = function(node) { var instance = null, cachedNode, uid; if (node) { if (typeof node == 'string') { node = Y_Node._fromString(node); if (!node) { return null; // NOTE: return } } else if (node.getDOMNode) { return node; // NOTE: return } if (node.nodeType || Y.DOM.isWindow(node)) { // avoid bad input (numbers, boolean, etc) uid = (node.uniqueID && node.nodeType !== 9) ? node.uniqueID : node._yuid; instance = Y_Node._instances[uid]; // reuse exising instances cachedNode = instance ? instance._node : null; if (!instance || (cachedNode && node !== cachedNode)) { // new Node when nodes don't match instance = new Y_Node(node); if (node.nodeType != 11) { // dont cache document fragment Y_Node._instances[instance[UID]] = instance; // cache node } } } } return instance; }; /** * The default setter for DOM properties * Called with instance context (this === the Node instance) * @method DEFAULT_SETTER * @static * @param {String} name The attribute/property being set * @param {any} val The value to be set * @return {any} The value */ Y_Node.DEFAULT_SETTER = function(name, val) { var node = this._stateProxy, strPath; if (name.indexOf(DOT) > -1) { strPath = name; name = name.split(DOT); // only allow when defined on node Y.Object.setValue(node, name, val); } else if (typeof node[name] != 'undefined') { // pass thru DOM properties node[name] = val; } return val; }; /** * The default getter for DOM properties * Called with instance context (this === the Node instance) * @method DEFAULT_GETTER * @static * @param {String} name The attribute/property to look up * @return {any} The current value */ Y_Node.DEFAULT_GETTER = function(name) { var node = this._stateProxy, val; if (name.indexOf && name.indexOf(DOT) > -1) { val = Y.Object.getValue(node, name.split(DOT)); } else if (typeof node[name] != 'undefined') { // pass thru from DOM val = node[name]; } return val; }; Y.mix(Y_Node.prototype, { DATA_PREFIX: 'data-', /** * The method called when outputting Node instances as strings * @method toString * @return {String} A string representation of the Node instance */ toString: function() { var str = this[UID] + ': not bound to a node', node = this._node, attrs, id, className; if (node) { attrs = node.attributes; id = (attrs && attrs.id) ? node.getAttribute('id') : null; className = (attrs && attrs.className) ? node.getAttribute('className') : null; str = node[NODE_NAME]; if (id) { str += '#' + id; } if (className) { str += '.' + className.replace(' ', '.'); } // TODO: add yuid? str += ' ' + this[UID]; } return str; }, /** * Returns an attribute value on the Node instance. * Unless pre-configured (via `Node.ATTRS`), get hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be queried. * @method get * @param {String} attr The attribute * @return {any} The current value of the attribute */ get: function(attr) { var val; if (this._getAttr) { // use Attribute imple val = this._getAttr(attr); } else { val = this._get(attr); } if (val) { val = Y_Node.scrubVal(val, this); } else if (val === null) { val = null; // IE: DOM null is not true null (even though they ===) } return val; }, /** * Helper method for get. * @method _get * @private * @param {String} attr The attribute * @return {any} The current value of the attribute */ _get: function(attr) { var attrConfig = Y_Node.ATTRS[attr], val; if (attrConfig && attrConfig.getter) { val = attrConfig.getter.call(this); } else if (Y_Node.re_aria.test(attr)) { val = this._node.getAttribute(attr, 2); } else { val = Y_Node.DEFAULT_GETTER.apply(this, arguments); } return val; }, /** * Sets an attribute on the Node instance. * Unless pre-configured (via Node.ATTRS), set hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be set. * To set custom attributes use setAttribute. * @method set * @param {String} attr The attribute to be set. * @param {any} val The value to set the attribute to. * @chainable */ set: function(attr, val) { var attrConfig = Y_Node.ATTRS[attr]; if (this._setAttr) { // use Attribute imple this._setAttr.apply(this, arguments); } else { // use setters inline if (attrConfig && attrConfig.setter) { attrConfig.setter.call(this, val, attr); } else if (Y_Node.re_aria.test(attr)) { // special case Aria this._node.setAttribute(attr, val); } else { Y_Node.DEFAULT_SETTER.apply(this, arguments); } } return this; }, /** * Sets multiple attributes. * @method setAttrs * @param {Object} attrMap an object of name/value pairs to set * @chainable */ setAttrs: function(attrMap) { if (this._setAttrs) { // use Attribute imple this._setAttrs(attrMap); } else { // use setters inline Y.Object.each(attrMap, function(v, n) { this.set(n, v); }, this); } return this; }, /** * Returns an object containing the values for the requested attributes. * @method getAttrs * @param {Array} attrs an array of attributes to get values * @return {Object} An object with attribute name/value pairs. */ getAttrs: function(attrs) { var ret = {}; if (this._getAttrs) { // use Attribute imple this._getAttrs(attrs); } else { // use setters inline Y.Array.each(attrs, function(v, n) { ret[v] = this.get(v); }, this); } return ret; }, /** * Compares nodes to determine if they match. * Node instances can be compared to each other and/or HTMLElements. * @method compareTo * @param {HTMLElement | Node} refNode The reference node to compare to the node. * @return {Boolean} True if the nodes match, false if they do not. */ compareTo: function(refNode) { var node = this._node; if (refNode && refNode._node) { refNode = refNode._node; } return node === refNode; }, /** * Determines whether the node is appended to the document. * @method inDoc * @param {Node|HTMLElement} doc optional An optional document to check against. * Defaults to current document. * @return {Boolean} Whether or not this node is appended to the document. */ inDoc: function(doc) { var node = this._node; doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT]; if (doc.documentElement) { return Y_DOM.contains(doc.documentElement, node); } }, getById: function(id) { var node = this._node, ret = Y_DOM.byId(id, node[OWNER_DOCUMENT]); if (ret && Y_DOM.contains(node, ret)) { ret = Y.one(ret); } else { ret = null; } return ret; }, /** * Returns the nearest ancestor that passes the test applied by supplied boolean method. * @method ancestor * @param {String | Function} fn A selector string or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * If fn is not passed as an argument, the parent node will be returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @param {String | Function} stopFn optional A selector string or boolean * method to indicate when the search should stop. The search bails when the function * returns true or the selector matches. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} The matching Node instance or null if not found */ ancestor: function(fn, testSelf, stopFn) { // testSelf is optional, check for stopFn as 2nd arg if (arguments.length === 2 && (typeof testSelf == 'string' || typeof testSelf == 'function')) { stopFn = testSelf; } return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn))); }, /** * Returns the ancestors that pass the test applied by supplied boolean method. * @method ancestors * @param {String | Function} fn A selector string or boolean method for testing elements. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * If a function is used, it receives the current node being tested as the only argument. * @return {NodeList} A NodeList instance containing the matching elements */ ancestors: function(fn, testSelf, stopFn) { if (arguments.length === 2 && (typeof testSelf == 'string' || typeof testSelf == 'function')) { stopFn = testSelf; } return Y.all(Y_DOM.ancestors(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn))); }, /** * Returns the previous matching sibling. * Returns the nearest element node sibling if no method provided. * @method previous * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} Node instance or null if not found */ previous: function(fn, all) { return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all)); }, /** * Returns the next matching sibling. * Returns the nearest element node sibling if no method provided. * @method next * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} Node instance or null if not found */ next: function(fn, all) { return Y.one(Y_DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all)); }, /** * Returns all matching siblings. * Returns all siblings if no method provided. * @method siblings * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {NodeList} NodeList instance bound to found siblings */ siblings: function(fn) { return Y.all(Y_DOM.siblings(this._node, _wrapFn(fn))); }, /** * Retrieves a single Node instance, the first element matching the given * CSS selector. * Returns null if no match found. * @method one * * @param {string} selector The CSS selector to test against. * @return {Node | null} A Node instance for the matching HTMLElement or null * if no match found. */ one: function(selector) { return Y.one(Y.Selector.query(selector, this._node, true)); }, /** * Retrieves a NodeList based on the given CSS selector. * @method all * * @param {string} selector The CSS selector to test against. * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array. */ all: function(selector) { var nodelist; if (this._node) { nodelist = Y.all(Y.Selector.query(selector, this._node)); nodelist._query = selector; nodelist._queryRoot = this._node; } return nodelist || Y.all([]); }, // TODO: allow fn test /** * Test if the supplied node matches the supplied selector. * @method test * * @param {string} selector The CSS selector to test against. * @return {boolean} Whether or not the node matches the selector. */ test: function(selector) { return Y.Selector.test(this._node, selector); }, /** * Removes the node from its parent. * Shortcut for myNode.get('parentNode').removeChild(myNode); * @method remove * @param {Boolean} destroy whether or not to call destroy() on the node * after removal. * @chainable * */ remove: function(destroy) { var node = this._node; if (node && node.parentNode) { node.parentNode.removeChild(node); } if (destroy) { this.destroy(); } return this; }, /** * Replace the node with the other node. This is a DOM update only * and does not change the node bound to the Node instance. * Shortcut for myNode.get('parentNode').replaceChild(newNode, myNode); * @method replace * @param {Node | HTMLNode} newNode Node to be inserted * @chainable * */ replace: function(newNode) { var node = this._node; if (typeof newNode == 'string') { newNode = Y_Node.create(newNode); } node.parentNode.replaceChild(Y_Node.getDOMNode(newNode), node); return this; }, /** * @method replaceChild * @for Node * @param {String | HTMLElement | Node} node Node to be inserted * @param {HTMLElement | Node} refNode Node to be replaced * @return {Node} The replaced node */ replaceChild: function(node, refNode) { if (typeof node == 'string') { node = Y_DOM.create(node); } return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node), Y_Node.getDOMNode(refNode))); }, /** * Nulls internal node references, removes any plugins and event listeners. * Note that destroy() will not remove the node from its parent or from the DOM. For that * functionality, call remove(true). * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false) * */ destroy: function(recursive) { var UID = Y.config.doc.uniqueID ? 'uniqueID' : '_yuid', instance; this.purge(); // TODO: only remove events add via this Node if (this.unplug) { // may not be a PluginHost this.unplug(); } this.clearData(); if (recursive) { Y.NodeList.each(this.all('*'), function(node) { instance = Y_Node._instances[node[UID]]; if (instance) { instance.destroy(); } else { // purge in case added by other means Y.Event.purgeElement(node); } }); } this._node = null; this._stateProxy = null; delete Y_Node._instances[this._yuid]; }, /** * Invokes a method on the Node instance * @method invoke * @param {String} method The name of the method to invoke * @param {Any} a, b, c, etc. Arguments to invoke the method with. * @return Whatever the underly method returns. * DOM Nodes and Collections return values * are converted to Node/NodeList instances. * */ invoke: function(method, a, b, c, d, e) { var node = this._node, ret; if (a && a._node) { a = a._node; } if (b && b._node) { b = b._node; } ret = node[method](a, b, c, d, e); return Y_Node.scrubVal(ret, this); }, /** * @method swap * @description Swap DOM locations with the given node. * This does not change which DOM node each Node instance refers to. * @param {Node} otherNode The node to swap with * @chainable */ swap: Y.config.doc.documentElement.swapNode ? function(otherNode) { this._node.swapNode(Y_Node.getDOMNode(otherNode)); } : function(otherNode) { otherNode = Y_Node.getDOMNode(otherNode); var node = this._node, parent = otherNode.parentNode, nextSibling = otherNode.nextSibling; if (nextSibling === node) { parent.insertBefore(node, otherNode); } else if (otherNode === node.nextSibling) { parent.insertBefore(otherNode, node); } else { node.parentNode.replaceChild(otherNode, node); Y_DOM.addHTML(parent, node, nextSibling); } return this; }, hasMethod: function(method) { var node = this._node; return !!(node && method in node && typeof node[method] != 'unknown' && (typeof node[method] == 'function' || String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space }, isFragment: function() { return (this.get('nodeType') === 11); }, /** * Removes and destroys all of the nodes within the node. * @method empty * @chainable */ empty: function() { this.get('childNodes').remove().destroy(true); return this; }, /** * Returns the DOM node bound to the Node instance * @method getDOMNode * @return {DOMNode} */ getDOMNode: function() { return this._node; } }, true); Y.Node = Y_Node; Y.one = Y_Node.one; /** * The NodeList module provides support for managing collections of Nodes. * @module node * @submodule node-core */ /** * The NodeList class provides a wrapper for manipulating DOM NodeLists. * NodeList properties can be accessed via the set/get methods. * Use Y.all() to retrieve NodeList instances. * * @class NodeList * @constructor * @param nodes {String|element|Node|Array} A selector, DOM element, Node, list of DOM elements, or list of Nodes with which to populate this NodeList. */ var NodeList = function(nodes) { var tmp = []; if (nodes) { if (typeof nodes === 'string') { // selector query this._query = nodes; nodes = Y.Selector.query(nodes); } else if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window nodes = [nodes]; } else if (nodes._node) { // Y.Node nodes = [nodes._node]; } else if (nodes[0] && nodes[0]._node) { // allow array of Y.Nodes Y.Array.each(nodes, function(node) { if (node._node) { tmp.push(node._node); } }); nodes = tmp; } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes) nodes = Y.Array(nodes, 0, true); } } /** * The underlying array of DOM nodes bound to the Y.NodeList instance * @property _nodes * @private */ this._nodes = nodes || []; }; NodeList.NAME = 'NodeList'; /** * Retrieves the DOM nodes bound to a NodeList instance * @method getDOMNodes * @static * * @param {NodeList} nodelist The NodeList instance * @return {Array} The array of DOM nodes bound to the NodeList */ NodeList.getDOMNodes = function(nodelist) { return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist; }; NodeList.each = function(instance, fn, context) { var nodes = instance._nodes; if (nodes && nodes.length) { Y.Array.each(nodes, fn, context || instance); } else { Y.log('no nodes bound to ' + this, 'warn', 'NodeList'); } }; NodeList.addMethod = function(name, fn, context) { if (name && fn) { NodeList.prototype[name] = function() { var ret = [], args = arguments; Y.Array.each(this._nodes, function(node) { var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid', instance = Y.Node._instances[node[UID]], ctx, result; if (!instance) { instance = NodeList._getTempNode(node); } ctx = context || instance; result = fn.apply(ctx, args); if (result !== undefined && result !== instance) { ret[ret.length] = result; } }); // TODO: remove tmp pointer return ret.length ? ret : this; }; } else { Y.log('unable to add method: ' + name + ' to NodeList', 'warn', 'node'); } }; NodeList.importMethod = function(host, name, altName) { if (typeof name === 'string') { altName = altName || name; NodeList.addMethod(name, host[name]); } else { Y.Array.each(name, function(n) { NodeList.importMethod(host, n); }); } }; NodeList._getTempNode = function(node) { var tmp = NodeList._tempNode; if (!tmp) { tmp = Y.Node.create('<div></div>'); NodeList._tempNode = tmp; } tmp._node = node; tmp._stateProxy = node; return tmp; }; Y.mix(NodeList.prototype, { _invoke: function(method, args, getter) { var ret = (getter) ? [] : this; this.each(function(node) { var val = node[method].apply(node, args); if (getter) { ret.push(val); } }); return ret; }, /** * Retrieves the Node instance at the given index. * @method item * * @param {Number} index The index of the target Node. * @return {Node} The Node instance at the given index. */ item: function(index) { return Y.one((this._nodes || [])[index]); }, /** * Applies the given function to each Node in the NodeList. * @method each * @param {Function} fn The function to apply. It receives 3 arguments: * the current node instance, the node's index, and the NodeList instance * @param {Object} context optional An optional context to apply the function with * Default context is the current Node instance * @chainable */ each: function(fn, context) { var instance = this; Y.Array.each(this._nodes, function(node, index) { node = Y.one(node); return fn.call(context || node, node, index, instance); }); return instance; }, batch: function(fn, context) { var nodelist = this; Y.Array.each(this._nodes, function(node, index) { var instance = Y.Node._instances[node[UID]]; if (!instance) { instance = NodeList._getTempNode(node); } return fn.call(context || instance, instance, index, nodelist); }); return nodelist; }, /** * Executes the function once for each node until a true value is returned. * @method some * @param {Function} fn The function to apply. It receives 3 arguments: * the current node instance, the node's index, and the NodeList instance * @param {Object} context optional An optional context to execute the function from. * Default context is the current Node instance * @return {Boolean} Whether or not the function returned true for any node. */ some: function(fn, context) { var instance = this; return Y.Array.some(this._nodes, function(node, index) { node = Y.one(node); context = context || node; return fn.call(context, node, index, instance); }); }, /** * Creates a documenFragment from the nodes bound to the NodeList instance * @method toFrag * @return {Node} a Node instance bound to the documentFragment */ toFrag: function() { return Y.one(Y.DOM._nl2frag(this._nodes)); }, /** * Returns the index of the node in the NodeList instance * or -1 if the node isn't found. * @method indexOf * @param {Node | DOMNode} node the node to search for * @return {Int} the index of the node value or -1 if not found */ indexOf: function(node) { return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node)); }, /** * Filters the NodeList instance down to only nodes matching the given selector. * @method filter * @param {String} selector The selector to filter against * @return {NodeList} NodeList containing the updated collection * @see Selector */ filter: function(selector) { return Y.all(Y.Selector.filter(this._nodes, selector)); }, /** * Creates a new NodeList containing all nodes at every n indices, where * remainder n % index equals r. * (zero-based index). * @method modulus * @param {Int} n The offset to use (return every nth node) * @param {Int} r An optional remainder to use with the modulus operation (defaults to zero) * @return {NodeList} NodeList containing the updated collection */ modulus: function(n, r) { r = r || 0; var nodes = []; NodeList.each(this, function(node, i) { if (i % n === r) { nodes.push(node); } }); return Y.all(nodes); }, /** * Creates a new NodeList containing all nodes at odd indices * (zero-based index). * @method odd * @return {NodeList} NodeList containing the updated collection */ odd: function() { return this.modulus(2, 1); }, /** * Creates a new NodeList containing all nodes at even indices * (zero-based index), including zero. * @method even * @return {NodeList} NodeList containing the updated collection */ even: function() { return this.modulus(2); }, destructor: function() { }, /** * Reruns the initial query, when created using a selector query * @method refresh * @chainable */ refresh: function() { var doc, nodes = this._nodes, query = this._query, root = this._queryRoot; if (query) { if (!root) { if (nodes && nodes[0] && nodes[0].ownerDocument) { root = nodes[0].ownerDocument; } } this._nodes = Y.Selector.query(query, root); } return this; }, /** * Returns the current number of items in the NodeList. * @method size * @return {Int} The number of items in the NodeList. */ size: function() { return this._nodes.length; }, /** * Determines if the instance is bound to any nodes * @method isEmpty * @return {Boolean} Whether or not the NodeList is bound to any nodes */ isEmpty: function() { return this._nodes.length < 1; }, toString: function() { var str = '', errorMsg = this[UID] + ': not bound to any nodes', nodes = this._nodes, node; if (nodes && nodes[0]) { node = nodes[0]; str += node[NODE_NAME]; if (node.id) { str += '#' + node.id; } if (node.className) { str += '.' + node.className.replace(' ', '.'); } if (nodes.length > 1) { str += '...[' + nodes.length + ' items]'; } } return str || errorMsg; }, /** * Returns the DOM node bound to the Node instance * @method getDOMNodes * @return {Array} */ getDOMNodes: function() { return this._nodes; } }, true); NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance. Nulls internal node references, * removes any plugins and event listeners * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to * remove listeners from the node's subtree (default is false) * @see Node.destroy */ 'destroy', /** * Called on each Node instance. Removes and destroys all of the nodes * within the node * @method empty * @chainable * @see Node.empty */ 'empty', /** * Called on each Node instance. Removes the node from its parent. * Shortcut for myNode.get('parentNode').removeChild(myNode); * @method remove * @param {Boolean} destroy whether or not to call destroy() on the node * after removal. * @chainable * @see Node.remove */ 'remove', /** * Called on each Node instance. Sets an attribute on the Node instance. * Unless pre-configured (via Node.ATTRS), set hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be set. * To set custom attributes use setAttribute. * @method set * @param {String} attr The attribute to be set. * @param {any} val The value to set the attribute to. * @chainable * @see Node.set */ 'set' ]); // one-off implementation to convert array of Nodes to NodeList // e.g. Y.all('input').get('parentNode'); /** Called on each Node instance * @method get * @see Node */ NodeList.prototype.get = function(attr) { var ret = [], nodes = this._nodes, isNodeList = false, getTemp = NodeList._getTempNode, instance, val; if (nodes[0]) { instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]); val = instance._get(attr); if (val && val.nodeType) { isNodeList = true; } } Y.Array.each(nodes, function(node) { instance = Y.Node._instances[node._yuid]; if (!instance) { instance = getTemp(node); } val = instance._get(attr); if (!isNodeList) { // convert array of Nodes to NodeList val = Y.Node.scrubVal(val, instance); } ret.push(val); }); return (isNodeList) ? Y.all(ret) : ret; }; Y.NodeList = NodeList; Y.all = function(nodes) { return new NodeList(nodes); }; Y.Node.all = Y.all; /** * @module node * @submodule node-core */ var Y_NodeList = Y.NodeList, ArrayProto = Array.prototype, ArrayMethods = { /** Returns a new NodeList combining the given NodeList(s) * @for NodeList * @method concat * @param {NodeList | Array} valueN Arrays/NodeLists and/or values to * concatenate to the resulting NodeList * @return {NodeList} A new NodeList comprised of this NodeList joined with the input. */ 'concat': 1, /** Removes the last from the NodeList and returns it. * @for NodeList * @method pop * @return {Node | null} The last item in the NodeList, or null if the list is empty. */ 'pop': 0, /** Adds the given Node(s) to the end of the NodeList. * @for NodeList * @method push * @param {Node | DOMNode} nodes One or more nodes to add to the end of the NodeList. */ 'push': 0, /** Removes the first item from the NodeList and returns it. * @for NodeList * @method shift * @return {Node | null} The first item in the NodeList, or null if the NodeList is empty. */ 'shift': 0, /** Returns a new NodeList comprising the Nodes in the given range. * @for NodeList * @method slice * @param {Number} begin Zero-based index at which to begin extraction. As a negative index, start indicates an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element in the sequence. * @param {Number} end Zero-based index at which to end extraction. slice extracts up to but not including end. slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. If end is omitted, slice extracts to the end of the sequence. * @return {NodeList} A new NodeList comprised of this NodeList joined with the input. */ 'slice': 1, /** Changes the content of the NodeList, adding new elements while removing old elements. * @for NodeList * @method splice * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end. * @param {Number} howMany An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you should specify at least one new element. If no howMany parameter is specified (second syntax above, which is a SpiderMonkey extension), all elements after index are removed. * {Node | DOMNode| element1, ..., elementN The elements to add to the array. If you don't specify any elements, splice simply removes elements from the array. * @return {NodeList} The element(s) removed. */ 'splice': 1, /** Adds the given Node(s) to the beginning of the NodeList. * @for NodeList * @method unshift * @param {Node | DOMNode} nodes One or more nodes to add to the NodeList. */ 'unshift': 0 }; Y.Object.each(ArrayMethods, function(returnNodeList, name) { Y_NodeList.prototype[name] = function() { var args = [], i = 0, arg, ret; while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists args.push(arg._node || arg._nodes || arg); } ret = ArrayProto[name].apply(this._nodes, args); if (returnNodeList) { ret = Y.all(ret); } else { ret = Y.Node.scrubVal(ret); } return ret; }; }); /** * @module node * @submodule node-core */ Y.Array.each([ /** * Passes through to DOM method. * @for Node * @method removeChild * @param {HTMLElement | Node} node Node to be removed * @return {Node} The removed node */ 'removeChild', /** * Passes through to DOM method. * @method hasChildNodes * @return {Boolean} Whether or not the node has any childNodes */ 'hasChildNodes', /** * Passes through to DOM method. * @method cloneNode * @param {Boolean} deep Whether or not to perform a deep clone, which includes * subtree and attributes * @return {Node} The clone */ 'cloneNode', /** * Passes through to DOM method. * @method hasAttribute * @param {String} attribute The attribute to test for * @return {Boolean} Whether or not the attribute is present */ 'hasAttribute', /** * Passes through to DOM method. * @method scrollIntoView * @chainable */ 'scrollIntoView', /** * Passes through to DOM method. * @method getElementsByTagName * @param {String} tagName The tagName to collect * @return {NodeList} A NodeList representing the HTMLCollection */ 'getElementsByTagName', /** * Passes through to DOM method. * @method focus * @chainable */ 'focus', /** * Passes through to DOM method. * @method blur * @chainable */ 'blur', /** * Passes through to DOM method. * Only valid on FORM elements * @method submit * @chainable */ 'submit', /** * Passes through to DOM method. * Only valid on FORM elements * @method reset * @chainable */ 'reset', /** * Passes through to DOM method. * @method select * @chainable */ 'select', /** * Passes through to DOM method. * Only valid on TABLE elements * @method createCaption * @chainable */ 'createCaption' ], function(method) { Y.log('adding: ' + method, 'info', 'node'); Y.Node.prototype[method] = function(arg1, arg2, arg3) { var ret = this.invoke(method, arg1, arg2, arg3); return ret; }; }); /** * Passes through to DOM method. * @method removeAttribute * @param {String} attribute The attribute to be removed * @chainable */ // one-off implementation due to IE returning boolean, breaking chaining Y.Node.prototype.removeAttribute = function(attr) { var node = this._node; if (node) { node.removeAttribute(attr, 0); // comma zero for IE < 8 to force case-insensitive } return this; }; Y.Node.importMethod(Y.DOM, [ /** * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. * @method contains * @param {Node | HTMLElement} needle The possible node or descendent * @return {Boolean} Whether or not this node is the needle its ancestor */ 'contains', /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @for Node * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @for Node * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute', /** * Wraps the given HTML around the node. * @method wrap * @param {String} html The markup to wrap around the node. * @chainable * @for Node */ 'wrap', /** * Removes the node's parent node. * @method unwrap * @chainable */ 'unwrap', /** * Applies a unique ID to the node if none exists * @method generateID * @return {String} The existing or generated ID */ 'generateID' ]); Y.NodeList.importMethod(Y.Node.prototype, [ /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @see Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute', /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @see Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows for removing attributes on DOM nodes. * This passes through to the DOM node, allowing for custom attributes. * @method removeAttribute * @see Node * @for NodeList * @param {string} name The attribute to remove */ 'removeAttribute', /** * Removes the parent node from node in the list. * @method unwrap * @chainable */ 'unwrap', /** * Wraps the given HTML around each node. * @method wrap * @param {String} html The markup to wrap around the node. * @chainable */ 'wrap', /** * Applies a unique ID to each node if none exists * @method generateID * @return {String} The existing or generated ID */ 'generateID' ]); }, '@VERSION@', {"requires": ["dom-core", "selector"]}); YUI.add('node-base', function (Y, NAME) { /** * @module node * @submodule node-base */ var methods = [ /** * Determines whether each node has the given className. * @method hasClass * @for Node * @param {String} className the class name to search for * @return {Boolean} Whether or not the element has the specified class */ 'hasClass', /** * Adds a class name to each node. * @method addClass * @param {String} className the class name to add to the node's class attribute * @chainable */ 'addClass', /** * Removes a class name from each node. * @method removeClass * @param {String} className the class name to remove from the node's class attribute * @chainable */ 'removeClass', /** * Replace a class with another class for each node. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name * @chainable */ 'replaceClass', /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @param {String} className the class name to be toggled * @param {Boolean} force Option to force adding or removing the class. * @chainable */ 'toggleClass' ]; Y.Node.importMethod(Y.DOM, methods); /** * Determines whether each node has the given className. * @method hasClass * @see Node.hasClass * @for NodeList * @param {String} className the class name to search for * @return {Array} An array of booleans for each node bound to the NodeList. */ /** * Adds a class name to each node. * @method addClass * @see Node.addClass * @param {String} className the class name to add to the node's class attribute * @chainable */ /** * Removes a class name from each node. * @method removeClass * @see Node.removeClass * @param {String} className the class name to remove from the node's class attribute * @chainable */ /** * Replace a class with another class for each node. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @see Node.replaceClass * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name * @chainable */ /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @see Node.toggleClass * @param {String} className the class name to be toggled * @chainable */ Y.NodeList.importMethod(Y.Node.prototype, methods); /** * @module node * @submodule node-base */ var Y_Node = Y.Node, Y_DOM = Y.DOM; /** * Returns a new dom node using the provided markup string. * @method create * @static * @param {String} html The markup used to create the element * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @param {HTMLDocument} doc An optional document context * @return {Node} A Node instance bound to a DOM node or fragment * @for Node */ Y_Node.create = function(html, doc) { if (doc && doc._node) { doc = doc._node; } return Y.one(Y_DOM.create(html, doc)); }; Y.mix(Y_Node.prototype, { /** * Creates a new Node using the provided markup string. * @method create * @param {String} html The markup used to create the element. * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @param {HTMLDocument} doc An optional document context * @return {Node} A Node instance bound to a DOM node or fragment */ create: Y_Node.create, /** * Inserts the content before the reference node. * @method insert * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @param {Int | Node | HTMLElement | String} where The position to insert at. * Possible "where" arguments * <dl> * <dt>Y.Node</dt> * <dd>The Node to insert before</dd> * <dt>HTMLElement</dt> * <dd>The element to insert before</dd> * <dt>Int</dt> * <dd>The index of the child element to insert before</dd> * <dt>"replace"</dt> * <dd>Replaces the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts before the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts content before the node</dd> * <dt>"after"</dt> * <dd>Inserts content after the node</dd> * </dl> * @chainable */ insert: function(content, where) { this._insert(content, where); return this; }, _insert: function(content, where) { var node = this._node, ret = null; if (typeof where == 'number') { // allow index where = this._node.childNodes[where]; } else if (where && where._node) { // Node where = where._node; } if (content && typeof content != 'string') { // allow Node or NodeList/Array instances content = content._node || content._nodes || content; } ret = Y_DOM.addHTML(node, content, where); return ret; }, /** * Inserts the content as the firstChild of the node. * @method prepend * @param {String | Node | HTMLElement} content The content to insert * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @chainable */ prepend: function(content) { return this.insert(content, 0); }, /** * Inserts the content as the lastChild of the node. * @method append * @param {String | Node | HTMLElement} content The content to insert * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @chainable */ append: function(content) { return this.insert(content, null); }, /** * @method appendChild * @param {String | HTMLElement | Node} node Node to be appended * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @return {Node} The appended node */ appendChild: function(node) { return Y_Node.scrubVal(this._insert(node)); }, /** * @method insertBefore * @param {String | HTMLElement | Node} newNode Node to be appended * @param {HTMLElement | Node} refNode Node to be inserted before * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content. * @return {Node} The inserted node */ insertBefore: function(newNode, refNode) { return Y.Node.scrubVal(this._insert(newNode, refNode)); }, /** * Appends the node to the given node. * @method appendTo * @param {Node | HTMLElement} node The node to append to * @chainable */ appendTo: function(node) { Y.one(node).append(this); return this; }, /** * Replaces the node's current content with the content. * Note that this passes to innerHTML and is not escaped. * Use <a href="../classes/Escape.html#method_html">`Y.Escape.html()`</a> * to escape html content or `set('text')` to add as text. * @method setContent * @deprecated Use setHTML * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert * @chainable */ setContent: function(content) { this._insert(content, 'replace'); return this; }, /** * Returns the node's current content (e.g. innerHTML) * @method getContent * @deprecated Use getHTML * @return {String} The current content */ getContent: function() { var node = this; if (node._node.nodeType === 11) { // 11 === Node.DOCUMENT_FRAGMENT_NODE // "this", when it is a document fragment, must be cloned because // the nodes contained in the fragment actually disappear once // the fragment is appended anywhere node = node.create("<div/>").append(node.cloneNode(true)); } return node.get("innerHTML"); } }); /** * Replaces the node's current html content with the content provided. * Note that this passes to innerHTML and is not escaped. * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text. * @method setHTML * @param {String | HTML | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert * @chainable */ Y.Node.prototype.setHTML = Y.Node.prototype.setContent; /** * Returns the node's current html content (e.g. innerHTML) * @method getHTML * @return {String} The html content */ Y.Node.prototype.getHTML = Y.Node.prototype.getContent; Y.NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance * @for NodeList * @method append * @see Node.append */ 'append', /** * Called on each Node instance * @for NodeList * @method insert * @see Node.insert */ 'insert', /** * Called on each Node instance * @for NodeList * @method appendChild * @see Node.appendChild */ 'appendChild', /** * Called on each Node instance * @for NodeList * @method insertBefore * @see Node.insertBefore */ 'insertBefore', /** * Called on each Node instance * @for NodeList * @method prepend * @see Node.prepend */ 'prepend', /** * Called on each Node instance * Note that this passes to innerHTML and is not escaped. * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text. * @for NodeList * @method setContent * @deprecated Use setHTML */ 'setContent', /** * Called on each Node instance * @for NodeList * @method getContent * @deprecated Use getHTML */ 'getContent', /** * Called on each Node instance * Note that this passes to innerHTML and is not escaped. * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text. * @for NodeList * @method setHTML * @see Node.setHTML */ 'setHTML', /** * Called on each Node instance * @for NodeList * @method getHTML * @see Node.getHTML */ 'getHTML' ]); /** * @module node * @submodule node-base */ var Y_Node = Y.Node, Y_DOM = Y.DOM; /** * Static collection of configuration attributes for special handling * @property ATTRS * @static * @type object */ Y_Node.ATTRS = { /** * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * @config text * @type String */ text: { getter: function() { return Y_DOM.getText(this._node); }, setter: function(content) { Y_DOM.setText(this._node, content); return content; } }, /** * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * @config for * @type String */ 'for': { getter: function() { return Y_DOM.getAttribute(this._node, 'for'); }, setter: function(val) { Y_DOM.setAttribute(this._node, 'for', val); return val; } }, 'options': { getter: function() { return this._node.getElementsByTagName('option'); } }, /** * Returns a NodeList instance of all HTMLElement children. * @readOnly * @config children * @type NodeList */ 'children': { getter: function() { var node = this._node, children = node.children, childNodes, i, len; if (!children) { childNodes = node.childNodes; children = []; for (i = 0, len = childNodes.length; i < len; ++i) { if (childNodes[i].tagName) { children[children.length] = childNodes[i]; } } } return Y.all(children); } }, value: { getter: function() { return Y_DOM.getValue(this._node); }, setter: function(val) { Y_DOM.setValue(this._node, val); return val; } } }; Y.Node.importMethod(Y.DOM, [ /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @for Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @for Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute' ]); /** * @module node * @submodule node-base */ var Y_Node = Y.Node; var Y_NodeList = Y.NodeList; /** * List of events that route to DOM events * @static * @property DOM_EVENTS * @for Node */ Y_Node.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 }; // Add custom event adaptors to this list. This will make it so // that delegate, key, available, contentready, etc all will // be available through Node.on Y.mix(Y_Node.DOM_EVENTS, Y.Env.evt.plugins); Y.augment(Y_Node, Y.EventTarget); Y.mix(Y_Node.prototype, { /** * Removes event listeners from the node and (optionally) its subtree * @method purge * @param {Boolean} recurse (optional) Whether or not to remove listeners from the * node's subtree * @param {String} type (optional) Only remove listeners of the specified type * @chainable * */ purge: function(recurse, type) { Y.Event.purgeElement(this._node, recurse, type); return this; } }); Y.mix(Y.NodeList.prototype, { _prepEvtArgs: function(type, fn, context) { // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc) var args = Y.Array(arguments, 0, true); if (args.length < 2) { // type only (event hash) just add nodes args[2] = this._nodes; } else { args.splice(2, 0, this._nodes); } args[3] = context || this; // default to NodeList instance as context return args; }, /** Subscribe a callback function for each `Node` in the collection to execute in response to a DOM event. NOTE: Generally, the `on()` method should be avoided on `NodeLists`, in favor of using event delegation from a parent Node. See the Event user guide for details. Most DOM events are associated with a preventable default behavior, such as link clicks navigating to a new page. Callbacks are passed a `DOMEventFacade` object as their first argument (usually called `e`) that can be used to prevent this default behavior with `e.preventDefault()`. See the `DOMEventFacade` API for all available properties and methods on the object. By default, the `this` object will be the `NodeList` that the subscription came from, <em>not the `Node` that received the event</em>. Use `e.currentTarget` to refer to the `Node`. Returning `false` from a callback is supported as an alternative to calling `e.preventDefault(); e.stopPropagation();`. However, it is recommended to use the event methods. @example Y.all(".sku").on("keydown", function (e) { if (e.keyCode === 13) { e.preventDefault(); // Use e.currentTarget to refer to the individual Node var item = Y.MyApp.searchInventory( e.currentTarget.get('value') ); // etc ... } }); @method on @param {String} type The name of the event @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching that subscription @for NodeList **/ on: function(type, fn, context) { return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an one-time event listener to each Node bound to the NodeList. * @method once * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {EventHandle} A subscription handle capable of detaching that * subscription * @for NodeList */ once: function(type, fn, context) { return Y.once.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an event listener to each Node bound to the NodeList. * The handler is called only after all on() handlers are called * and the event is not prevented. * @method after * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {EventHandle} A subscription handle capable of detaching that * subscription * @for NodeList */ after: function(type, fn, context) { return Y.after.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an one-time event listener to each Node bound to the NodeList * that will be called only after all on() handlers are called and the * event is not prevented. * * @method onceAfter * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {EventHandle} A subscription handle capable of detaching that * subscription * @for NodeList */ onceAfter: function(type, fn, context) { return Y.onceAfter.apply(Y, this._prepEvtArgs.apply(this, arguments)); } }); Y_NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance * @method detach * @see Node.detach * @for NodeList */ 'detach', /** Called on each Node instance * @method detachAll * @see Node.detachAll * @for NodeList */ 'detachAll' ]); /** Subscribe a callback function to execute in response to a DOM event or custom event. Most DOM events are associated with a preventable default behavior such as link clicks navigating to a new page. Callbacks are passed a `DOMEventFacade` object as their first argument (usually called `e`) that can be used to prevent this default behavior with `e.preventDefault()`. See the `DOMEventFacade` API for all available properties and methods on the object. If the event name passed as the first parameter is not a whitelisted DOM event, it will be treated as a custom event subscriptions, allowing `node.fire('customEventName')` later in the code. Refer to the Event user guide for the full DOM event whitelist. By default, the `this` object in the callback will refer to the subscribed `Node`. Returning `false` from a callback is supported as an alternative to calling `e.preventDefault(); e.stopPropagation();`. However, it is recommended to use the event methods. @example Y.one("#my-form").on("submit", function (e) { e.preventDefault(); // proceed with ajax form submission instead... }); @method on @param {String} type The name of the event @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching that subscription @for Node **/ Y.mix(Y.Node.ATTRS, { offsetHeight: { setter: function(h) { Y.DOM.setHeight(this._node, h); return h; }, getter: function() { return this._node.offsetHeight; } }, offsetWidth: { setter: function(w) { Y.DOM.setWidth(this._node, w); return w; }, getter: function() { return this._node.offsetWidth; } } }); Y.mix(Y.Node.prototype, { sizeTo: function(w, h) { var node; if (arguments.length < 2) { node = Y.one(w); w = node.get('offsetWidth'); h = node.get('offsetHeight'); } this.setAttrs({ offsetWidth: w, offsetHeight: h }); } }); /** * @module node * @submodule node-base */ var Y_Node = Y.Node; Y.mix(Y_Node.prototype, { /** * Makes the node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @method show * @for Node * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ show: function(callback) { callback = arguments[arguments.length - 1]; this.toggleView(true, callback); return this; }, /** * The implementation for showing nodes. * Default is to remove the hidden attribute and reset the CSS style.display property. * @method _show * @protected * @chainable */ _show: function() { this.removeAttribute('hidden'); // For back-compat we need to leave this in for browsers that // do not visually hide a node via the hidden attribute // and for users that check visibility based on style display. this.setStyle('display', ''); }, _isHidden: function() { return Y.DOM.getAttribute(this._node, 'hidden') === 'true'; }, /** * Displays or hides the node. * If the "transition" module is loaded, toggleView optionally * animates the toggling of the node using given named effect. * @method toggleView * @for Node * @param {String} [name] An optional string value to use as transition effect. * @param {Boolean} [on] An optional boolean value to force the node to be shown or hidden * @param {Function} [callback] An optional function to run after the transition completes. * @chainable */ toggleView: function(on, callback) { this._toggleView.apply(this, arguments); return this; }, _toggleView: function(on, callback) { callback = arguments[arguments.length - 1]; // base on current state if not forcing if (typeof on != 'boolean') { on = (this._isHidden()) ? 1 : 0; } if (on) { this._show(); } else { this._hide(); } if (typeof callback == 'function') { callback.call(this); } return this; }, /** * Hides the node. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @method hide * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ hide: function(callback) { callback = arguments[arguments.length - 1]; this.toggleView(false, callback); return this; }, /** * The implementation for hiding nodes. * Default is to set the hidden attribute to true and set the CSS style.display to 'none'. * @method _hide * @protected * @chainable */ _hide: function() { this.setAttribute('hidden', true); // For back-compat we need to leave this in for browsers that // do not visually hide a node via the hidden attribute // and for users that check visibility based on style display. this.setStyle('display', 'none'); } }); Y.NodeList.importMethod(Y.Node.prototype, [ /** * Makes each node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @method show * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @for NodeList * @chainable */ 'show', /** * Hides each node. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @method hide * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ 'hide', /** * Displays or hides each node. * If the "transition" module is loaded, toggleView optionally * animates the toggling of the nodes using given named effect. * @method toggleView * @param {String} [name] An optional string value to use as transition effect. * @param {Boolean} [on] An optional boolean value to force the nodes to be shown or hidden * @param {Function} [callback] An optional function to run after the transition completes. * @chainable */ 'toggleView' ]); if (!Y.config.doc.documentElement.hasAttribute) { // IE < 8 Y.Node.prototype.hasAttribute = function(attr) { if (attr === 'value') { if (this.get('value') !== "") { // IE < 8 fails to populate specified when set in HTML return true; } } return !!(this._node.attributes[attr] && this._node.attributes[attr].specified); }; } // IE throws an error when calling focus() on an element that's invisible, not // displayed, or disabled. Y.Node.prototype.focus = function () { try { this._node.focus(); } catch (e) { Y.log('error focusing node: ' + e.toString(), 'error', 'node'); } return this; }; // IE throws error when setting input.type = 'hidden', // input.setAttribute('type', 'hidden') and input.attributes.type.value = 'hidden' Y.Node.ATTRS.type = { setter: function(val) { if (val === 'hidden') { try { this._node.type = 'hidden'; } catch(e) { this.setStyle('display', 'none'); this._inputType = 'hidden'; } } else { try { // IE errors when changing the type from "hidden' this._node.type = val; } catch (e) { Y.log('error setting type: ' + val, 'info', 'node'); } } return val; }, getter: function() { return this._inputType || this._node.type; }, _bypassProxy: true // don't update DOM when using with Attribute }; if (Y.config.doc.createElement('form').elements.nodeType) { // IE: elements collection is also FORM node which trips up scrubVal. Y.Node.ATTRS.elements = { getter: function() { return this.all('input, textarea, button, select'); } }; } /** * Provides methods for managing custom Node data. * * @module node * @main node * @submodule node-data */ Y.mix(Y.Node.prototype, { _initData: function() { if (! ('_data' in this)) { this._data = {}; } }, /** * @method getData * @for Node * @description Retrieves arbitrary data stored on a Node instance. * If no data is associated with the Node, it will attempt to retrieve * a value from the corresponding HTML data attribute. (e.g. node.getData('foo') * will check node.getAttribute('data-foo')). * @param {string} name Optional name of the data field to retrieve. * If no name is given, all data is returned. * @return {any | Object} Whatever is stored at the given field, * or an object hash of all fields. */ getData: function(name) { this._initData(); var data = this._data, ret = data; if (arguments.length) { // single field if (name in data) { ret = data[name]; } else { // initialize from HTML attribute ret = this._getDataAttribute(name); } } else if (typeof data == 'object' && data !== null) { // all fields ret = {}; Y.Object.each(data, function(v, n) { ret[n] = v; }); ret = this._getDataAttributes(ret); } return ret; }, _getDataAttributes: function(ret) { ret = ret || {}; var i = 0, attrs = this._node.attributes, len = attrs.length, prefix = this.DATA_PREFIX, prefixLength = prefix.length, name; while (i < len) { name = attrs[i].name; if (name.indexOf(prefix) === 0) { name = name.substr(prefixLength); if (!(name in ret)) { // only merge if not already stored ret[name] = this._getDataAttribute(name); } } i += 1; } return ret; }, _getDataAttribute: function(name) { name = this.DATA_PREFIX + name; var node = this._node, attrs = node.attributes, data = attrs && attrs[name] && attrs[name].value; return data; }, /** * @method setData * @for Node * @description Stores arbitrary data on a Node instance. * This is not stored with the DOM node. * @param {string} name The name of the field to set. If no val * is given, name is treated as the data and overrides any existing data. * @param {any} val The value to be assigned to the field. * @chainable */ setData: function(name, val) { this._initData(); if (arguments.length > 1) { this._data[name] = val; } else { this._data = name; } return this; }, /** * @method clearData * @for Node * @description Clears internally stored data. * @param {string} name The name of the field to clear. If no name * is given, all data is cleared. * @chainable */ clearData: function(name) { if ('_data' in this) { if (typeof name != 'undefined') { delete this._data[name]; } else { delete this._data; } } return this; } }); Y.mix(Y.NodeList.prototype, { /** * @method getData * @for NodeList * @description Retrieves arbitrary data stored on each Node instance * bound to the NodeList. * @see Node * @param {string} name Optional name of the data field to retrieve. * If no name is given, all data is returned. * @return {Array} An array containing all of the data for each Node instance. * or an object hash of all fields. */ getData: function(name) { var args = (arguments.length) ? [name] : []; return this._invoke('getData', args, true); }, /** * @method setData * @for NodeList * @description Stores arbitrary data on each Node instance bound to the * NodeList. This is not stored with the DOM node. * @param {string} name The name of the field to set. If no name * is given, name is treated as the data and overrides any existing data. * @param {any} val The value to be assigned to the field. * @chainable */ setData: function(name, val) { var args = (arguments.length > 1) ? [name, val] : [name]; return this._invoke('setData', args); }, /** * @method clearData * @for NodeList * @description Clears data on all Node instances bound to the NodeList. * @param {string} name The name of the field to clear. If no name * is given, all data is cleared. * @chainable */ clearData: function(name) { var args = (arguments.length) ? [name] : []; return this._invoke('clearData', [name]); } }); }, '@VERSION@', {"requires": ["event-base", "node-core", "dom-base"]}); (function () { var GLOBAL_ENV = YUI.Env; if (!GLOBAL_ENV._ready) { GLOBAL_ENV._ready = function() { GLOBAL_ENV.DOMReady = true; GLOBAL_ENV.remove(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready); }; GLOBAL_ENV.add(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready); } })(); YUI.add('event-base', function (Y, NAME) { /* * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * The domready event fires at the moment the browser's DOM is * usable. In most cases, this is before images are fully * downloaded, allowing you to provide a more responsive user * interface. * * In YUI 3, domready subscribers will be notified immediately if * that moment has already passed when the subscription is created. * * One exception is if the yui.js file is dynamically injected into * the page. If this is done, you must tell the YUI instance that * you did this in order for DOMReady (and window load events) to * fire normally. That configuration option is 'injected' -- set * it to true if the yui.js script is not included inline. * * This method is part of the 'event-ready' module, which is a * submodule of 'event'. * * @event domready * @for YUI */ Y.publish('domready', { fireOnce: true, async: true }); if (YUI.Env.DOMReady) { Y.fire('domready'); } else { Y.Do.before(function() { Y.fire('domready'); }, YUI.Env, '_ready'); } /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event * @submodule event-base */ /** * Wraps a DOM event, properties requiring browser abstraction are * fixed here. Provids a security layer when required. * @class DOMEventFacade * @param ev {Event} the DOM event * @param currentTarget {HTMLElement} the element the listener was attached to * @param wrapper {Event.Custom} the custom event wrapper for this DOM event */ var ua = Y.UA, EMPTY = {}, /** * webkit key remapping required for Safari < 3.1 * @property webkitKeymap * @private */ webkitKeymap = { 63232: 38, // up 63233: 40, // down 63234: 37, // left 63235: 39, // right 63276: 33, // page up 63277: 34, // page down 25: 9, // SHIFT-TAB (Safari provides a different key code in // this case, even though the shiftKey modifier is set) 63272: 46, // delete 63273: 36, // home 63275: 35 // end }, /** * Returns a wrapped node. Intended to be used on event targets, * so it will return the node's parent if the target is a text * node. * * If accessing a property of the node throws an error, this is * probably the anonymous div wrapper Gecko adds inside text * nodes. This likely will only occur when attempting to access * the relatedTarget. In this case, we now return null because * the anonymous div is completely useless and we do not know * what the related target was because we can't even get to * the element's parent node. * * @method resolve * @private */ resolve = function(n) { if (!n) { return n; } try { if (n && 3 == n.nodeType) { n = n.parentNode; } } catch(e) { return null; } return Y.one(n); }, DOMEventFacade = function(ev, currentTarget, wrapper) { this._event = ev; this._currentTarget = currentTarget; this._wrapper = wrapper || EMPTY; // if not lazy init this.init(); }; Y.extend(DOMEventFacade, Object, { init: function() { var e = this._event, overrides = this._wrapper.overrides, x = e.pageX, y = e.pageY, c, currentTarget = this._currentTarget; this.altKey = e.altKey; this.ctrlKey = e.ctrlKey; this.metaKey = e.metaKey; this.shiftKey = e.shiftKey; this.type = (overrides && overrides.type) || e.type; this.clientX = e.clientX; this.clientY = e.clientY; this.pageX = x; this.pageY = y; // charCode is unknown in keyup, keydown. keyCode is unknown in keypress. // FF 3.6 - 8+? pass 0 for keyCode in keypress events. // Webkit, FF 3.6-8+?, and IE9+? pass 0 for charCode in keydown, keyup. // Webkit and IE9+? duplicate charCode in keyCode. // Opera never sets charCode, always keyCode (though with the charCode). // IE6-8 don't set charCode or which. // All browsers other than IE6-8 set which=keyCode in keydown, keyup, and // which=charCode in keypress. // // Moral of the story: (e.which || e.keyCode) will always return the // known code for that key event phase. e.keyCode is often different in // keypress from keydown and keyup. c = e.keyCode || e.charCode; if (ua.webkit && (c in webkitKeymap)) { c = webkitKeymap[c]; } this.keyCode = c; this.charCode = c; // Fill in e.which for IE - implementers should always use this over // e.keyCode or e.charCode. this.which = e.which || e.charCode || c; // this.button = e.button; this.button = this.which; this.target = resolve(e.target); this.currentTarget = resolve(currentTarget); this.relatedTarget = resolve(e.relatedTarget); if (e.type == "mousewheel" || e.type == "DOMMouseScroll") { this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1); } if (this._touch) { this._touch(e, currentTarget, this._wrapper); } }, stopPropagation: function() { this._event.stopPropagation(); this._wrapper.stopped = 1; this.stopped = 1; }, stopImmediatePropagation: function() { var e = this._event; if (e.stopImmediatePropagation) { e.stopImmediatePropagation(); } else { this.stopPropagation(); } this._wrapper.stopped = 2; this.stopped = 2; }, preventDefault: function(returnValue) { var e = this._event; e.preventDefault(); e.returnValue = returnValue || false; this._wrapper.prevented = 1; this.prevented = 1; }, halt: function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); } }); DOMEventFacade.resolve = resolve; Y.DOM2EventFacade = DOMEventFacade; Y.DOMEventFacade = DOMEventFacade; /** * The native event * @property _event * @type {Native DOM Event} * @private */ /** The name of the event (e.g. "click") @property type @type {String} **/ /** `true` if the "alt" or "option" key is pressed. @property altKey @type {Boolean} **/ /** `true` if the shift key is pressed. @property shiftKey @type {Boolean} **/ /** `true` if the "Windows" key on a Windows keyboard, "command" key on an Apple keyboard, or "meta" key on other keyboards is pressed. @property metaKey @type {Boolean} **/ /** `true` if the "Ctrl" or "control" key is pressed. @property ctrlKey @type {Boolean} **/ /** * The X location of the event on the page (including scroll) * @property pageX * @type {Number} */ /** * The Y location of the event on the page (including scroll) * @property pageY * @type {Number} */ /** * The X location of the event in the viewport * @property clientX * @type {Number} */ /** * The Y location of the event in the viewport * @property clientY * @type {Number} */ /** * The keyCode for key events. Uses charCode if keyCode is not available * @property keyCode * @type {Number} */ /** * The charCode for key events. Same as keyCode * @property charCode * @type {Number} */ /** * The button that was pushed. 1 for left click, 2 for middle click, 3 for * right click. This is only reliably populated on `mouseup` events. * @property button * @type {Number} */ /** * The button that was pushed. Same as button. * @property which * @type {Number} */ /** * Node reference for the targeted element * @property target * @type {Node} */ /** * Node reference for the element that the listener was attached to. * @property currentTarget * @type {Node} */ /** * Node reference to the relatedTarget * @property relatedTarget * @type {Node} */ /** * Number representing the direction and velocity of the movement of the mousewheel. * Negative is down, the higher the number, the faster. Applies to the mousewheel event. * @property wheelDelta * @type {Number} */ /** * Stops the propagation to the next bubble target * @method stopPropagation */ /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ /** * Prevents the event's default behavior * @method preventDefault * @param returnValue {string} sets the returnValue of the event to this value * (rather than the default false value). This can be used to add a customized * confirmation query to the beforeunload event). */ /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ (function() { /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * @module event * @main event * @submodule event-base */ /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * * @class Event * @static */ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; var _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add, remove = YUI.Env.remove, onLoad = function() { YUI.Env.windowLoaded = true; Y.Event._load(); remove(win, "load", onLoad); }, onUnload = function() { Y.Event._unload(); }, EVENT_READY = 'domready', COMPAT_ARG = '~yui|2|compat~', shouldIterate = function(o) { try { // TODO: See if there's a more performant way to return true early on this, for the common case return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !Y.DOM.isWindow(o)); } catch(ex) { Y.log("collection check failure", "warn", "event"); return false; } }, // aliases to support DOM event subscription clean up when the last // subscriber is detached. deleteAndClean overrides the DOM event's wrapper // CustomEvent _delete method. _ceProtoDelete = Y.CustomEvent.prototype._delete, _deleteAndClean = function(s) { var ret = _ceProtoDelete.apply(this, arguments); if (!this.hasSubs()) { Y.Event._clean(this); } return ret; }, Event = function() { /** * True after the onload event has fired * @property _loadComplete * @type boolean * @static * @private */ var _loadComplete = false, /** * The number of times to poll after window.onload. This number is * increased if additional late-bound handlers are requested after * the page load. * @property _retryCount * @static * @private */ _retryCount = 0, /** * onAvailable listeners * @property _avail * @static * @private */ _avail = [], /** * Custom event wrappers for DOM events. Key is * 'event:' + Element uid stamp + event type * @property _wrappers * @type Y.Event.Custom * @static * @private */ _wrappers = _eventenv.dom_wrappers, _windowLoadKey = null, /** * Custom event wrapper map DOM events. Key is * Element uid stamp. Each item is a hash of custom event * wrappers as provided in the _wrappers collection. This * provides the infrastructure for getListeners. * @property _el_events * @static * @private */ _el_events = _eventenv.dom_map; return { /** * The number of times we should look for elements that are not * in the DOM at the time the event is requested after the document * has been loaded. The default is 1000@amp;40 ms, so it will poll * for 40 seconds or until all outstanding handlers are bound * (whichever comes first). * @property POLL_RETRYS * @type int * @static * @final */ POLL_RETRYS: 1000, /** * The poll interval in milliseconds * @property POLL_INTERVAL * @type int * @static * @final */ POLL_INTERVAL: 40, /** * addListener/removeListener can throw errors in unexpected scenarios. * These errors are suppressed, the method returns false, and this property * is set * @property lastError * @static * @type Error */ lastError: null, /** * poll handle * @property _interval * @static * @private */ _interval: null, /** * document readystate poll handle * @property _dri * @static * @private */ _dri: null, /** * True when the document is initially usable * @property DOMReady * @type boolean * @static */ DOMReady: false, /** * @method startInterval * @static * @private */ startInterval: function() { if (!Event._interval) { Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL); } }, /** * Executes the supplied callback when the item with the supplied * id is found. This is meant to be used to execute behavior as * soon as possible as the page loads. If you use this after the * initial page load it will poll for a fixed time for the element. * The number of times it will poll and the frequency are * configurable. By default it will poll for 10 seconds. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onAvailable * * @param {string||string[]} id the id of the element, or an array * of ids to look for. * @param {function} fn what to execute when the element is found. * @param {object} p_obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} p_override If set to true, fn will execute * in the context of p_obj, if set to an object it * will execute in the context of that object * @param checkContent {boolean} check child node readiness (onContentReady) * @static * @deprecated Use Y.on("available") */ // @TODO fix arguments onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) { var a = Y.Array(id), i, availHandle; // Y.log('onAvailable registered for: ' + id); for (i=0; i<a.length; i=i+1) { _avail.push({ id: a[i], fn: fn, obj: p_obj, override: p_override, checkReady: checkContent, compat: compat }); } _retryCount = this.POLL_RETRYS; // We want the first test to be immediate, but async setTimeout(Event._poll, 0); availHandle = new Y.EventHandle({ _delete: function() { // set by the event system for lazy DOM listeners if (availHandle.handle) { availHandle.handle.detach(); return; } var i, j; // otherwise try to remove the onAvailable listener(s) for (i = 0; i < a.length; i++) { for (j = 0; j < _avail.length; j++) { if (a[i] === _avail[j].id) { _avail.splice(j, 1); } } } } }); return availHandle; }, /** * Works the same way as onAvailable, but additionally checks the * state of sibling elements to determine if the content of the * available element is safe to modify. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onContentReady * * @param {string} id the id of the element to look for. * @param {function} fn what to execute when the element is ready. * @param {object} obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} override If set to true, fn will execute * in the context of p_obj. If an object, fn will * exectute in the context of that object * * @static * @deprecated Use Y.on("contentready") */ // @TODO fix arguments onContentReady: function(id, fn, obj, override, compat) { return Event.onAvailable(id, fn, obj, override, true, compat); }, /** * Adds an event listener * * @method attach * * @param {String} type The type of event to append * @param {Function} fn The method the event invokes * @param {String|HTMLElement|Array|NodeList} el An id, an element * reference, or a collection of ids and/or elements to assign the * listener to. * @param {Object} context optional context object * @param {Boolean|object} args 0..n arguments to pass to the callback * @return {EventHandle} an object to that can be used to detach the listener * * @static */ attach: function(type, fn, el, context) { return Event._attach(Y.Array(arguments, 0, true)); }, _createWrapper: function (el, type, capture, compat, facade) { var cewrapper, ek = Y.stamp(el), key = 'event:' + ek + type; if (false === facade) { key += 'native'; } if (capture) { key += 'capture'; } cewrapper = _wrappers[key]; if (!cewrapper) { // create CE wrapper cewrapper = Y.publish(key, { silent: true, bubbles: false, emitFacade:false, contextFn: function() { if (compat) { return cewrapper.el; } else { cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el); return cewrapper.nodeRef; } } }); cewrapper.overrides = {}; // for later removeListener calls cewrapper.el = el; cewrapper.key = key; cewrapper.domkey = ek; cewrapper.type = type; cewrapper.fn = function(e) { cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade)))); }; cewrapper.capture = capture; if (el == win && type == "load") { // window load happens once cewrapper.fireOnce = true; _windowLoadKey = key; } cewrapper._delete = _deleteAndClean; _wrappers[key] = cewrapper; _el_events[ek] = _el_events[ek] || {}; _el_events[ek][key] = cewrapper; add(el, type, cewrapper.fn, capture); } return cewrapper; }, _attach: function(args, conf) { var compat, handles, oEl, cewrapper, context, fireNow = false, ret, type = args[0], fn = args[1], el = args[2] || win, facade = conf && conf.facade, capture = conf && conf.capture, overrides = conf && conf.overrides; if (args[args.length-1] === COMPAT_ARG) { compat = true; } if (!fn || !fn.call) { // throw new TypeError(type + " attach call failed, callback undefined"); Y.log(type + " attach call failed, invalid callback", "error", "event"); return false; } // The el argument can be an array of elements or element ids. if (shouldIterate(el)) { handles=[]; Y.each(el, function(v, k) { args[2] = v; handles.push(Event._attach(args.slice(), conf)); }); // return (handles.length === 1) ? handles[0] : handles; return new Y.EventHandle(handles); // If the el argument is a string, we assume it is // actually the id of the element. If the page is loaded // we convert el to the actual element, otherwise we // defer attaching the event until the element is // ready } else if (Y.Lang.isString(el)) { // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) { oEl = Y.DOM.byId(el); } else { oEl = Y.Selector.query(el); switch (oEl.length) { case 0: oEl = null; break; case 1: oEl = oEl[0]; break; default: args[2] = oEl; return Event._attach(args, conf); } } if (oEl) { el = oEl; // Not found = defer adding the event until the element is available } else { // Y.log(el + ' not found'); ret = Event.onAvailable(el, function() { // Y.log('lazy attach: ' + args); ret.handle = Event._attach(args, conf); }, Event, true, false, compat); return ret; } } // Element should be an html element or node if (!el) { Y.log("unable to attach event " + type, "warn", "event"); return false; } if (Y.Node && Y.instanceOf(el, Y.Node)) { el = Y.Node.getDOMNode(el); } cewrapper = Event._createWrapper(el, type, capture, compat, facade); if (overrides) { Y.mix(cewrapper.overrides, overrides); } if (el == win && type == "load") { // if the load is complete, fire immediately. // all subscribers, including the current one // will be notified. if (YUI.Env.windowLoaded) { fireNow = true; } } if (compat) { args.pop(); } context = args[3]; // set context to the Node if not specified // ret = cewrapper.on.apply(cewrapper, trimmedArgs); ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null); if (fireNow) { cewrapper.fire(); } return ret; }, /** * Removes an event listener. Supports the signature the event was bound * with, but the preferred way to remove listeners is using the handle * that is returned when using Y.on * * @method detach * * @param {String} type the type of event to remove. * @param {Function} fn the method the event invokes. If fn is * undefined, then all event handlers for the type of event are * removed. * @param {String|HTMLElement|Array|NodeList|EventHandle} el An * event handle, an id, an element reference, or a collection * of ids and/or elements to remove the listener from. * @return {boolean} true if the unbind was successful, false otherwise. * @static */ detach: function(type, fn, el, obj) { var args=Y.Array(arguments, 0, true), compat, l, ok, i, id, ce; if (args[args.length-1] === COMPAT_ARG) { compat = true; // args.pop(); } if (type && type.detach) { return type.detach(); } // The el argument can be a string if (typeof el == "string") { // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) { el = Y.DOM.byId(el); } else { el = Y.Selector.query(el); l = el.length; if (l < 1) { el = null; } else if (l == 1) { el = el[0]; } } // return Event.detach.apply(Event, args); } if (!el) { return false; } if (el.detach) { args.splice(2, 1); return el.detach.apply(el, args); // The el argument can be an array of elements or element ids. } else if (shouldIterate(el)) { ok = true; for (i=0, l=el.length; i<l; ++i) { args[2] = el[i]; ok = ( Y.Event.detach.apply(Y.Event, args) && ok ); } return ok; } if (!type || !fn || !fn.call) { return Event.purgeElement(el, false, type); } id = 'event:' + Y.stamp(el) + type; ce = _wrappers[id]; if (ce) { return ce.detach(fn); } else { return false; } }, /** * Finds the event in the window object, the caller's arguments, or * in the arguments of another method in the callstack. This is * executed automatically for events registered through the event * manager, so the implementer should not normally need to execute * this function at all. * @method getEvent * @param {Event} e the event parameter from the handler * @param {HTMLElement} el the element the listener was attached to * @return {Event} the event * @static */ getEvent: function(e, el, noFacade) { var ev = e || win.event; return (noFacade) ? ev : new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]); }, /** * Generates an unique ID for the element if it does not already * have one. * @method generateId * @param el the element to create the id for * @return {string} the resulting id of the element * @static */ generateId: function(el) { return Y.DOM.generateID(el); }, /** * We want to be able to use getElementsByTagName as a collection * to attach a group of events to. Unfortunately, different * browsers return different types of collections. This function * tests to determine if the object is array-like. It will also * fail if the object is an array, but is empty. * @method _isValidCollection * @param o the object to test * @return {boolean} true if the object is array-like and populated * @deprecated was not meant to be used directly * @static * @private */ _isValidCollection: shouldIterate, /** * hook up any deferred listeners * @method _load * @static * @private */ _load: function(e) { if (!_loadComplete) { // Y.log('Load Complete', 'info', 'event'); _loadComplete = true; // Just in case DOMReady did not go off for some reason // E._ready(); if (Y.fire) { Y.fire(EVENT_READY); } // Available elements may not have been detected before the // window load event fires. Try to find them now so that the // the user is more likely to get the onAvailable notifications // before the window load notification Event._poll(); } }, /** * Polling function that runs before the onload event fires, * attempting to attach to DOM Nodes as soon as they are * available * @method _poll * @static * @private */ _poll: function() { if (Event.locked) { return; } if (Y.UA.ie && !YUI.Env.DOMReady) { // Hold off if DOMReady has not fired and check current // readyState to protect against the IE operation aborted // issue. Event.startInterval(); return; } Event.locked = true; // Y.log.debug("poll"); // keep trying until after the page is loaded. We need to // check the page load state prior to trying to bind the // elements so that we can be certain all elements have been // tested appropriately var i, len, item, el, notAvail, executeItem, tryAgain = !_loadComplete; if (!tryAgain) { tryAgain = (_retryCount > 0); } // onAvailable notAvail = []; executeItem = function (el, item) { var context, ov = item.override; try { if (item.compat) { if (item.override) { if (ov === true) { context = item.obj; } else { context = ov; } } else { context = el; } item.fn.call(context, item.obj); } else { context = item.obj || Y.one(el); item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []); } } catch (e) { Y.log("Error in available or contentReady callback", 'error', 'event'); } }; // onAvailable for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // Y.log('avail: ' + el); executeItem(el, item); _avail[i] = null; } else { // Y.log('NOT avail: ' + el); notAvail.push(item); } } } // onContentReady for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready // @todo should we test parentNode.nextSibling? if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) { executeItem(el, item); _avail[i] = null; } } else { notAvail.push(item); } } } _retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1; if (tryAgain) { // we may need to strip the nulled out items here Event.startInterval(); } else { clearInterval(Event._interval); Event._interval = null; } Event.locked = false; return; }, /** * Removes all listeners attached to the given element via addListener. * Optionally, the node's children can also be purged. * Optionally, you can specify a specific type of event to remove. * @method purgeElement * @param {HTMLElement} el the element to purge * @param {boolean} recurse recursively purge this element's children * as well. Use with caution. * @param {string} type optional type of listener to purge. If * left out, all listeners will be removed * @static */ purgeElement: function(el, recurse, type) { // var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el, var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el, lis = Event.getListeners(oEl, type), i, len, children, child; if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl); len = children.length; for (i = 0; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child); } } } if (lis) { for (i = 0, len = lis.length; i < len; ++i) { lis[i].detachAll(); } } }, /** * Removes all object references and the DOM proxy subscription for * a given event for a DOM node. * * @method _clean * @param wrapper {CustomEvent} Custom event proxy for the DOM * subscription * @private * @static * @since 3.4.0 */ _clean: function (wrapper) { var key = wrapper.key, domkey = wrapper.domkey; remove(wrapper.el, wrapper.type, wrapper.fn, wrapper.capture); delete _wrappers[key]; delete Y._yuievt.events[key]; if (_el_events[domkey]) { delete _el_events[domkey][key]; if (!Y.Object.size(_el_events[domkey])) { delete _el_events[domkey]; } } }, /** * Returns all listeners attached to the given element via addListener. * Optionally, you can specify a specific type of event to return. * @method getListeners * @param el {HTMLElement|string} the element or element id to inspect * @param type {string} optional type of listener to return. If * left out, all listeners will be returned * @return {CustomEvent} the custom event wrapper for the DOM event(s) * @static */ getListeners: function(el, type) { var ek = Y.stamp(el, true), evts = _el_events[ek], results=[] , key = (type) ? 'event:' + ek + type : null, adapters = _eventenv.plugins; if (!evts) { return null; } if (key) { // look for synthetic events if (adapters[type] && adapters[type].eventDef) { key += '_synth'; } if (evts[key]) { results.push(evts[key]); } // get native events as well key += 'native'; if (evts[key]) { results.push(evts[key]); } } else { Y.each(evts, function(v, k) { results.push(v); }); } return (results.length) ? results : null; }, /** * Removes all listeners registered by pe.event. Called * automatically during the unload event. * @method _unload * @static * @private */ _unload: function(e) { Y.each(_wrappers, function(v, k) { if (v.type == 'unload') { v.fire(e); } v.detachAll(); }); remove(win, "unload", onUnload); }, /** * Adds a DOM event directly without the caching, cleanup, context adj, etc * * @method nativeAdd * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeAdd: add, /** * Basic remove listener * * @method nativeRemove * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeRemove: remove }; }(); Y.Event = Event; if (config.injected || YUI.Env.windowLoaded) { onLoad(); } else { add(win, "load", onLoad); } // Process onAvailable/onContentReady items when when the DOM is ready in IE if (Y.UA.ie) { Y.on(EVENT_READY, Event._poll); } try { add(win, "unload", onUnload); } catch(e) { /*jshint maxlen:300*/ Y.log("Registering unload listener failed. This is known to happen in Chrome Packaged Apps and Extensions, which don't support unload, and don't provide a way to test for support", "warn", "event-base"); } Event.Custom = Y.CustomEvent; Event.Subscriber = Y.Subscriber; Event.Target = Y.EventTarget; Event.Handle = Y.EventHandle; Event.Facade = Y.EventFacade; Event._poll(); }()); /** * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * Executes the callback as soon as the specified element * is detected in the DOM. This function expects a selector * string for the element(s) to detect. If you already have * an element reference, you don't need this event. * @event available * @param type {string} 'available' * @param fn {function} the callback function to execute. * @param el {string} an selector for the element(s) to attach * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.available = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null; return Y.Event.onAvailable.call(Y.Event, id, fn, o, a); } }; /** * Executes the callback as soon as the specified element * is detected in the DOM with a nextSibling property * (indicating that the element's children are available). * This function expects a selector * string for the element(s) to detect. If you already have * an element reference, you don't need this event. * @event contentready * @param type {string} 'contentready' * @param fn {function} the callback function to execute. * @param el {string} an selector for the element(s) to attach. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.contentready = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null; return Y.Event.onContentReady.call(Y.Event, id, fn, o, a); } }; }, '@VERSION@', {"requires": ["event-custom-base"]}); (function() { var stateChangeListener, GLOBAL_ENV = YUI.Env, config = YUI.config, doc = config.doc, docElement = doc && doc.documentElement, EVENT_NAME = 'onreadystatechange', pollInterval = config.pollInterval || 40; if (docElement.doScroll && !GLOBAL_ENV._ieready) { GLOBAL_ENV._ieready = function() { GLOBAL_ENV._ready(); }; /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ // Internet Explorer: use the doScroll() method on the root element. // This isolates what appears to be a safe moment to manipulate the // DOM prior to when the document's readyState suggests it is safe to do so. if (self !== self.top) { stateChangeListener = function() { if (doc.readyState == 'complete') { GLOBAL_ENV.remove(doc, EVENT_NAME, stateChangeListener); GLOBAL_ENV.ieready(); } }; GLOBAL_ENV.add(doc, EVENT_NAME, stateChangeListener); } else { GLOBAL_ENV._dri = setInterval(function() { try { docElement.doScroll('left'); clearInterval(GLOBAL_ENV._dri); GLOBAL_ENV._dri = null; GLOBAL_ENV._ieready(); } catch (domNotReady) { } }, pollInterval); } } })(); YUI.add('event-base-ie', function (Y, NAME) { /* * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event * @submodule event-base */ function IEEventFacade() { // IEEventFacade.superclass.constructor.apply(this, arguments); Y.DOM2EventFacade.apply(this, arguments); } /* * (intentially left out of API docs) * Alternate Facade implementation that is based on Object.defineProperty, which * is partially supported in IE8. Properties that involve setup work are * deferred to temporary getters using the static _define method. */ function IELazyFacade(e) { var proxy = Y.config.doc.createEventObject(e), proto = IELazyFacade.prototype; // TODO: necessary? proxy.hasOwnProperty = function () { return true; }; proxy.init = proto.init; proxy.halt = proto.halt; proxy.preventDefault = proto.preventDefault; proxy.stopPropagation = proto.stopPropagation; proxy.stopImmediatePropagation = proto.stopImmediatePropagation; Y.DOM2EventFacade.apply(proxy, arguments); return proxy; } var imp = Y.config.doc && Y.config.doc.implementation, useLazyFacade = Y.config.lazyEventFacade, buttonMap = { 0: 1, // left click 4: 2, // middle click 2: 3 // right click }, relatedTargetMap = { mouseout: 'toElement', mouseover: 'fromElement' }, resolve = Y.DOM2EventFacade.resolve, proto = { init: function() { IEEventFacade.superclass.init.apply(this, arguments); var e = this._event, x, y, d, b, de, t; this.target = resolve(e.srcElement); if (('clientX' in e) && (!x) && (0 !== x)) { x = e.clientX; y = e.clientY; d = Y.config.doc; b = d.body; de = d.documentElement; x += (de.scrollLeft || (b && b.scrollLeft) || 0); y += (de.scrollTop || (b && b.scrollTop) || 0); this.pageX = x; this.pageY = y; } if (e.type == "mouseout") { t = e.toElement; } else if (e.type == "mouseover") { t = e.fromElement; } // fallback to t.relatedTarget to support simulated events. // IE doesn't support setting toElement or fromElement on generic // events, so Y.Event.simulate sets relatedTarget instead. this.relatedTarget = resolve(t || e.relatedTarget); // which should contain the unicode key code if this is a key event. // For click events, which is normalized for which mouse button was // clicked. this.which = // chained assignment this.button = e.keyCode || buttonMap[e.button] || e.button; }, stopPropagation: function() { this._event.cancelBubble = true; this._wrapper.stopped = 1; this.stopped = 1; }, stopImmediatePropagation: function() { this.stopPropagation(); this._wrapper.stopped = 2; this.stopped = 2; }, preventDefault: function(returnValue) { this._event.returnValue = returnValue || false; this._wrapper.prevented = 1; this.prevented = 1; } }; Y.extend(IEEventFacade, Y.DOM2EventFacade, proto); Y.extend(IELazyFacade, Y.DOM2EventFacade, proto); IELazyFacade.prototype.init = function () { var e = this._event, overrides = this._wrapper.overrides, define = IELazyFacade._define, lazyProperties = IELazyFacade._lazyProperties, prop; this.altKey = e.altKey; this.ctrlKey = e.ctrlKey; this.metaKey = e.metaKey; this.shiftKey = e.shiftKey; this.type = (overrides && overrides.type) || e.type; this.clientX = e.clientX; this.clientY = e.clientY; this.keyCode = // chained assignment this.charCode = e.keyCode; this.which = // chained assignment this.button = e.keyCode || buttonMap[e.button] || e.button; for (prop in lazyProperties) { if (lazyProperties.hasOwnProperty(prop)) { define(this, prop, lazyProperties[prop]); } } if (this._touch) { this._touch(e, this._currentTarget, this._wrapper); } }; IELazyFacade._lazyProperties = { target: function () { return resolve(this._event.srcElement); }, relatedTarget: function () { var e = this._event, targetProp = relatedTargetMap[e.type] || 'relatedTarget'; // fallback to t.relatedTarget to support simulated events. // IE doesn't support setting toElement or fromElement on generic // events, so Y.Event.simulate sets relatedTarget instead. return resolve(e[targetProp] || e.relatedTarget); }, currentTarget: function () { return resolve(this._currentTarget); }, wheelDelta: function () { var e = this._event; if (e.type === "mousewheel" || e.type === "DOMMouseScroll") { return (e.detail) ? (e.detail * -1) : // wheelDelta between -80 and 80 result in -1 or 1 Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1); } }, pageX: function () { var e = this._event, val = e.pageX, doc, bodyScroll, docScroll; if (val === undefined) { doc = Y.config.doc; bodyScroll = doc.body && doc.body.scrollLeft; docScroll = doc.documentElement.scrollLeft; val = e.clientX + (docScroll || bodyScroll || 0); } return val; }, pageY: function () { var e = this._event, val = e.pageY, doc, bodyScroll, docScroll; if (val === undefined) { doc = Y.config.doc; bodyScroll = doc.body && doc.body.scrollTop; docScroll = doc.documentElement.scrollTop; val = e.clientY + (docScroll || bodyScroll || 0); } return val; } }; /** * Wrapper function for Object.defineProperty that creates a property whose * value will be calulated only when asked for. After calculating the value, * the getter wll be removed, so it will behave as a normal property beyond that * point. A setter is also assigned so assigning to the property will clear * the getter, so foo.prop = 'a'; foo.prop; won't trigger the getter, * overwriting value 'a'. * * Used only by the DOMEventFacades used by IE8 when the YUI configuration * <code>lazyEventFacade</code> is set to true. * * @method _define * @param o {DOMObject} A DOM object to add the property to * @param prop {String} The name of the new property * @param valueFn {Function} The function that will return the initial, default * value for the property. * @static * @private */ IELazyFacade._define = function (o, prop, valueFn) { function val(v) { var ret = (arguments.length) ? v : valueFn.call(this); delete o[prop]; Object.defineProperty(o, prop, { value: ret, configurable: true, writable: true }); return ret; } Object.defineProperty(o, prop, { get: val, set: val, configurable: true }); }; if (imp && (!imp.hasFeature('Events', '2.0'))) { if (useLazyFacade) { // Make sure we can use the lazy facade logic try { Object.defineProperty(Y.config.doc.createEventObject(), 'z', {}); } catch (e) { useLazyFacade = false; } } Y.DOMEventFacade = (useLazyFacade) ? IELazyFacade : IEEventFacade; } }, '@VERSION@', {"requires": ["node-base"]}); YUI.add('pluginhost-base', function (Y, NAME) { /** * Provides the augmentable PluginHost interface, which can be added to any class. * @module pluginhost */ /** * Provides the augmentable PluginHost interface, which can be added to any class. * @module pluginhost-base */ /** * <p> * An augmentable class, which provides the augmented class with the ability to host plugins. * It adds <a href="#method_plug">plug</a> and <a href="#method_unplug">unplug</a> methods to the augmented class, which can * be used to add or remove plugins from instances of the class. * </p> * * <p>Plugins can also be added through the constructor configuration object passed to the host class' constructor using * the "plugins" property. Supported values for the "plugins" property are those defined by the <a href="#method_plug">plug</a> method. * * For example the following code would add the AnimPlugin and IOPlugin to Overlay (the plugin host): * <xmp> * var o = new Overlay({plugins: [ AnimPlugin, {fn:IOPlugin, cfg:{section:"header"}}]}); * </xmp> * </p> * <p> * Plug.Host's protected <a href="#method_initPlugins">_initPlugins</a> and <a href="#method_destroyPlugins">_destroyPlugins</a> * methods should be invoked by the host class at the appropriate point in the host's lifecyle. * </p> * * @class Plugin.Host */ var L = Y.Lang; function PluginHost() { this._plugins = {}; } PluginHost.prototype = { /** * Adds a plugin to the host object. This will instantiate the * plugin and attach it to the configured namespace on the host object. * * @method plug * @chainable * @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. * @return {Base} A reference to the host object */ plug: function(Plugin, config) { var i, ln, ns; if (L.isArray(Plugin)) { for (i = 0, ln = Plugin.length; i < ln; i++) { this.plug(Plugin[i]); } } else { if (Plugin && !L.isFunction(Plugin)) { config = Plugin.cfg; Plugin = Plugin.fn; } // Plugin should be fn by now if (Plugin && Plugin.NS) { ns = Plugin.NS; config = config || {}; config.host = this; if (this.hasPlugin(ns)) { // Update config if (this[ns].setAttrs) { this[ns].setAttrs(config); } else { Y.log("Attempt to replug an already attached plugin, and we can't setAttrs, because it's not Attribute based: " + ns); } } else { // Create new instance this[ns] = new Plugin(config); this._plugins[ns] = Plugin; } } else { Y.log("Attempt to plug in an invalid plugin. Host:" + this + ", Plugin:" + Plugin); } } return this; }, /** * Removes a plugin from the host object. This will destroy the * plugin instance and delete the namespace from the host object. * * @method unplug * @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. * @return {Base} A reference to the host object * @chainable */ unplug: function(plugin) { var ns = plugin, plugins = this._plugins; if (plugin) { if (L.isFunction(plugin)) { ns = plugin.NS; if (ns && (!plugins[ns] || plugins[ns] !== plugin)) { ns = null; } } if (ns) { if (this[ns]) { if (this[ns].destroy) { this[ns].destroy(); } delete this[ns]; } if (plugins[ns]) { delete plugins[ns]; } } } else { for (ns in this._plugins) { if (this._plugins.hasOwnProperty(ns)) { this.unplug(ns); } } } return this; }, /** * Determines if a plugin has plugged into this host. * * @method hasPlugin * @param {String} ns The plugin's namespace * @return {Plugin} Returns a truthy value (the plugin instance) if present, or undefined if not. */ hasPlugin : function(ns) { return (this._plugins[ns] && this[ns]); }, /** * Initializes static plugins registered on the host (using the * Base.plug static method) and any plugins passed to the * instance through the "plugins" configuration property. * * @method _initPlugins * @param {Config} config The configuration object with property name/value pairs. * @private */ _initPlugins: function(config) { this._plugins = this._plugins || {}; if (this._initConfigPlugins) { this._initConfigPlugins(config); } }, /** * Unplugs and destroys all plugins on the host * @method _destroyPlugins * @private */ _destroyPlugins: function() { this.unplug(); } }; Y.namespace("Plugin").Host = PluginHost; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('pluginhost-config', function (Y, NAME) { /** * Adds pluginhost constructor configuration and static configuration support * @submodule pluginhost-config */ var PluginHost = Y.Plugin.Host, L = Y.Lang; /** * A protected initialization method, used by the host class to initialize * plugin configurations passed the constructor, through the config object. * * Host objects should invoke this method at the appropriate time in their * construction lifecycle. * * @method _initConfigPlugins * @param {Object} config The configuration object passed to the constructor * @protected * @for Plugin.Host */ PluginHost.prototype._initConfigPlugins = function(config) { // Class Configuration var classes = (this._getClasses) ? this._getClasses() : [this.constructor], plug = [], unplug = {}, constructor, i, classPlug, classUnplug, pluginClassName; // TODO: Room for optimization. Can we apply statically/unplug in same pass? for (i = classes.length - 1; i >= 0; i--) { constructor = classes[i]; classUnplug = constructor._UNPLUG; if (classUnplug) { // subclasses over-write Y.mix(unplug, classUnplug, true); } classPlug = constructor._PLUG; if (classPlug) { // subclasses over-write Y.mix(plug, classPlug, true); } } for (pluginClassName in plug) { if (plug.hasOwnProperty(pluginClassName)) { if (!unplug[pluginClassName]) { this.plug(plug[pluginClassName]); } } } // User Configuration if (config && config.plugins) { this.plug(config.plugins); } }; /** * Registers plugins to be instantiated at the class level (plugins * which should be plugged into every instance of the class by default). * * @method plug * @static * * @param {Function} hostClass The host class on which to register the plugins * @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 * @for Plugin.Host */ PluginHost.plug = function(hostClass, plugin, config) { // Cannot plug into Base, since Plugins derive from Base [ will cause infinite recurrsion ] var p, i, l, name; if (hostClass !== Y.Base) { hostClass._PLUG = hostClass._PLUG || {}; if (!L.isArray(plugin)) { if (config) { plugin = {fn:plugin, cfg:config}; } plugin = [plugin]; } for (i = 0, l = plugin.length; i < l;i++) { p = plugin[i]; name = p.NAME || p.fn.NAME; hostClass._PLUG[name] = p; } } }; /** * Unregisters any class level plugins which have been registered by the host class, or any * other class in the hierarchy. * * @method unplug * @static * * @param {Function} hostClass The host class from which to unregister the plugins * @param {Function | Array} plugin The plugin class, or an array of plugin classes * @for Plugin.Host */ PluginHost.unplug = function(hostClass, plugin) { var p, i, l, name; if (hostClass !== Y.Base) { hostClass._UNPLUG = hostClass._UNPLUG || {}; if (!L.isArray(plugin)) { plugin = [plugin]; } for (i = 0, l = plugin.length; i < l; i++) { p = plugin[i]; name = p.NAME; if (!hostClass._PLUG[name]) { hostClass._UNPLUG[name] = p; } else { delete hostClass._PLUG[name]; } } } }; }, '@VERSION@', {"requires": ["pluginhost-base"]}); YUI.add('event-delegate', function (Y, NAME) { /** * Adds event delegation support to the library. * * @module event * @submodule event-delegate */ var toArray = Y.Array, YLang = Y.Lang, isString = YLang.isString, isObject = YLang.isObject, isArray = YLang.isArray, selectorTest = Y.Selector.test, detachCategories = Y.Env.evt.handles; /** * <p>Sets up event delegation on a container element. The delegated event * will use a supplied selector or filtering function to test if the event * references at least one node that should trigger the subscription * callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {String|node} the element that is the delegation container * @param filter {string|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @static * @for Event */ function delegate(type, fn, el, filter) { var args = toArray(arguments, 0, true), query = isString(el) ? el : null, typeBits, synth, container, categories, cat, i, len, handles, handle; // Support Y.delegate({ click: fnA, key: fnB }, el, filter, ...); // and Y.delegate(['click', 'key'], fn, el, filter, ...); if (isObject(type)) { handles = []; if (isArray(type)) { for (i = 0, len = type.length; i < len; ++i) { args[0] = type[i]; handles.push(Y.delegate.apply(Y, args)); } } else { // Y.delegate({'click', fn}, el, filter) => // Y.delegate('click', fn, el, filter) args.unshift(null); // one arg becomes two; need to make space for (i in type) { if (type.hasOwnProperty(i)) { args[0] = i; args[1] = type[i]; handles.push(Y.delegate.apply(Y, args)); } } } return new Y.EventHandle(handles); } typeBits = type.split(/\|/); if (typeBits.length > 1) { cat = typeBits.shift(); args[0] = type = typeBits.shift(); } synth = Y.Node.DOM_EVENTS[type]; if (isObject(synth) && synth.delegate) { handle = synth.delegate.apply(synth, arguments); } if (!handle) { if (!type || !fn || !el || !filter) { Y.log("delegate requires type, callback, parent, & filter", "warn"); return; } container = (query) ? Y.Selector.query(query, null, true) : el; if (!container && isString(el)) { handle = Y.on('available', function () { Y.mix(handle, Y.delegate.apply(Y, args), true); }, el); } if (!handle && container) { args.splice(2, 2, container); // remove the filter handle = Y.Event._attach(args, { facade: false }); handle.sub.filter = filter; handle.sub._notify = delegate.notifySub; } } if (handle && cat) { categories = detachCategories[cat] || (detachCategories[cat] = {}); categories = categories[type] || (categories[type] = []); categories.push(handle); } return handle; } /** Overrides the <code>_notify</code> method on the normal DOM subscription to inject the filtering logic and only proceed in the case of a match. This method is hosted as a private property of the `delegate` method (e.g. `Y.delegate.notifySub`) @method notifySub @param thisObj {Object} default 'this' object for the callback @param args {Array} arguments passed to the event's <code>fire()</code> @param ce {CustomEvent} the custom event managing the DOM subscriptions for the subscribed event on the subscribing node. @return {Boolean} false if the event was stopped @private @static @since 3.2.0 **/ delegate.notifySub = function (thisObj, args, ce) { // Preserve args for other subscribers args = args.slice(); if (this.args) { args.push.apply(args, this.args); } // Only notify subs if the event occurred on a targeted element var currentTarget = delegate._applyFilter(this.filter, args, ce), //container = e.currentTarget, e, i, len, ret; if (currentTarget) { // Support multiple matches up the the container subtree currentTarget = toArray(currentTarget); // The second arg is the currentTarget, but we'll be reusing this // facade, replacing the currentTarget for each use, so it doesn't // matter what element we seed it with. e = args[0] = new Y.DOMEventFacade(args[0], ce.el, ce); e.container = Y.one(ce.el); for (i = 0, len = currentTarget.length; i < len && !e.stopped; ++i) { e.currentTarget = Y.one(currentTarget[i]); ret = this.fn.apply(this.context || e.currentTarget, args); if (ret === false) { // stop further notifications break; } } return ret; } }; /** Compiles a selector string into a filter function to identify whether Nodes along the parent axis of an event's target should trigger event notification. This function is memoized, so previously compiled filter functions are returned if the same selector string is provided. This function may be useful when defining synthetic events for delegate handling. Hosted as a property of the `delegate` method (e.g. `Y.delegate.compileFilter`). @method compileFilter @param selector {String} the selector string to base the filtration on @return {Function} @since 3.2.0 @static **/ delegate.compileFilter = Y.cached(function (selector) { return function (target, e) { return selectorTest(target._node, selector, (e.currentTarget === e.target) ? null : e.currentTarget._node); }; }); /** Regex to test for disabled elements during filtering. This is only relevant to IE to normalize behavior with other browsers, which swallow events that occur to disabled elements. IE fires the event from the parent element instead of the original target, though it does preserve `event.srcElement` as the disabled element. IE also supports disabled on `<a>`, but the event still bubbles, so it acts more like `e.preventDefault()` plus styling. That issue is not handled here because other browsers fire the event on the `<a>`, so delegate is supported in both cases. @property _disabledRE @type {RegExp} @protected @since 3.8.1 **/ delegate._disabledRE = /^(?:button|input|select|textarea)$/i; /** Walks up the parent axis of an event's target, and tests each element against a supplied filter function. If any Nodes, including the container, satisfy the filter, the delegated callback will be triggered for each. Hosted as a protected property of the `delegate` method (e.g. `Y.delegate._applyFilter`). @method _applyFilter @param filter {Function} boolean function to test for inclusion in event notification @param args {Array} the arguments that would be passed to subscribers @param ce {CustomEvent} the DOM event wrapper @return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter @protected **/ delegate._applyFilter = function (filter, args, ce) { var e = args[0], container = ce.el, // facadeless events in IE, have no e.currentTarget target = e.target || e.srcElement, match = [], isContainer = false; // Resolve text nodes to their containing element if (target.nodeType === 3) { target = target.parentNode; } // For IE. IE propagates events from the parent element of disabled // elements, where other browsers swallow the event entirely. To normalize // this in IE, filtering for matching elements should abort if the target // is a disabled form control. if (target.disabled && delegate._disabledRE.test(target.nodeName)) { return match; } // passing target as the first arg rather than leaving well enough alone // making 'this' in the filter function refer to the target. This is to // support bound filter functions. args.unshift(target); if (isString(filter)) { while (target) { isContainer = (target === container); if (selectorTest(target, filter, (isContainer ? null: container))) { match.push(target); } if (isContainer) { break; } target = target.parentNode; } } else { // filter functions are implementer code and should receive wrappers args[0] = Y.one(target); args[1] = new Y.DOMEventFacade(e, container, ce); while (target) { // filter(target, e, extra args...) - this === target if (filter.apply(args[0], args)) { match.push(target); } if (target === container) { break; } target = target.parentNode; args[0] = Y.one(target); } args[1] = e; // restore the raw DOM event } if (match.length <= 1) { match = match[0]; // single match or undefined } // remove the target args.shift(); return match; }; /** * Sets up event delegation on a container element. The delegated event * will use a supplied filter to test if the callback should be executed. * This filter can be either a selector string or a function that returns * a Node to use as the currentTarget for the event. * * The event object for the delegated event is supplied to the callback * function. It is modified slightly in order to support all properties * that may be needed for event delegation. 'currentTarget' is set to * the element that matched the selector string filter or the Node returned * from the filter function. 'container' is set to the element that the * listener is delegated from (this normally would be the 'currentTarget'). * * Filter functions will be called with the arguments that would be passed to * the callback function, including the event object as the first parameter. * The function should return false (or a falsey value) if the success criteria * aren't met, and the Node to use as the event's currentTarget and 'this' * object if they are. * * @method delegate * @param type {string} the event type to delegate * @param fn {function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {string|node} the element that is the delegation container * @param filter {string|function} a selector that must match the target of the * event or a function that returns a Node or false. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.delegate = Y.Event.delegate = delegate; }, '@VERSION@', {"requires": ["node-base"]}); YUI.add('node-event-delegate', function (Y, NAME) { /** * Functionality to make the node a delegated event container * @module node * @submodule node-event-delegate */ /** * <p>Sets up a delegation listener for an event occurring inside the Node. * The delegated event will be verified against a supplied selector or * filtering function to test if the event references at least one node that * should trigger the subscription callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param spec {String|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context {Object} optional argument that specifies what 'this' refers to. * @param args* {any} 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for Node */ Y.Node.prototype.delegate = function(type) { var args = Y.Array(arguments, 0, true), index = (Y.Lang.isObject(type) && !Y.Lang.isArray(type)) ? 1 : 2; args.splice(index, 0, this._node); return Y.delegate.apply(Y, args); }; }, '@VERSION@', {"requires": ["node-base", "event-delegate"]}); 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); // 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; }; }, '@VERSION@', {"requires": ["node-base", "pluginhost"]}); YUI.add('node-screen', function (Y, NAME) { /** * Extended Node interface for managing regions and screen positioning. * Adds support for positioning elements and normalizes window size and scroll detection. * @module node * @submodule node-screen */ // these are all "safe" returns, no wrapping required Y.each([ /** * Returns the inner width of the viewport (exludes scrollbar). * @config winWidth * @for Node * @type {Int} */ 'winWidth', /** * Returns the inner height of the viewport (exludes scrollbar). * @config winHeight * @type {Int} */ 'winHeight', /** * Document width * @config docWidth * @type {Int} */ 'docWidth', /** * Document height * @config docHeight * @type {Int} */ 'docHeight', /** * Pixel distance the page has been scrolled horizontally * @config docScrollX * @type {Int} */ 'docScrollX', /** * Pixel distance the page has been scrolled vertically * @config docScrollY * @type {Int} */ 'docScrollY' ], function(name) { Y.Node.ATTRS[name] = { getter: function() { var args = Array.prototype.slice.call(arguments); args.unshift(Y.Node.getDOMNode(this)); return Y.DOM[name].apply(this, args); } }; } ); Y.Node.ATTRS.scrollLeft = { getter: function() { var node = Y.Node.getDOMNode(this); return ('scrollLeft' in node) ? node.scrollLeft : Y.DOM.docScrollX(node); }, setter: function(val) { var node = Y.Node.getDOMNode(this); if (node) { if ('scrollLeft' in node) { node.scrollLeft = val; } else if (node.document || node.nodeType === 9) { Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc } } else { Y.log('unable to set scrollLeft for ' + node, 'error', 'Node'); } } }; Y.Node.ATTRS.scrollTop = { getter: function() { var node = Y.Node.getDOMNode(this); return ('scrollTop' in node) ? node.scrollTop : Y.DOM.docScrollY(node); }, setter: function(val) { var node = Y.Node.getDOMNode(this); if (node) { if ('scrollTop' in node) { node.scrollTop = val; } else if (node.document || node.nodeType === 9) { Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc } } else { Y.log('unable to set scrollTop for ' + node, 'error', 'Node'); } } }; Y.Node.importMethod(Y.DOM, [ /** * Gets the current position of the node in page coordinates. * @method getXY * @for Node * @return {Array} The XY position of the node */ 'getXY', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setXY * @param {Array} xy Contains X & Y values for new position (coordinates are page-based) * @chainable */ 'setXY', /** * Gets the current position of the node in page coordinates. * @method getX * @return {Int} The X position of the node */ 'getX', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setX * @param {Int} x X value for new position (coordinates are page-based) * @chainable */ 'setX', /** * Gets the current position of the node in page coordinates. * @method getY * @return {Int} The Y position of the node */ 'getY', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setY * @param {Int} y Y value for new position (coordinates are page-based) * @chainable */ 'setY', /** * Swaps the XY position of this node with another node. * @method swapXY * @param {Node | HTMLElement} otherNode The node to swap with. * @chainable */ 'swapXY' ]); /** * @module node * @submodule node-screen */ /** * Returns a region object for the node * @config region * @for Node * @type Node */ Y.Node.ATTRS.region = { getter: function() { var node = this.getDOMNode(), region; if (node && !node.tagName) { if (node.nodeType === 9) { // document node = node.documentElement; } } if (Y.DOM.isWindow(node)) { region = Y.DOM.viewportRegion(node); } else { region = Y.DOM.region(node); } return region; } }; /** * Returns a region object for the node's viewport * @config viewportRegion * @type Node */ Y.Node.ATTRS.viewportRegion = { getter: function() { return Y.DOM.viewportRegion(Y.Node.getDOMNode(this)); } }; Y.Node.importMethod(Y.DOM, 'inViewportRegion'); // these need special treatment to extract 2nd node arg /** * Compares the intersection of the node with another node or region * @method intersect * @for Node * @param {Node|Object} node2 The node or region to compare with. * @param {Object} altRegion An alternate region to use (rather than this node's). * @return {Object} An object representing the intersection of the regions. */ Y.Node.prototype.intersect = function(node2, altRegion) { var node1 = Y.Node.getDOMNode(this); if (Y.instanceOf(node2, Y.Node)) { // might be a region object node2 = Y.Node.getDOMNode(node2); } return Y.DOM.intersect(node1, node2, altRegion); }; /** * Determines whether or not the node is within the giving region. * @method inRegion * @param {Node|Object} node2 The node or region to compare with. * @param {Boolean} all Whether or not all of the node must be in the region. * @param {Object} altRegion An alternate region to use (rather than this node's). * @return {Boolean} True if in region, false if not. */ Y.Node.prototype.inRegion = function(node2, all, altRegion) { var node1 = Y.Node.getDOMNode(this); if (Y.instanceOf(node2, Y.Node)) { // might be a region object node2 = Y.Node.getDOMNode(node2); } return Y.DOM.inRegion(node1, node2, all, altRegion); }; }, '@VERSION@', {"requires": ["dom-screen", "node-base"]}); YUI.add('node-style', function (Y, NAME) { (function(Y) { /** * Extended Node interface for managing node styles. * @module node * @submodule node-style */ Y.mix(Y.Node.prototype, { /** * Sets a style property of the node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyle * @param {String} attr The style attribute to set. * @param {String|Number} val The value. * @chainable */ setStyle: function(attr, val) { Y.DOM.setStyle(this._node, attr, val); return this; }, /** * Sets multiple style properties on the node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyles * @param {Object} hash An object literal of property:value pairs. * @chainable */ setStyles: function(hash) { Y.DOM.setStyles(this._node, hash); return this; }, /** * Returns the style's current value. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getStyle * @for Node * @param {String} attr The style attribute to retrieve. * @return {String} The current value of the style property for the element. */ getStyle: function(attr) { return Y.DOM.getStyle(this._node, attr); }, /** * Returns the computed value for the given style property. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getComputedStyle * @param {String} attr The style attribute to retrieve. * @return {String} The computed value of the style property for the element. */ getComputedStyle: function(attr) { return Y.DOM.getComputedStyle(this._node, attr); } }); /** * Returns an array of values for each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getStyle * @for NodeList * @see Node.getStyle * @param {String} attr The style attribute to retrieve. * @return {Array} The current values of the style property for the element. */ /** * Returns an array of the computed value for each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method getComputedStyle * @see Node.getComputedStyle * @param {String} attr The style attribute to retrieve. * @return {Array} The computed values for each node. */ /** * Sets a style property on each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyle * @see Node.setStyle * @param {String} attr The style attribute to set. * @param {String|Number} val The value. * @chainable */ /** * Sets multiple style properties on each node. * Use camelCase (e.g. 'backgroundColor') for multi-word properties. * @method setStyles * @see Node.setStyles * @param {Object} hash An object literal of property:value pairs. * @chainable */ // These are broken out to handle undefined return (avoid false positive for // chainable) Y.NodeList.importMethod(Y.Node.prototype, ['getStyle', 'getComputedStyle', 'setStyle', 'setStyles']); })(Y); }, '@VERSION@', {"requires": ["dom-style", "node-base"]}); YUI.add('querystring-stringify-simple', function (Y, NAME) { /*global Y */ /** * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings. * This is a subset implementation of the full querystring-stringify.</p> * <p>This module provides the bare minimum functionality (encoding a hash of simple values), * without the additional support for nested data structures. Every key-value pair is * encoded by encodeURIComponent.</p> * <p>This module provides a minimalistic way for io to handle single-level objects * as transaction data.</p> * * @module querystring * @submodule querystring-stringify-simple */ var QueryString = Y.namespace("QueryString"), EUC = encodeURIComponent; QueryString.stringify = function (obj, c) { var qs = [], // Default behavior is false; standard key notation. s = c && c.arrayKey ? true : false, key, i, l; for (key in obj) { if (obj.hasOwnProperty(key)) { if (Y.Lang.isArray(obj[key])) { for (i = 0, l = obj[key].length; i < l; i++) { qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i])); } } else { qs.push(EUC(key) + '=' + EUC(obj[key])); } } } return qs.join('&'); }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('io-base', function (Y, NAME) { /** Base IO functionality. Provides basic XHR transport support. @module io @submodule io-base @for IO **/ var // List of events that comprise the IO event lifecycle. EVENTS = ['start', 'complete', 'end', 'success', 'failure', 'progress'], // Whitelist of used XHR response object properties. XHR_PROPS = ['status', 'statusText', 'responseText', 'responseXML'], win = Y.config.win, uid = 0; /** 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. IO can also use Flash, if specified as a transport, for cross-domain requests. @class IO @constructor @param {Object} config Object of EventTarget's publish method configurations used to configure IO's events. **/ function IO (config) { var io = this; io._uid = 'io:' + uid++; io._init(config); Y.io._map[io._uid] = io; } IO.prototype = { //-------------------------------------- // Properties //-------------------------------------- /** * A counter that increments for each transaction. * * @property _id * @private * @type {Number} */ _id: 0, /** * Object of IO HTTP headers sent with each transaction. * * @property _headers * @private * @type {Object} */ _headers: { 'X-Requested-With' : 'XMLHttpRequest' }, /** * Object that stores timeout values for any transaction with a defined * "timeout" configuration property. * * @property _timeout * @private * @type {Object} */ _timeout: {}, //-------------------------------------- // Methods //-------------------------------------- _init: function(config) { var io = this, i, len; io.cfg = config || {}; Y.augment(io, Y.EventTarget); for (i = 0, len = EVENTS.length; i < len; ++i) { // Publish IO global events with configurations, if any. // IO global events are set to broadcast by default. // These events use the "io:" namespace. io.publish('io:' + EVENTS[i], Y.merge({ broadcast: 1 }, config)); // Publish IO transaction events with configurations, if // any. These events use the "io-trn:" namespace. io.publish('io-trn:' + EVENTS[i], config); } }, /** * Method that creates a unique transaction object for each request. * * @method _create * @private * @param {Object} cfg Configuration object subset to determine if * the transaction is an XDR or file upload, * requiring an alternate transport. * @param {Number} id Transaction id * @return {Object} The transaction object */ _create: function(config, id) { var io = this, transaction = { id : Y.Lang.isNumber(id) ? id : io._id++, uid: io._uid }, alt = config.xdr ? config.xdr.use : null, form = config.form && config.form.upload ? 'iframe' : null, use; if (alt === 'native') { // Non-IE and IE >= 10 can use XHR level 2 and not rely on an // external transport. alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null; // Prevent "pre-flight" OPTIONS request by removing the // `X-Requested-With` HTTP header from CORS requests. This header // can be added back on a per-request basis, if desired. io.setHeader('X-Requested-With'); } use = alt || form; transaction = use ? Y.merge(Y.IO.customTransport(use), transaction) : Y.merge(Y.IO.defaultTransport(), transaction); if (transaction.notify) { config.notify = function (e, t, c) { io.notify(e, t, c); }; } if (!use) { if (win && win.FormData && config.data instanceof win.FormData) { transaction.c.upload.onprogress = function (e) { io.progress(transaction, e, config); }; transaction.c.onload = function (e) { io.load(transaction, e, config); }; transaction.c.onerror = function (e) { io.error(transaction, e, config); }; transaction.upload = true; } } return transaction; }, _destroy: function(transaction) { if (win && !transaction.notify && !transaction.xdr) { if (XHR && !transaction.upload) { transaction.c.onreadystatechange = null; } else if (transaction.upload) { transaction.c.upload.onprogress = null; transaction.c.onload = null; transaction.c.onerror = null; } else if (Y.UA.ie && !transaction.e) { // IE, when using XMLHttpRequest as an ActiveX Object, will throw // a "Type Mismatch" error if the event handler is set to "null". transaction.c.abort(); } } transaction = transaction.c = null; }, /** * Method for creating and firing events. * * @method _evt * @private * @param {String} eventName Event to be published. * @param {Object} transaction Transaction object. * @param {Object} config Configuration data subset for event subscription. */ _evt: function(eventName, transaction, config) { var io = this, params, args = config['arguments'], emitFacade = io.cfg.emitFacade, globalEvent = "io:" + eventName, trnEvent = "io-trn:" + eventName; // Workaround for #2532107 this.detach(trnEvent); if (transaction.e) { transaction.c = { status: 0, statusText: transaction.e }; } // Fire event with parameters or an Event Facade. params = [ emitFacade ? { id: transaction.id, data: transaction.c, cfg: config, 'arguments': args } : transaction.id ]; if (!emitFacade) { if (eventName === EVENTS[0] || eventName === EVENTS[2]) { if (args) { params.push(args); } } else { if (transaction.evt) { params.push(transaction.evt); } else { params.push(transaction.c); } if (args) { params.push(args); } } } params.unshift(globalEvent); // Fire global events. io.fire.apply(io, params); // Fire transaction events, if receivers are defined. if (config.on) { params[0] = trnEvent; io.once(trnEvent, config.on[eventName], config.context || Y); io.fire.apply(io, params); } }, /** * Fires event "io:start" and creates, fires a transaction-specific * start event, if `config.on.start` is defined. * * @method start * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ start: function(transaction, config) { /** * Signals the start of an IO request. * @event io:start */ this._evt(EVENTS[0], transaction, config); }, /** * Fires event "io:complete" and creates, fires a * transaction-specific "complete" event, if config.on.complete is * defined. * * @method complete * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ complete: function(transaction, config) { /** * Signals the completion of the request-response phase of a * transaction. Response status and data are accessible, if * available, in this event. * @event io:complete */ this._evt(EVENTS[1], transaction, config); }, /** * Fires event "io:end" and creates, fires a transaction-specific "end" * event, if config.on.end is defined. * * @method end * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ end: function(transaction, config) { /** * Signals the end of the transaction lifecycle. * @event io:end */ this._evt(EVENTS[2], transaction, config); this._destroy(transaction); }, /** * Fires event "io:success" and creates, fires a transaction-specific * "success" event, if config.on.success is defined. * * @method success * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ success: function(transaction, config) { /** * Signals an HTTP response with status in the 2xx range. * Fires after io:complete. * @event io:success */ this._evt(EVENTS[3], transaction, config); this.end(transaction, config); }, /** * Fires event "io:failure" and creates, fires a transaction-specific * "failure" event, if config.on.failure is defined. * * @method failure * @param {Object} transaction Transaction object. * @param {Object} config Configuration object for the transaction. */ failure: function(transaction, config) { /** * Signals an HTTP response with status outside of the 2xx range. * Fires after io:complete. * @event io:failure */ this._evt(EVENTS[4], transaction, config); this.end(transaction, config); }, /** * Fires event "io:progress" and creates, fires a transaction-specific * "progress" event -- for XMLHttpRequest file upload -- if * config.on.progress is defined. * * @method progress * @param {Object} transaction Transaction object. * @param {Object} progress event. * @param {Object} config Configuration object for the transaction. */ progress: function(transaction, e, config) { /** * Signals the interactive state during a file upload transaction. * This event fires after io:start and before io:complete. * @event io:progress */ transaction.evt = e; this._evt(EVENTS[5], transaction, config); }, /** * Fires event "io:complete" and creates, fires a transaction-specific * "complete" event -- for XMLHttpRequest file upload -- if * config.on.complete is defined. * * @method load * @param {Object} transaction Transaction object. * @param {Object} load event. * @param {Object} config Configuration object for the transaction. */ load: function (transaction, e, config) { transaction.evt = e.target; this._evt(EVENTS[1], transaction, config); }, /** * Fires event "io:failure" and creates, fires a transaction-specific * "failure" event -- for XMLHttpRequest file upload -- if * config.on.failure is defined. * * @method error * @param {Object} transaction Transaction object. * @param {Object} error event. * @param {Object} config Configuration object for the transaction. */ error: function (transaction, e, config) { transaction.evt = e; this._evt(EVENTS[4], transaction, config); }, /** * Retry an XDR transaction, using the Flash tranport, if the native * transport fails. * * @method _retry * @private * @param {Object} transaction Transaction object. * @param {String} uri Qualified path to transaction resource. * @param {Object} config Configuration object for the transaction. */ _retry: function(transaction, uri, config) { this._destroy(transaction); config.xdr.use = 'flash'; return this.send(uri, config, transaction.id); }, /** * Method that concatenates string data for HTTP GET transactions. * * @method _concat * @private * @param {String} uri URI or root data. * @param {String} data Data to be concatenated onto URI. * @return {String} */ _concat: function(uri, data) { uri += (uri.indexOf('?') === -1 ? '?' : '&') + data; return uri; }, /** * Stores default client headers for all transactions. If a label is * passed with no value argument, the header will be deleted. * * @method setHeader * @param {String} name HTTP header * @param {String} value HTTP header value */ setHeader: function(name, value) { if (value) { this._headers[name] = value; } else { delete this._headers[name]; } }, /** * Method that sets all HTTP headers to be sent in a transaction. * * @method _setHeaders * @private * @param {Object} transaction - XHR instance for the specific transaction. * @param {Object} headers - HTTP headers for the specific transaction, as * defined in the configuration object passed to YUI.io(). */ _setHeaders: function(transaction, headers) { headers = Y.merge(this._headers, headers); Y.Object.each(headers, function(value, name) { if (value !== 'disable') { transaction.setRequestHeader(name, headers[name]); } }); }, /** * Starts timeout count if the configuration object has a defined * timeout property. * * @method _startTimeout * @private * @param {Object} transaction Transaction object generated by _create(). * @param {Object} timeout Timeout in milliseconds. */ _startTimeout: function(transaction, timeout) { var io = this; io._timeout[transaction.id] = setTimeout(function() { io._abort(transaction, 'timeout'); }, timeout); }, /** * Clears the timeout interval started by _startTimeout(). * * @method _clearTimeout * @private * @param {Number} id - Transaction id. */ _clearTimeout: function(id) { clearTimeout(this._timeout[id]); delete this._timeout[id]; }, /** * 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 _result * @private * @static * @param {Object} transaction Transaction object generated by _create(). * @param {Object} config Configuration object passed to io(). */ _result: function(transaction, config) { var status; // Firefox will throw an exception if attempting to access // an XHR object's status property, after a request is aborted. try { status = transaction.c.status; } catch(e) { status = 0; } // IE reports HTTP 204 as HTTP 1223. if (status >= 200 && status < 300 || status === 304 || status === 1223) { this.success(transaction, config); } else { this.failure(transaction, config); } }, /** * Event handler bound to onreadystatechange. * * @method _rS * @private * @param {Object} transaction Transaction object generated by _create(). * @param {Object} config Configuration object passed to YUI.io(). */ _rS: function(transaction, config) { var io = this; if (transaction.c.readyState === 4) { if (config.timeout) { io._clearTimeout(transaction.id); } // Yield in the event of request timeout or abort. setTimeout(function() { io.complete(transaction, config); io._result(transaction, config); }, 0); } }, /** * Terminates a transaction due to an explicit abort or timeout. * * @method _abort * @private * @param {Object} transaction Transaction object generated by _create(). * @param {String} type Identifies timed out or aborted transaction. */ _abort: function(transaction, type) { if (transaction && transaction.c) { transaction.e = type; transaction.c.abort(); } }, /** * Requests a transaction. `send()` is implemented as `Y.io()`. Each * transaction may include a configuration object. Its properties are: * * <dl> * <dt>method</dt> * <dd>HTTP method verb (e.g., GET or POST). If this property is not * not defined, the default value will be GET.</dd> * * <dt>data</dt> * <dd>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.</dd> * * <dt>xdr</dt> * <dd>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 of the * transport object are: * <dl> * <dt>use</dt> * <dd>The transport to be used: 'flash' or 'native'</dd> * <dt>dataType</dt> * <dd>Set the value to 'XML' if that is the expected response * content type.</dd> * <dt>credentials</dt> * <dd>Set the value to 'true' to set XHR.withCredentials property to true.</dd> * </dl></dd> * * <dt>form</dt> * <dd>Form serialization configuration object. Its properties are: * <dl> * <dt>id</dt> * <dd>Node object or id of HTML form</dd> * <dt>useDisabled</dt> * <dd>`true` to also serialize disabled form field values * (defaults to `false`)</dd> * </dl></dd> * * <dt>on</dt> * <dd>Assigns transaction event subscriptions. Available events are: * <dl> * <dt>start</dt> * <dd>Fires when a request is sent to a resource.</dd> * <dt>complete</dt> * <dd>Fires when the transaction is complete.</dd> * <dt>success</dt> * <dd>Fires when the HTTP response status is within the 2xx * range.</dd> * <dt>failure</dt> * <dd>Fires when the HTTP response status is outside the 2xx * range, if an exception occurs, if the transation is aborted, * or if the transaction exceeds a configured `timeout`.</dd> * <dt>end</dt> * <dd>Fires at the conclusion of the transaction * lifecycle, after `success` or `failure`.</dd> * </dl> * * <p>Callback functions for `start` and `end` receive the id of the * transaction as a first argument. For `complete`, `success`, and * `failure`, callbacks receive the id and the response object * (usually the XMLHttpRequest instance). If the `arguments` * property was included in the configuration object passed to * `Y.io()`, the configured data will be passed to all callbacks as * the last argument.</p> * </dd> * * <dt>sync</dt> * <dd>Pass `true` to make a same-domain transaction synchronous. * <strong>CAVEAT</strong>: This will negatively impact the user * experience. Have a <em>very</em> good reason if you intend to use * this.</dd> * * <dt>context</dt> * <dd>The "`this'" object for all configured event handlers. If a * specific context is needed for individual callbacks, bind the * callback to a context using `Y.bind()`.</dd> * * <dt>headers</dt> * <dd>Object map of transaction headers to send to the server. The * object keys are the header names and the values are the header * values.</dd> * * <dt>timeout</dt> * <dd>Millisecond threshold for the transaction before being * automatically aborted.</dd> * * <dt>arguments</dt> * <dd>User-defined data passed to all registered event handlers. * This value is available as the second argument in the "start" and * "end" event handlers. It is the third argument in the "complete", * "success", and "failure" event handlers. <strong>Be sure to quote * this property name in the transaction configuration as * "arguments" is a reserved word in JavaScript</strong> (e.g. * `Y.io({ ..., "arguments": stuff })`).</dd> * </dl> * * @method send * @public * @param {String} uri Qualified path to transaction resource. * @param {Object} config Configuration object for the transaction. * @param {Number} id Transaction id, if already set. * @return {Object} */ send: function(uri, config, id) { var transaction, method, i, len, sync, data, io = this, u = uri, response = {}; config = config ? Y.Object(config) : {}; transaction = io._create(config, id); method = config.method ? config.method.toUpperCase() : 'GET'; sync = config.sync; data = config.data; // Serialize a map object into a key-value string using // querystring-stringify-simple. if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) { if (Y.QueryString && Y.QueryString.stringify) { Y.log('Stringifying config.data for request', 'info', 'io'); config.data = data = Y.QueryString.stringify(data); } else { Y.log('Failed to stringify config.data object, likely because `querystring-stringify-simple` is missing.', 'warn', 'io'); } } if (config.form) { if (config.form.upload) { // This is a file upload transaction, calling // upload() in io-upload-iframe. return io.upload(transaction, uri, config); } else { // Serialize HTML form data into a key-value string. data = io._serialize(config.form, data); } } // Convert falsy values to an empty string. This way IE can't be // rediculous and translate `undefined` to "undefined". data || (data = ''); if (data) { switch (method) { case 'GET': case 'HEAD': case 'DELETE': u = io._concat(u, data); data = ''; Y.log('HTTP' + method + ' with data. The querystring is: ' + u, 'info', 'io'); break; case 'POST': case 'PUT': // If Content-Type is defined in the configuration object, or // or as a default header, it will be used instead of // 'application/x-www-form-urlencoded; charset=UTF-8' config.headers = Y.merge({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, config.headers); break; } } if (transaction.xdr) { // Route data to io-xdr module for flash and XDomainRequest. return io.xdr(u, transaction, config); } else if (transaction.notify) { // Route data to custom transport return transaction.c.send(transaction, uri, config); } if (!sync && !transaction.upload) { transaction.c.onreadystatechange = function() { io._rS(transaction, config); }; } try { // Determine if request is to be set as // synchronous or asynchronous. transaction.c.open(method, u, !sync, config.username || null, config.password || null); io._setHeaders(transaction.c, config.headers || {}); io.start(transaction, config); // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft. if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) { transaction.c.withCredentials = true; } // Using "null" with HTTP POST will result in a request // with no Content-Length header defined. transaction.c.send(data); if (sync) { // Create a response object for synchronous transactions, // mixing id and arguments properties with the xhr // properties whitelist. for (i = 0, len = XHR_PROPS.length; i < len; ++i) { response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]]; } response.getAllResponseHeaders = function() { return transaction.c.getAllResponseHeaders(); }; response.getResponseHeader = function(name) { return transaction.c.getResponseHeader(name); }; io.complete(transaction, config); io._result(transaction, config); return response; } } catch(e) { if (transaction.xdr) { // This exception is usually thrown by browsers // that do not support XMLHttpRequest Level 2. // Retry the request with the XDR transport set // to 'flash'. If the Flash transport is not // initialized or available, the transaction // will resolve to a transport error. return io._retry(transaction, uri, config); } else { io.complete(transaction, config); io._result(transaction, config); } } // If config.timeout is defined, and the request is standard XHR, // initialize timeout polling. if (config.timeout) { io._startTimeout(transaction, config.timeout); Y.log('Configuration timeout set to: ' + config.timeout, 'info', 'io'); } return { id: transaction.id, abort: function() { return transaction.c ? io._abort(transaction, 'abort') : false; }, isInProgress: function() { return transaction.c ? (transaction.c.readyState % 4) : false; }, io: io }; } }; /** Method for initiating an ajax call. The first argument is the url end point for the call. The second argument is an object to configure the transaction and attach event subscriptions. The configuration object supports the following properties: <dl> <dt>method</dt> <dd>HTTP method verb (e.g., GET or POST). If this property is not not defined, the default value will be GET.</dd> <dt>data</dt> <dd>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.</dd> <dt>xdr</dt> <dd>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 of the transport object are: <dl> <dt>use</dt> <dd>The transport to be used: 'flash' or 'native'</dd> <dt>dataType</dt> <dd>Set the value to 'XML' if that is the expected response content type.</dd> </dl></dd> <dt>form</dt> <dd>Form serialization configuration object. Its properties are: <dl> <dt>id</dt> <dd>Node object or id of HTML form</dd> <dt>useDisabled</dt> <dd>`true` to also serialize disabled form field values (defaults to `false`)</dd> </dl></dd> <dt>on</dt> <dd>Assigns transaction event subscriptions. Available events are: <dl> <dt>start</dt> <dd>Fires when a request is sent to a resource.</dd> <dt>complete</dt> <dd>Fires when the transaction is complete.</dd> <dt>success</dt> <dd>Fires when the HTTP response status is within the 2xx range.</dd> <dt>failure</dt> <dd>Fires when the HTTP response status is outside the 2xx range, if an exception occurs, if the transation is aborted, or if the transaction exceeds a configured `timeout`.</dd> <dt>end</dt> <dd>Fires at the conclusion of the transaction lifecycle, after `success` or `failure`.</dd> </dl> <p>Callback functions for `start` and `end` receive the id of the transaction as a first argument. For `complete`, `success`, and `failure`, callbacks receive the id and the response object (usually the XMLHttpRequest instance). If the `arguments` property was included in the configuration object passed to `Y.io()`, the configured data will be passed to all callbacks as the last argument.</p> </dd> <dt>sync</dt> <dd>Pass `true` to make a same-domain transaction synchronous. <strong>CAVEAT</strong>: This will negatively impact the user experience. Have a <em>very</em> good reason if you intend to use this.</dd> <dt>context</dt> <dd>The "`this'" object for all configured event handlers. If a specific context is needed for individual callbacks, bind the callback to a context using `Y.bind()`.</dd> <dt>headers</dt> <dd>Object map of transaction headers to send to the server. The object keys are the header names and the values are the header values.</dd> <dt>timeout</dt> <dd>Millisecond threshold for the transaction before being automatically aborted.</dd> <dt>arguments</dt> <dd>User-defined data passed to all registered event handlers. This value is available as the second argument in the "start" and "end" event handlers. It is the third argument in the "complete", "success", and "failure" event handlers. <strong>Be sure to quote this property name in the transaction configuration as "arguments" is a reserved word in JavaScript</strong> (e.g. `Y.io({ ..., "arguments": stuff })`).</dd> </dl> @method io @static @param {String} url qualified path to transaction resource. @param {Object} config configuration object for the transaction. @return {Object} @for YUI **/ Y.io = function(url, config) { // Calling IO through the static interface will use and reuse // an instance of IO. var transaction = Y.io._map['io:0'] || new IO(); return transaction.send.apply(transaction, [url, config]); }; /** Method for setting and deleting IO HTTP headers to be sent with every request. Hosted as a property on the `io` function (e.g. `Y.io.header`). @method header @param {String} name HTTP header @param {String} value HTTP header value @static **/ Y.io.header = function(name, value) { // Calling IO through the static interface will use and reuse // an instance of IO. var transaction = Y.io._map['io:0'] || new IO(); transaction.setHeader(name, value); }; Y.IO = IO; // Map of all IO instances created. Y.io._map = {}; var XHR = win && win.XMLHttpRequest, XDR = win && win.XDomainRequest, AX = win && win.ActiveXObject, // Checks for the presence of the `withCredentials` in an XHR instance // object, which will be present if the environment supports CORS. SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest()); Y.mix(Y.IO, { /** * The ID of the default IO transport, defaults to `xhr` * @property _default * @type {String} * @static */ _default: 'xhr', /** * * @method defaultTransport * @static * @param {String} [id] The transport to set as the default, if empty a new transport is created. * @return {Object} The transport object with a `send` method */ defaultTransport: function(id) { if (id) { Y.log('Setting default IO to: ' + id, 'info', 'io'); Y.IO._default = id; } else { var o = { c: Y.IO.transports[Y.IO._default](), notify: Y.IO._default === 'xhr' ? false : true }; Y.log('Creating default transport: ' + Y.IO._default, 'info', 'io'); return o; } }, /** * An object hash of custom transports available to IO * @property transports * @type {Object} * @static */ transports: { xhr: function () { return XHR ? new XMLHttpRequest() : AX ? new ActiveXObject('Microsoft.XMLHTTP') : null; }, xdr: function () { return XDR ? new XDomainRequest() : null; }, iframe: function () { return {}; }, flash: null, nodejs: null }, /** * Create a custom transport of type and return it's object * @method customTransport * @param {String} id The id of the transport to create. * @static */ customTransport: function(id) { var o = { c: Y.IO.transports[id]() }; o[(id === 'xdr' || id === 'flash') ? 'xdr' : 'notify'] = true; return o; } }); Y.mix(Y.IO.prototype, { /** * Fired from the notify method of the transport which in turn fires * the event on the IO object. * @method notify * @param {String} event The name of the event * @param {Object} transaction The transaction object * @param {Object} config The configuration object for this transaction */ notify: function(event, transaction, config) { var io = this; switch (event) { case 'timeout': case 'abort': case 'transport error': transaction.c = { status: 0, statusText: event }; event = 'failure'; default: io[event].apply(io, [transaction, config]); } } }); }, '@VERSION@', {"requires": ["event-custom-base", "querystring-stringify-simple"]}); YUI.add('json-parse', function (Y, NAME) { var _JSON = Y.config.global.JSON; Y.namespace('JSON').parse = function (obj, reviver, space) { return _JSON.parse((typeof obj === 'string' ? obj : obj + ''), reviver, space); }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('transition', function (Y, NAME) { /** * Provides the transition method for Node. * Transition has no API of its own, but adds the transition method to Node. * * @module transition * @requires node-style */ var CAMEL_VENDOR_PREFIX = '', VENDOR_PREFIX = '', DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', DOCUMENT_STYLE = DOCUMENT[DOCUMENT_ELEMENT].style, TRANSITION_CAMEL = 'transition', TRANSITION_PROPERTY_CAMEL = 'transitionProperty', TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END, EMPTY_OBJ = {}, VENDORS = [ 'Webkit', 'Moz' ], VENDOR_TRANSITION_END = { Webkit: 'webkitTransitionEnd' }, /** * A class for constructing transition instances. * Adds the "transition" method to Node. * @class Transition * @constructor */ Transition = function() { this.init.apply(this, arguments); }; // One off handling of transform-prefixing. Transition._TRANSFORM = 'transform'; Transition._toCamel = function(property) { property = property.replace(/-([a-z])/gi, function(m0, m1) { return m1.toUpperCase(); }); return property; }; Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2; if (m3) { str += '-' + m3.toLowerCase(); } return str; }); return property; }; Transition.SHOW_TRANSITION = 'fadeIn'; Transition.HIDE_TRANSITION = 'fadeOut'; Transition.useNative = false; // Map transition properties to vendor-specific versions. if ('transition' in DOCUMENT_STYLE && 'transitionProperty' in DOCUMENT_STYLE && 'transitionDuration' in DOCUMENT_STYLE && 'transitionTimingFunction' in DOCUMENT_STYLE && 'transitionDelay' in DOCUMENT_STYLE) { Transition.useNative = true; Transition.supported = true; // TODO: remove } else { Y.Array.each(VENDORS, function(val) { // then vendor specific var property = val + 'Transition'; if (property in DOCUMENT[DOCUMENT_ELEMENT].style) { CAMEL_VENDOR_PREFIX = val; VENDOR_PREFIX = Transition._toHyphen(val) + '-'; Transition.useNative = true; Transition.supported = true; // TODO: remove Transition._VENDOR_PREFIX = val; } }); } // Map transform property to vendor-specific versions. // One-off required for cssText injection. if (typeof DOCUMENT_STYLE.transform === 'undefined') { Y.Array.each(VENDORS, function(val) { // then vendor specific var property = val + 'Transform'; if (typeof DOCUMENT_STYLE[property] !== 'undefined') { Transition._TRANSFORM = property; } }); } if (CAMEL_VENDOR_PREFIX) { TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition'; TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty'; } TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property'; TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration'; TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function'; TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; TRANSITION_END = 'transitionend'; ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend'; TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END; Transition.fx = {}; Transition.toggles = {}; Transition._hasEnd = {}; Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; Transition.DEFAULT_EASING = 'ease'; Transition.DEFAULT_DURATION = 0.5; Transition.DEFAULT_DELAY = 0; Transition._nodeAttrs = {}; Transition.prototype = { constructor: Transition, init: function(node, config) { var anim = this; anim._node = node; if (!anim._running && config) { anim._config = config; node._transition = anim; // cache for reuse anim._duration = ('duration' in config) ? config.duration: anim.constructor.DEFAULT_DURATION; anim._delay = ('delay' in config) ? config.delay: anim.constructor.DEFAULT_DELAY; anim._easing = config.easing || anim.constructor.DEFAULT_EASING; anim._count = 0; // track number of animated properties anim._running = false; } return anim; }, addProperty: function(prop, config) { var anim = this, node = this._node, uid = Y.stamp(node), nodeInstance = Y.one(node), attrs = Transition._nodeAttrs[uid], computed, compareVal, dur, attr, val; if (!attrs) { attrs = Transition._nodeAttrs[uid] = {}; } attr = attrs[prop]; // might just be a value if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) { val = config; config = EMPTY_OBJ; } if (typeof val === 'function') { val = val.call(nodeInstance, nodeInstance); } if (attr && attr.transition) { // take control if another transition owns this property if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition } } anim._count++; // properties per transition // make 0 async and fire events dur = ((typeof config.duration !== 'undefined') ? config.duration : anim._duration) || 0.0001; attrs[prop] = { value: val, duration: dur, delay: (typeof config.delay !== 'undefined') ? config.delay : anim._delay, easing: config.easing || anim._easing, transition: anim }; // native end event doesnt fire when setting to same value // supplementing with timer // val may be a string or number (height: 0, etc), but computedStyle is always string computed = Y.DOM.getComputedStyle(node, prop); compareVal = (typeof val === 'string') ? computed : parseFloat(computed); if (Transition.useNative && compareVal === val) { setTimeout(function() { anim._onNativeEnd.call(node, { propertyName: prop, elapsedTime: dur }); }, dur * 1000); } }, removeProperty: function(prop) { var anim = this, attrs = Transition._nodeAttrs[Y.stamp(anim._node)]; if (attrs && attrs[prop]) { delete attrs[prop]; anim._count--; } }, initAttrs: function(config) { var attr, node = this._node; if (config.transform && !config[Transition._TRANSFORM]) { config[Transition._TRANSFORM] = config.transform; delete config.transform; // TODO: copy } for (attr in config) { if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') { Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr)); } } } }, /** * Starts or an animation. * @method run * @chainable * @private */ run: function(callback) { var anim = this, node = anim._node, config = anim._config, data = { type: 'transition:start', config: config }; if (!anim._running) { anim._running = true; if (config.on && config.on.start) { config.on.start.call(Y.one(node), data); } anim.initAttrs(anim._config); anim._callback = callback; anim._start(); } return anim; }, _start: function() { this._runNative(); }, _prepDur: function(dur) { dur = parseFloat(dur) * 1000; return dur + 'ms'; }, _runNative: function() { var anim = this, node = anim._node, uid = Y.stamp(node), style = node.style, computed = node.ownerDocument.defaultView.getComputedStyle(node), attrs = Transition._nodeAttrs[uid], cssText = '', cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)], transitionText = TRANSITION_PROPERTY + ': ', duration = TRANSITION_DURATION + ': ', easing = TRANSITION_TIMING_FUNCTION + ': ', delay = TRANSITION_DELAY + ': ', hyphy, attr, name; // preserve existing transitions if (cssTransition !== 'all') { transitionText += cssTransition + ','; duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ','; easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ','; delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ','; } // run transitions mapped to this instance for (name in attrs) { hyphy = Transition._toHyphen(name); attr = attrs[name]; if ((attr = attrs[name]) && attr.transition === anim) { if (name in node.style) { // only native styles allowed duration += anim._prepDur(attr.duration) + ','; delay += anim._prepDur(attr.delay) + ','; easing += (attr.easing) + ','; transitionText += hyphy + ','; cssText += hyphy + ': ' + attr.value + '; '; } else { this.removeProperty(name); } } } transitionText = transitionText.replace(/,$/, ';'); duration = duration.replace(/,$/, ';'); easing = easing.replace(/,$/, ';'); delay = delay.replace(/,$/, ';'); // only one native end event per node if (!Transition._hasEnd[uid]) { node.addEventListener(TRANSITION_END, anim._onNativeEnd, ''); Transition._hasEnd[uid] = true; } style.cssText += transitionText + duration + easing + delay + cssText; }, _end: function(elapsed) { var anim = this, node = anim._node, callback = anim._callback, config = anim._config, data = { type: 'transition:end', config: config, elapsedTime: elapsed }, nodeInstance = Y.one(node); anim._running = false; anim._callback = null; if (node) { if (config.on && config.on.end) { setTimeout(function() { // IE: allow previous update to finish config.on.end.call(nodeInstance, data); // nested to ensure proper fire order if (callback) { callback.call(nodeInstance, data); } }, 1); } else if (callback) { setTimeout(function() { // IE: allow previous update to finish callback.call(nodeInstance, data); }, 1); } } }, _endNative: function(name) { var node = this._node, value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)]; name = Transition._toHyphen(name); if (typeof value === 'string') { value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ','); value = value.replace(/^,|,$/, ''); node.style[TRANSITION_CAMEL] = value; } }, _onNativeEnd: function(e) { var node = this, uid = Y.stamp(node), event = e,//e._event, name = Transition._toCamel(event.propertyName), elapsed = event.elapsedTime, attrs = Transition._nodeAttrs[uid], attr = attrs[name], anim = (attr) ? attr.transition : null, data, config; if (anim) { anim.removeProperty(name); anim._endNative(name); config = anim._config[name]; data = { type: 'propertyEnd', propertyName: name, elapsedTime: elapsed, config: config }; if (config && config.on && config.on.end) { config.on.end.call(Y.one(node), data); } if (anim._count <= 0) { // after propertyEnd fires anim._end(elapsed); node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style } } }, destroy: function() { var anim = this, node = anim._node; if (node) { node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false); anim._node = null; } } }; Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove /** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({ * duration: 1, // in seconds, default is 0.5 * easing: 'ease-out', // default is 'ease' * delay: '1', // delay start for 1 second, default is 0 * * height: '10px', * width: '10px', * * opacity: { // per property * value: 0, * duration: 2, * delay: 2, * easing: 'ease-in' * } * }); * </pre> * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing. * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) { var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop; if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config; config = null; } fxConfig = Transition.fx[name]; if (config && typeof config !== 'boolean') { config = Y.clone(config); for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) { config[prop] = fxConfig[prop]; } } } } else { config = fxConfig; } } else { // name is a config, config is a callback or undefined callback = config; config = name; } if (anim && !anim._running) { anim.init(this, config); } else { anim = new Transition(this._node, config); } anim.run(callback); return this; }; Y.Node.prototype.show = function(name, config, callback) { this._show(); // show prior to transition if (name && Y.Transition) { if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default if (typeof config === 'function') { callback = config; config = name; } name = Transition.SHOW_TRANSITION; } this.transition(name, config, callback); } else if (name && !Y.Transition) { Y.log('unable to transition show; missing transition module', 'warn', 'node'); } return this; }; Y.NodeList.prototype.show = function(name, config, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).show(name, config, callback); } return this; }; var _wrapCallBack = function(anim, fn, callback) { return function() { if (fn) { fn.call(anim); } if (callback && typeof callback === 'function') { callback.apply(anim._node, arguments); } }; }; Y.Node.prototype.hide = function(name, config, callback) { if (name && Y.Transition) { if (typeof config === 'function') { callback = config; config = null; } callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default if (typeof config === 'function') { callback = config; config = name; } name = Transition.HIDE_TRANSITION; } this.transition(name, config, callback); } else if (name && !Y.Transition) { Y.log('unable to transition hide; missing transition module', 'warn', 'node'); } else { this._hide(); } return this; }; Y.NodeList.prototype.hide = function(name, config, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).hide(name, config, callback); } return this; }; /** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({ * duration: 1, // in seconds, default is 0.5 * easing: 'ease-out', // default is 'ease' * delay: '1', // delay start for 1 second, default is 0 * * height: '10px', * width: '10px', * * opacity: { // per property * value: 0, * duration: 2, * delay: 2, * easing: 'ease-in' * } * }); * </pre> * @for NodeList * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing. * @param {Function} callback A function to run after the transition has completed. The callback fires * once per item in the NodeList. * @chainable */ Y.NodeList.prototype.transition = function(config, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).transition(config, callback); } return this; }; Y.Node.prototype.toggleView = function(name, on, callback) { this._toggles = this._toggles || []; callback = arguments[arguments.length - 1]; if (typeof name !== 'string') { // no transition, just toggle on = name; this._toggleView(on, callback); // call original _toggleView in Y.Node return; } if (typeof on === 'function') { // Ignore "on" if used for callback argument. on = undefined; } if (typeof on === 'undefined' && name in this._toggles) { // reverse current toggle on = ! this._toggles[name]; } on = (on) ? 1 : 0; if (on) { this._show(); } else { callback = _wrapCallBack(this, this._hide, callback); } this._toggles[name] = on; this.transition(Y.Transition.toggles[name][on], callback); return this; }; Y.NodeList.prototype.toggleView = function(name, on, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { node = Y.one(node); node.toggleView.apply(node, arguments); } return this; }; Y.mix(Transition.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(node) { return node.get('scrollHeight') + 'px'; }, width: function(node) { return node.get('scrollWidth') + 'px'; }, duration: 0.5, easing: 'ease-in', on: { start: function() { var overflow = this.getStyle('overflow'); if (overflow !== 'hidden') { // enable scrollHeight/Width this.setStyle('overflow', 'hidden'); this._transitionOverflow = overflow; } }, end: function() { if (this._transitionOverflow) { // revert overridden value this.setStyle('overflow', this._transitionOverflow); delete this._transitionOverflow; } } } } }); Y.mix(Transition.toggles, { size: ['sizeOut', 'sizeIn'], fade: ['fadeOut', 'fadeIn'] }); }, '@VERSION@', {"requires": ["node-style"]}); YUI.add('selector-css2', function (Y, NAME) { /** * The selector module provides helper methods allowing CSS2 Selectors to be used with DOM elements. * @module dom * @submodule selector-css2 * @for Selector */ /* * Provides helper methods for collecting and filtering DOM elements. */ var PARENT_NODE = 'parentNode', TAG_NAME = 'tagName', ATTRIBUTES = 'attributes', COMBINATOR = 'combinator', PSEUDOS = 'pseudos', Selector = Y.Selector, SelectorCSS2 = { _reRegExpTokens: /([\^\$\?\[\]\*\+\-\.\(\)\|\\])/, SORT_RESULTS: true, // TODO: better detection, document specific _isXML: (function() { var isXML = (Y.config.doc.createElement('div').tagName !== 'DIV'); return isXML; }()), /** * Mapping of shorthand tokens to corresponding attribute selector * @property shorthand * @type object */ shorthand: { '\\#(-?[_a-z0-9]+[-\\w\\uE000]*)': '[id=$1]', '\\.(-?[_a-z]+[-\\w\\uE000]*)': '[className~=$1]' }, /** * List of operators and corresponding boolean functions. * These functions are passed the attribute and the current node's value of the attribute. * @property operators * @type object */ operators: { '': function(node, attr) { return Y.DOM.getAttribute(node, attr) !== ''; }, // Just test for existence of attribute '~=': '(?:^|\\s+){val}(?:\\s+|$)', // space-delimited '|=': '^{val}-?' // optional hyphen-delimited }, pseudos: { 'first-child': function(node) { return Y.DOM._children(node[PARENT_NODE])[0] === node; } }, _bruteQuery: function(selector, root, firstOnly) { var ret = [], nodes = [], visited, tokens = Selector._tokenize(selector), token = tokens[tokens.length - 1], rootDoc = Y.DOM._getDoc(root), child, id, className, tagName, isUniversal; if (token) { // prefilter nodes id = token.id; className = token.className; tagName = token.tagName || '*'; if (root.getElementsByTagName) { // non-IE lacks DOM api on doc frags // try ID first, unless no root.all && root not in document // (root.all works off document, but not getElementById) if (id && (root.all || (root.nodeType === 9 || Y.DOM.inDoc(root)))) { nodes = Y.DOM.allById(id, root); // try className } else if (className) { nodes = root.getElementsByClassName(className); } else { // default to tagName nodes = root.getElementsByTagName(tagName); } } else { // brute getElementsByTagName() visited = []; child = root.firstChild; isUniversal = tagName === "*"; while (child) { while (child) { // IE 6-7 considers comment nodes as element nodes, and gives them the tagName "!". // We can filter them out by checking if its tagName is > "@". // This also avoids a superflous nodeType === 1 check. if (child.tagName > "@" && (isUniversal || child.tagName === tagName)) { nodes.push(child); } // We may need to traverse back up the tree to find more unvisited subtrees. visited.push(child); child = child.firstChild; } // Find the most recently visited node who has a next sibling. while (visited.length > 0 && !child) { child = visited.pop().nextSibling; } } } if (nodes.length) { ret = Selector._filterNodes(nodes, tokens, firstOnly); } } return ret; }, _filterNodes: function(nodes, tokens, firstOnly) { var i = 0, j, len = tokens.length, n = len - 1, result = [], node = nodes[0], tmpNode = node, getters = Y.Selector.getters, operator, combinator, token, path, pass, value, tests, test; for (i = 0; (tmpNode = node = nodes[i++]);) { n = len - 1; path = null; testLoop: while (tmpNode && tmpNode.tagName) { token = tokens[n]; tests = token.tests; j = tests.length; if (j && !pass) { while ((test = tests[--j])) { operator = test[1]; if (getters[test[0]]) { value = getters[test[0]](tmpNode, test[0]); } else { value = tmpNode[test[0]]; if (test[0] === 'tagName' && !Selector._isXML) { value = value.toUpperCase(); } if (typeof value != 'string' && value !== undefined && value.toString) { value = value.toString(); // coerce for comparison } else if (value === undefined && tmpNode.getAttribute) { // use getAttribute for non-standard attributes value = tmpNode.getAttribute(test[0], 2); // 2 === force string for IE } } if ((operator === '=' && value !== test[2]) || // fast path for equality (typeof operator !== 'string' && // protect against String.test monkey-patch (Moo) operator.test && !operator.test(value)) || // regex test (!operator.test && // protect against RegExp as function (webkit) typeof operator === 'function' && !operator(tmpNode, test[0], test[2]))) { // function test // skip non element nodes or non-matching tags if ((tmpNode = tmpNode[path])) { while (tmpNode && (!tmpNode.tagName || (token.tagName && token.tagName !== tmpNode.tagName)) ) { tmpNode = tmpNode[path]; } } continue testLoop; } } } n--; // move to next token // now that we've passed the test, move up the tree by combinator if (!pass && (combinator = token.combinator)) { path = combinator.axis; tmpNode = tmpNode[path]; // skip non element nodes while (tmpNode && !tmpNode.tagName) { tmpNode = tmpNode[path]; } if (combinator.direct) { // one pass only path = null; } } else { // success if we made it this far result.push(node); if (firstOnly) { return result; } break; } } } node = tmpNode = null; return result; }, combinators: { ' ': { axis: 'parentNode' }, '>': { axis: 'parentNode', direct: true }, '+': { axis: 'previousSibling', direct: true } }, _parsers: [ { name: ATTRIBUTES, re: /^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i, fn: function(match, token) { var operator = match[2] || '', operators = Selector.operators, escVal = (match[3]) ? match[3].replace(/\\/g, '') : '', test; // add prefiltering for ID and CLASS if ((match[1] === 'id' && operator === '=') || (match[1] === 'className' && Y.config.doc.documentElement.getElementsByClassName && (operator === '~=' || operator === '='))) { token.prefilter = match[1]; match[3] = escVal; // escape all but ID for prefilter, which may run through QSA (via Dom.allById) token[match[1]] = (match[1] === 'id') ? match[3] : escVal; } // add tests if (operator in operators) { test = operators[operator]; if (typeof test === 'string') { match[3] = escVal.replace(Selector._reRegExpTokens, '\\$1'); test = new RegExp(test.replace('{val}', match[3])); } match[2] = test; } if (!token.last || token.prefilter !== match[1]) { return match.slice(1); } } }, { name: TAG_NAME, re: /^((?:-?[_a-z]+[\w-]*)|\*)/i, fn: function(match, token) { var tag = match[1]; if (!Selector._isXML) { tag = tag.toUpperCase(); } token.tagName = tag; if (tag !== '*' && (!token.last || token.prefilter)) { return [TAG_NAME, '=', tag]; } if (!token.prefilter) { token.prefilter = 'tagName'; } } }, { name: COMBINATOR, re: /^\s*([>+~]|\s)\s*/, fn: function(match, token) { } }, { name: PSEUDOS, re: /^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i, fn: function(match, token) { var test = Selector[PSEUDOS][match[1]]; if (test) { // reorder match array and unescape special chars for tests if (match[2]) { match[2] = match[2].replace(/\\/g, ''); } return [match[2], test]; } else { // selector token not supported (possibly missing CSS3 module) return false; } } } ], _getToken: function(token) { return { tagName: null, id: null, className: null, attributes: {}, combinator: null, tests: [] }; }, /* Break selector into token units per simple selector. Combinator is attached to the previous token. */ _tokenize: function(selector) { selector = selector || ''; selector = Selector._parseSelector(Y.Lang.trim(selector)); var token = Selector._getToken(), // one token per simple selector (left selector holds combinator) query = selector, // original query for debug report tokens = [], // array of tokens found = false, // whether or not any matches were found this pass match, // the regex match test, i, parser; /* Search for selector patterns, store, and strip them from the selector string until no patterns match (invalid selector) or we run out of chars. Multiple attributes and pseudos are allowed, in any order. for example: 'form:first-child[type=button]:not(button)[lang|=en]' */ outer: do { found = false; // reset after full pass for (i = 0; (parser = Selector._parsers[i++]);) { if ( (match = parser.re.exec(selector)) ) { // note assignment if (parser.name !== COMBINATOR ) { token.selector = selector; } selector = selector.replace(match[0], ''); // strip current match from selector if (!selector.length) { token.last = true; } if (Selector._attrFilters[match[1]]) { // convert class to className, etc. match[1] = Selector._attrFilters[match[1]]; } test = parser.fn(match, token); if (test === false) { // selector not supported found = false; break outer; } else if (test) { token.tests.push(test); } if (!selector.length || parser.name === COMBINATOR) { tokens.push(token); token = Selector._getToken(token); if (parser.name === COMBINATOR) { token.combinator = Y.Selector.combinators[match[1]]; } } found = true; } } } while (found && selector.length); if (!found || selector.length) { // not fully parsed Y.log('query: ' + query + ' contains unsupported token in: ' + selector, 'warn', 'Selector'); tokens = []; } return tokens; }, _replaceMarkers: function(selector) { selector = selector.replace(/\[/g, '\uE003'); selector = selector.replace(/\]/g, '\uE004'); selector = selector.replace(/\(/g, '\uE005'); selector = selector.replace(/\)/g, '\uE006'); return selector; }, _replaceShorthand: function(selector) { var shorthand = Y.Selector.shorthand, re; for (re in shorthand) { if (shorthand.hasOwnProperty(re)) { selector = selector.replace(new RegExp(re, 'gi'), shorthand[re]); } } return selector; }, _parseSelector: function(selector) { var replaced = Y.Selector._replaceSelector(selector), selector = replaced.selector; // replace shorthand (".foo, #bar") after pseudos and attrs // to avoid replacing unescaped chars selector = Y.Selector._replaceShorthand(selector); selector = Y.Selector._restore('attr', selector, replaced.attrs); selector = Y.Selector._restore('pseudo', selector, replaced.pseudos); // replace braces and parens before restoring escaped chars // to avoid replacing ecaped markers selector = Y.Selector._replaceMarkers(selector); selector = Y.Selector._restore('esc', selector, replaced.esc); return selector; }, _attrFilters: { 'class': 'className', 'for': 'htmlFor' }, getters: { href: function(node, attr) { return Y.DOM.getAttribute(node, attr); }, id: function(node, attr) { return Y.DOM.getId(node); } } }; Y.mix(Y.Selector, SelectorCSS2, true); Y.Selector.getters.src = Y.Selector.getters.rel = Y.Selector.getters.href; // IE wants class with native queries if (Y.Selector.useNative && Y.config.doc.querySelector) { Y.Selector.shorthand['\\.(-?[_a-z]+[-\\w]*)'] = '[class~=$1]'; } }, '@VERSION@', {"requires": ["selector-native"]}); YUI.add('selector-css3', function (Y, NAME) { /** * The selector css3 module provides support for css3 selectors. * @module dom * @submodule selector-css3 * @for Selector */ /* an+b = get every _a_th node starting at the _b_th 0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element 1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n") an+0 = get every _a_th element, "0" may be omitted */ Y.Selector._reNth = /^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/; Y.Selector._getNth = function(node, expr, tag, reverse) { Y.Selector._reNth.test(expr); var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_) n = RegExp.$2, // "n" oddeven = RegExp.$3, // "odd" or "even" b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_ result = [], siblings = Y.DOM._children(node.parentNode, tag), op; if (oddeven) { a = 2; // always every other op = '+'; n = 'n'; b = (oddeven === 'odd') ? 1 : 0; } else if ( isNaN(a) ) { a = (n) ? 1 : 0; // start from the first or no repeat } if (a === 0) { // just the first if (reverse) { b = siblings.length - b + 1; } if (siblings[b - 1] === node) { return true; } else { return false; } } else if (a < 0) { reverse = !!reverse; a = Math.abs(a); } if (!reverse) { for (var i = b - 1, len = siblings.length; i < len; i += a) { if ( i >= 0 && siblings[i] === node ) { return true; } } } else { for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) { if ( i < len && siblings[i] === node ) { return true; } } } return false; }; Y.mix(Y.Selector.pseudos, { 'root': function(node) { return node === node.ownerDocument.documentElement; }, 'nth-child': function(node, expr) { return Y.Selector._getNth(node, expr); }, 'nth-last-child': function(node, expr) { return Y.Selector._getNth(node, expr, null, true); }, 'nth-of-type': function(node, expr) { return Y.Selector._getNth(node, expr, node.tagName); }, 'nth-last-of-type': function(node, expr) { return Y.Selector._getNth(node, expr, node.tagName, true); }, 'last-child': function(node) { var children = Y.DOM._children(node.parentNode); return children[children.length - 1] === node; }, 'first-of-type': function(node) { return Y.DOM._children(node.parentNode, node.tagName)[0] === node; }, 'last-of-type': function(node) { var children = Y.DOM._children(node.parentNode, node.tagName); return children[children.length - 1] === node; }, 'only-child': function(node) { var children = Y.DOM._children(node.parentNode); return children.length === 1 && children[0] === node; }, 'only-of-type': function(node) { var children = Y.DOM._children(node.parentNode, node.tagName); return children.length === 1 && children[0] === node; }, 'empty': function(node) { return node.childNodes.length === 0; }, 'not': function(node, expr) { return !Y.Selector.test(node, expr); }, 'contains': function(node, expr) { var text = node.innerText || node.textContent || ''; return text.indexOf(expr) > -1; }, 'checked': function(node) { return (node.checked === true || node.selected === true); }, enabled: function(node) { return (node.disabled !== undefined && !node.disabled); }, disabled: function(node) { return (node.disabled); } }); Y.mix(Y.Selector.operators, { '^=': '^{val}', // Match starts with value '$=': '{val}$', // Match ends with value '*=': '{val}' // Match contains value as substring }); Y.Selector.combinators['~'] = { axis: 'previousSibling' }; }, '@VERSION@', {"requires": ["selector-native", "selector-css2"]}); YUI.add('yui-log', function (Y, NAME) { /** * Provides console log capability and exposes a custom event for * console implementations. This module is a `core` YUI module, * <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>. * * @module yui * @submodule yui-log */ var INSTANCE = Y, LOGEVENT = 'yui:log', UNDEFINED = 'undefined', LEVELS = { debug: 1, info: 2, warn: 4, error: 8 }; /** * If the 'debug' config is true, a 'yui:log' event will be * dispatched, which the Console widget and anything else * can consume. If the 'useBrowserConsole' config is true, it will * write to the browser console if available. YUI-specific log * messages will only be present in the -debug versions of the * JS files. The build system is supposed to remove log statements * from the raw and minified versions of the files. * * @method log * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.log = function(msg, cat, src, silent) { var bail, excl, incl, m, f, minlevel, Y = INSTANCE, c = Y.config, publisher = (Y.fire) ? Y : YUI.Env.globalEvents; // suppress log message if the config is off or the event stack // or the event call stack contains a consumer of the yui:log event if (c.debug) { // apply source filters src = src || ""; if (typeof src !== "undefined") { excl = c.logExclude; incl = c.logInclude; if (incl && !(src in incl)) { bail = 1; } else if (incl && (src in incl)) { bail = !incl[src]; } else if (excl && (src in excl)) { bail = excl[src]; } // Determine the current minlevel as defined in configuration Y.config.logLevel = Y.config.logLevel || 'debug'; minlevel = LEVELS[Y.config.logLevel.toLowerCase()]; if (cat in LEVELS && LEVELS[cat] < minlevel) { // Skip this message if the we don't meet the defined minlevel bail = 1; } } if (!bail) { if (c.useBrowserConsole) { m = (src) ? src + ': ' + msg : msg; if (Y.Lang.isFunction(c.logFn)) { c.logFn.call(Y, msg, cat, src); } else if (typeof console !== UNDEFINED && console.log) { f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log'; console[f](m); } else if (typeof opera !== UNDEFINED) { opera.postError(m); } } if (publisher && !silent) { if (publisher === Y && (!publisher.getEvent(LOGEVENT))) { publisher.publish(LOGEVENT, { broadcast: 2 }); } publisher.fire(LOGEVENT, { msg: msg, cat: cat, src: src }); } } } return Y; }; /** * Write a system message. This message will be preserved in the * minified and raw versions of the YUI files, unlike log statements. * @method message * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.message = function() { return INSTANCE.log.apply(INSTANCE, arguments); }; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('dump', function (Y, NAME) { /** * Returns a simple string representation of the object or array. * Other types of objects will be returned unprocessed. Arrays * are expected to be indexed. Use object notation for * associative arrays. * * If included, the dump method is added to the YUI instance. * * @module dump */ var L = Y.Lang, OBJ = '{...}', FUN = 'f(){...}', COMMA = ', ', ARROW = ' => ', /** * Returns a simple string representation of the object or array. * Other types of objects will be returned unprocessed. Arrays * are expected to be indexed. * * @method dump * @param {Object} o The object to dump. * @param {Number} d How deep to recurse child objects, default 3. * @return {String} the dump result. * @for YUI */ dump = function(o, d) { var i, len, s = [], type = L.type(o); // Cast non-objects to string // Skip dates because the std toString is what we want // Skip HTMLElement-like objects because trying to dump // an element will cause an unhandled exception in FF 2.x if (!L.isObject(o)) { return o + ''; } else if (type == 'date') { return o; } else if (o.nodeType && o.tagName) { return o.tagName + '#' + o.id; } else if (o.document && o.navigator) { return 'window'; } else if (o.location && o.body) { return 'document'; } else if (type == 'function') { return FUN; } // dig into child objects the depth specifed. Default 3 d = (L.isNumber(d)) ? d : 3; // arrays [1, 2, 3] if (type == 'array') { s.push('['); for (i = 0, len = o.length; i < len; i = i + 1) { if (L.isObject(o[i])) { s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ); } else { s.push(o[i]); } s.push(COMMA); } if (s.length > 1) { s.pop(); } s.push(']'); // regexp /foo/ } else if (type == 'regexp') { s.push(o.toString()); // objects {k1 => v1, k2 => v2} } else { s.push('{'); for (i in o) { if (o.hasOwnProperty(i)) { try { s.push(i + ARROW); if (L.isObject(o[i])) { s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ); } else { s.push(o[i]); } s.push(COMMA); } catch (e) { s.push('Error: ' + e.message); } } } if (s.length > 1) { s.pop(); } s.push('}'); } return s.join(''); }; Y.dump = dump; L.dump = dump; }, '@VERSION@', {"requires": ["yui-base"]}); YUI.add('transition-timer', function (Y, NAME) { /** * Provides the base Transition class, for animating numeric properties. * * @module transition * @submodule transition-timer */ var Transition = Y.Transition; Y.mix(Transition.prototype, { _start: function() { if (Transition.useNative) { this._runNative(); } else { this._runTimer(); } }, _runTimer: function() { var anim = this; anim._initAttrs(); Transition._running[Y.stamp(anim)] = anim; anim._startTime = new Date(); Transition._startTimer(); }, _endTimer: function() { var anim = this; delete Transition._running[Y.stamp(anim)]; anim._startTime = null; }, _runFrame: function() { var t = new Date() - this._startTime; this._runAttrs(t); }, _runAttrs: function(time) { var anim = this, node = anim._node, config = anim._config, uid = Y.stamp(node), attrs = Transition._nodeAttrs[uid], customAttr = Transition.behaviors, done = false, allDone = false, data, name, attribute, setter, elapsed, delay, d, t, i; for (name in attrs) { if ((attribute = attrs[name]) && attribute.transition === anim) { d = attribute.duration; delay = attribute.delay; elapsed = (time - delay) / 1000; t = time; data = { type: 'propertyEnd', propertyName: name, config: config, elapsedTime: elapsed }; setter = (i in customAttr && 'set' in customAttr[i]) ? customAttr[i].set : Transition.DEFAULT_SETTER; done = (t >= d); if (t > d) { t = d; } if (!delay || time >= delay) { setter(anim, name, attribute.from, attribute.to, t - delay, d - delay, attribute.easing, attribute.unit); if (done) { delete attrs[name]; anim._count--; if (config[name] && config[name].on && config[name].on.end) { config[name].on.end.call(Y.one(node), data); } //node.fire('transition:propertyEnd', data); if (!allDone && anim._count <= 0) { allDone = true; anim._end(elapsed); anim._endTimer(); } } } } } }, _initAttrs: function() { var anim = this, customAttr = Transition.behaviors, uid = Y.stamp(anim._node), attrs = Transition._nodeAttrs[uid], attribute, duration, delay, easing, val, name, mTo, mFrom, unit, begin, end; for (name in attrs) { if ((attribute = attrs[name]) && attribute.transition === anim) { duration = attribute.duration * 1000; delay = attribute.delay * 1000; easing = attribute.easing; val = attribute.value; // only allow supported properties if (name in anim._node.style || name in Y.DOM.CUSTOM_STYLES) { begin = (name in customAttr && 'get' in customAttr[name]) ? customAttr[name].get(anim, name) : Transition.DEFAULT_GETTER(anim, name); mFrom = Transition.RE_UNITS.exec(begin); mTo = Transition.RE_UNITS.exec(val); begin = mFrom ? mFrom[1] : begin; end = mTo ? mTo[1] : val; unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units if (!unit && Transition.RE_DEFAULT_UNIT.test(name)) { unit = Transition.DEFAULT_UNIT; } if (typeof easing === 'string') { if (easing.indexOf('cubic-bezier') > -1) { easing = easing.substring(13, easing.length - 1).split(','); } else if (Transition.easings[easing]) { easing = Transition.easings[easing]; } } attribute.from = Number(begin); attribute.to = Number(end); attribute.unit = unit; attribute.easing = easing; attribute.duration = duration + delay; attribute.delay = delay; } else { delete attrs[name]; anim._count--; } } } }, destroy: function() { this.detachAll(); this._node = null; } }, true); Y.mix(Y.Transition, { _runtimeAttrs: {}, /* * Regex of properties that should use the default unit. * * @property RE_DEFAULT_UNIT * @static */ RE_DEFAULT_UNIT: /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i, /* * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. * * @property DEFAULT_UNIT * @static */ DEFAULT_UNIT: 'px', /* * Time in milliseconds passed to setInterval for frame processing * * @property intervalTime * @default 20 * @static */ intervalTime: 20, /* * Bucket for custom getters and setters * * @property behaviors * @static */ behaviors: { left: { get: function(anim, attr) { return Y.DOM._getAttrOffset(anim._node, attr); } } }, /* * The default setter to use when setting object properties. * * @property DEFAULT_SETTER * @static */ DEFAULT_SETTER: function(anim, att, from, to, elapsed, duration, fn, unit) { from = Number(from); to = Number(to); var node = anim._node, val = Transition.cubicBezier(fn, elapsed / duration); val = from + val[0] * (to - from); if (node) { if (att in node.style || att in Y.DOM.CUSTOM_STYLES) { unit = unit || ''; Y.DOM.setStyle(node, att, val + unit); } } else { anim._end(); } }, /* * The default getter to use when getting object properties. * * @property DEFAULT_GETTER * @static */ DEFAULT_GETTER: function(anim, att) { var node = anim._node, val = ''; if (att in node.style || att in Y.DOM.CUSTOM_STYLES) { val = Y.DOM.getComputedStyle(node, att); } return val; }, _startTimer: function() { if (!Transition._timer) { Transition._timer = setInterval(Transition._runFrame, Transition.intervalTime); } }, _stopTimer: function() { clearInterval(Transition._timer); Transition._timer = null; }, /* * Called per Interval to handle each animation frame. * @method _runFrame * @private * @static */ _runFrame: function() { var done = true, anim; for (anim in Transition._running) { if (Transition._running[anim]._runFrame) { done = false; Transition._running[anim]._runFrame(); } } if (done) { Transition._stopTimer(); } }, cubicBezier: function(p, t) { var x0 = 0, y0 = 0, x1 = p[0], y1 = p[1], x2 = p[2], y2 = p[3], x3 = 1, y3 = 0, A = x3 - 3 * x2 + 3 * x1 - x0, B = 3 * x2 - 6 * x1 + 3 * x0, C = 3 * x1 - 3 * x0, D = x0, E = y3 - 3 * y2 + 3 * y1 - y0, F = 3 * y2 - 6 * y1 + 3 * y0, G = 3 * y1 - 3 * y0, H = y0, x = (((A*t) + B)*t + C)*t + D, y = (((E*t) + F)*t + G)*t + H; return [x, y]; }, 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); Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left; Y.Transition = Transition; }, '@VERSION@', {"requires": ["transition"]}); YUI.add('yui', function (Y, NAME) { // empty }, '@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('*');
app/components/friend-chooser.js
robcalcroft/recommender
import React from 'react'; // Components import CardList from './card-list'; import ImportantEventCardList from './important-event-card-list'; export default class FriendChooser extends React.Component { render() { return ( <div id='inner-hook-container'> <h1 className='blue-grey-text text-darken-3'>Gift Ideas</h1> <a href='/data.json' className='blue-grey-text text-lighten-1' style={{fontSize: '15pt'}}>Click to view data source</a> <ImportantEventCardList /> <CardList /> </div> ); } }
herring/puzzles/static-src/components/nav-header.js
aldeka/herring
'use strict'; var React = require('react'), Utils = require('../utils'); var NavHeaderComponent = React.createClass({ render: function() { var rs, roundTags = this.props.rounds.map(function(round) { var target = '#' + Utils.targetifyRound(round); var key = 'shortcut-' + round.id.toString(); return ( <a key={key} href={target}>R{round.number}</a> ); }); rs = Utils.interleave(' | ', roundTags); return (<div className="row"> <div className="col-lg-12"> <div className="shortcuts"> Hop to: {rs} </div> </div> </div> ); } }); module.exports = NavHeaderComponent;
src/entypo/Hand.js
cox-auto-kc/react-entypo
import React from 'react'; import EntypoIcon from '../EntypoIcon'; const iconClass = 'entypo-svgicon entypo--Hand'; let EntypoHand = (props) => ( <EntypoIcon propClass={iconClass} {...props}> <path d="M17.924,17.315c-0.057,0.174-0.193,0.367-0.416,0.432c-0.161,0.047-5.488,1.59-5.652,1.633c-0.469,0.125-0.795,0.033-1.009-0.156c-0.326-0.287-4.093-2.85-8.845-3.092c-0.508-0.025-0.259-1.951,1.193-1.951c0.995,0,3.904,0.723,4.255,0.371c0.271-0.272,0.394-1.879-0.737-4.683l0,0L4.438,4.232C4.222,3.697,4.482,3.089,5.016,2.873c0.535-0.216,1.145,0.043,1.359,0.578c0,0,1.791,4.438,1.986,4.919c0.193,0.48,0.431,0.662,0.69,0.562C9.282,8.844,9.33,8.69,9.19,8.223L7.144,2.195C6.958,1.649,7.25,1.057,7.796,0.871c0.547-0.187,1.141,0.106,1.325,0.652l1.946,5.732c0.172,0.504,0.354,0.768,0.642,0.646c0.173-0.073,0.161-0.338,0.115-0.569l-1.366-5.471c-0.14-0.561,0.201-1.127,0.761-1.267c0.56-0.139,1.125,0.2,1.266,0.761l1.26,5.042c0.184,0.741,0.353,1.008,0.646,0.935c0.299-0.073,0.285-0.319,0.244-0.522c-0.095-0.475-0.872-4.328-0.872-4.328c-0.103-0.515,0.23-1.015,0.744-1.118c0.513-0.103,1.014,0.23,1.116,0.743l0.948,4.711l0.001,0.001c0,0,0,0,0,0.001l0.568,2.825c0.124,0.533,0.266,1.035,0.45,1.527C18.675,14.061,18.109,16.736,17.924,17.315z"/> </EntypoIcon> ); export default EntypoHand;
pages/guides/testing.js
cherniavskii/material-ui
import React from 'react'; import withRoot from 'docs/src/modules/components/withRoot'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import markdown from 'docs/src/pages/guides/testing/testing.md'; function Page() { return <MarkdownDocs markdown={markdown} />; } export default withRoot(Page);
client/admin/import/ImportHistoryPage.stories.js
Sing-Li/Rocket.Chat
import React from 'react'; import ImportHistoryPage from './ImportHistoryPage'; export default { title: 'admin/import/ImportHistoryPage', component: ImportHistoryPage, }; export const _default = () => <ImportHistoryPage />;
client/src/index.js
developercirclesaccra/aggregatr
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; ReactDOM.render(<App />, document.getElementById('root')); registerServiceWorker();
app/pages/addOrderPage.js
shiyunjie/scs
/** * Created by shiyunjie on 16/12/30. */ /** * Created by shiyunjie on 16/12/6. */ import React, { Component } from 'react'; import { StyleSheet, Text, TextInput, View, ScrollView, TouchableOpacity, ActivityIndicator, ActivityIndicatorIOS, ProgressBarAndroid, Platform, BackAndroid, Dimensions, NativeAppEventEmitter, DeviceEventEmitter, KeyboardAvoidingView, Image, Alert, } from 'react-native'; /** * md-checkmark-circle * ios-radio-button-off 'ios-arrow-forward' */ import ItemView from '../components/orderItemView'; import constants from '../constants/constant'; import Button from 'react-native-smart-button'; import Picker from 'react-native-picker'; import LoginPage from './loginPage' import ValidatePage from './validateInputPage'; import AddOrderfinishPage from './addOrderFinishPage' import Icon from 'react-native-vector-icons/Ionicons'; import navigatorStyle from '../styles/navigatorStyle' //navigationBar样式 import AppEventListenerEnhance from 'react-native-smart-app-event-listener-enhance' import {getDeviceID,getToken,getPhone,getRealName} from '../lib/User' import XhrEnhance from '../lib/XhrEnhance' //http import Toast from 'react-native-smart-toast' import ProgressView from '../components/modalProgress' import LoadingSpinnerOverlay from 'react-native-smart-loading-spinner-overlay' import items from '../constants/serviceItem' import pay from '../constants/pay' import typeData from '../constants/mode' import countryData from '../constants/country' import UploadPage from '../pages/uploadPage' import ImageZoomModal from '../components/ImageZoomModal' import ShowPhotoView from '../components/showPhotoView' const { width: deviceWidth } = Dimensions.get('window'); let selectedItems = ['信用证',]; /* service_no: '',// 委托单号 order_status_name: '',// 订单状态 create_time_str: '',// 发布时间 remark: '',// 备注 trade_terms: '',// 贸易条款 departure_name: '',// 起运国 destination_name: '',// 目的国 import_clearance: '',// 进口清关,0否,1是 international_logistics: '',// 国际物流,0否,1是 export_country_land: '',// 出口国陆运,0否,1是 booking_service_name: '',// 订舱服务,0海运,1空运 domestic_logistics: '',// 国内物流,0否,1是 credit_letter: '',// 信用证,0否,1是 client_name: '',// 委托人名称 client_phone: '',// 委托人电话 order_status: '',// 订单状态 值 commission_content: '',//委托内容*/ class AddOrder extends Component { // 构造 constructor(props) { super(props); this.state = { keyboardSpace: 0,//键盘弹出时滑动的距离 showProgress: true,//显示加载 showReload: false,//显示加载更多 phone: '', realName: '', commission_content: this.props.commission_content ? this.props.commission_content : '', id: this.props.id ? this.props.id : '', items: items, pay: this.props.credit_letter ? this.props.credit_letter : 0, cash: this.props.cash ? this.props.cash : 0,// 现金 ,0否,1是 trans: this.props.trans ? this.props.trans : 0,// 转账 ,0否,1是 aliPay:this.props.id ? this.props.aliPay : 1,//支付宝 ,0否,1是 //selectedItems: selectedItems, type: this.props.trade_terms ? this.props.trade_terms : typeData[0].value, start: this.props.departure_name ? this.props.departure_name : countryData[0].name, reach: this.props.destination_name ? this.props.destination_name : countryData[0].name, clearance: this.props.import_clearance ? this.props.import_clearance : 1,//进口清关 logistics: this.props.id? this.props.international_logistics : 1,//需求国际物流 land: this.props.id? this.props.export_country_land : 1,//出口国陆运 sea_air: this.props.booking_service_name ? this.props.booking_service_name : 0,//海运 internal: this.props.id? this.props.domestic_logistics : 1,//国内物流 receiving_address: this.props.receiving_address ? this.props.receiving_address : '',//收获地址 photoList: this.props.photoList ? this.props.photoList : [], } //this._realName = /^[A-Za-z]{2,20}$|^[\u4E00-\u9FA5]{2,8}$/ this._realName = /^.{1,50}$/; this._phoneReg = /^1[34578]\d{9}$/;//手机号码 this._receivingReg = /^.{1,50}$/; //收获地址 this._scrollY = 0 this._showKeyboard = true; this.typeShow = [] this.countryShow = [] this.countryEnd = [] this._isUploading = false this._commission_content = /^.{1,300}$/; } componentWillMount() { NativeAppEventEmitter.emit('setNavigationBar.index', navigationBarRouteMapper) let currentRoute = this.props.navigator.navigationContext.currentRoute this.addAppEventListener( this.props.navigator.navigationContext.addListener('willfocus', (event) => { //console.log(`orderPage willfocus...`) //console.log(`currentRoute`, currentRoute) //console.log(`event.data.route`, event.data.route) if (event && currentRoute === event.data.route) { //console.log("orderPage willAppear") NativeAppEventEmitter.emit('setNavigationBar.index', navigationBarRouteMapper) //console.log('this.showList:', this.state.photoList) } else { //console.log("orderPage willDisappear, other willAppear") } // }) ) this.addAppEventListener( NativeAppEventEmitter.addListener('validatepage_send_value', (context, label) => { if (label == '委托人') { this.setState({realName: context}) } else if (label == '联系电话') { this.setState({phone: context}) } else if (label == '收货地址') { this.setState({receiving_address: context}) } }) ) this.addAppEventListener( BackAndroid.addEventListener('hardwareBackPress', this.onBackAndroid) ) } onKeyboardWillShow(frames) { const keyboardSpace = frames.endCoordinates.height//获取键盘高度 //console.log('Keyboard is shown', keyboardSpace); if (this._showKeyboard) { this.setState({ keyboardSpace: keyboardSpace, }) this._scrollView.scrollTo({y: this._scrollY + this.state.keyboardSpace, animated: true}) this._showKeyboard = false; } } onKeyboardWillHide() { //console.log('Keyboard is hide'); this._scrollView.scrollTo({y: this._scrollY, animated: true}); this.setState({ keyboardSpace: 0, }) this._showKeyboard = true; } async _getPhoneAndName() { let phone = await getPhone(); let realName = await getRealName(); phone = this.props.client_phone ? this.props.client_phone : phone realName = this.props.client_name ? this.props.client_name : realName setTimeout(()=>this.setState({ phone: phone, realName: realName, showProgress: false,//显示加载 }), 510); } componentDidMount() { //console.log('items:' + this.state.items.length) if (this.typeShow.length == 0) { for (type of typeData) { this.typeShow.push(type.value) } } if (this.countryShow.length == 0) { for (data of countryData) { this.countryShow.push(data.name) } } if (this.countryEnd.length == 0) { for (data of countryData) { this.countryEnd.push(data.name) } } this._getPhoneAndName() } componentWillUnmount() { if (Picker.isPickerShow) { Picker.hide() } } _onScroll(e) { this._scrollY = e.nativeEvent.contentOffset.y //console.log(`this._scrollY = ${this._scrollY}`) } /*{this.state.items.map((item, index) => { let icon = 'md-checkmark-circle' let color = constants.UIActiveColor /!* if (this.state.selectedItems.indexOf(item.name) == -1) { icon = 'ios-radio-button-off-outline' color = constants.UIInActiveColor } *!/ if (item.select==0) { icon = 'ios-radio-button-off-outline' color = constants.UIInActiveColor } console.log(item.name + ",icon:" + icon); return ( <TouchableOpacity key={`item-${index}`} style={{height:50,}} onPress={()=>{ if (this.state.selectedItems.indexOf(item.name) == -1) { selectedItems.push(item.name) }else{ let deletIndex=this.state.selectedItems.indexOf(item.name) selectedItems.splice(deletIndex,1); } this.setState({selectedItems:selectedItems}); }}> <ItemView name={icon} color={color} title={item.name} rightText=''/> </TouchableOpacity> ) })}*/ //_showBigUrl(url) { // this.setState({showUrl: url, modalVisible: true}) // //} render() { console.log(`this.state:`,this.state) //let width = (deviceWidth - constants.MarginLeftRight * 2 - 20) / 4 return ( <View style={{flex:1}}> {this.state.showProgress || this.state.showReload ? <ProgressView showProgress={this.state.showProgress} showReload={this.state.showReload} fetchData={()=>{}}/> : <ScrollView ref={ (component) => this._scrollView = component} style={styles.container} showsVerticalScrollIndicator={false} onKeyboardWillShow={this.onKeyboardWillShow.bind(this)} onKeyboardWillHide={this.onKeyboardWillHide.bind(this)} onScroll={this._onScroll.bind(this)} scrollEventThrottle={100}> <TouchableOpacity style={[{marginTop:10,height:50,}]} onPress={()=>{ //查找下标 //console.log(`this.state.type:`,this.state.type); let index=0; for(let i=0;i<this.typeShow.length;i++){ if(this.typeShow[i]==this.state.type){ index=i; //console.log(`index:`,index); break; } } Picker.init({ pickerData: this.typeShow , pickerConfirmBtnText:'确定', pickerCancelBtnText:'取消', pickerTitleText:'选择贸易条款', selectedValue: [this.typeShow[index]], onPickerConfirm: data => { this.setState({type:data+''}) }, onPickerCancel: data => { }, onPickerSelect: data => { this.setState({type:data+''}) } }); Picker.show(); }}> <ItemView name='ios-arrow-forward' title='贸易条款' rightText={this.state.type}/> </TouchableOpacity> <TouchableOpacity style={[{height:50,}]} onPress={ ()=>{ this.props.navigator.push({ title: '委托人', component: ValidatePage, passProps:{ context:this.state.realName, label:'委托人', reg:this._realName } }); } }> <ItemView ref={ component => this._input_realName = component } name='ios-arrow-forward' title='委托人' rightText={this.state.realName}/> </TouchableOpacity> <TouchableOpacity style={[{height:50,}]} onPress={ ()=>{ this.props.navigator.push({ title: '联系电话', component: ValidatePage, passProps:{ context:this.state.phone, label:'联系电话', reg:this._phoneReg } }); } }> <ItemView ref={ component => this._input_phone = component } name='ios-arrow-forward' title='联系电话' rightText={this.state.phone}/> </TouchableOpacity> <TouchableOpacity style={[{height:50,}]} onPress={ ()=>{ this.props.navigator.push({ title: '收货地址', component: ValidatePage, passProps:{ context:this.state.receiving_address, label:'收货地址', reg:this._receivingReg } }); } }> <ItemView ref={ component => this._input_receiving_address = component } name='ios-arrow-forward' title='收货地址' rightText={this.state.receiving_address}/> </TouchableOpacity> <TouchableOpacity style={[{height:50,}]} onPress={()=>{ let index=0; for(let i=0;i<this.countryShow.length;i++){ if(this.countryShow[i]==this.state.start){ index=i; //console.log(`index:`,index); break; } } Picker.init({ pickerData: this.countryShow, pickerConfirmBtnText:'确定', pickerCancelBtnText:'取消', pickerTitleText:'出发国家', selectedValue: [this.countryShow[index]], onPickerConfirm: data => { this.setState({start:data+''}) }, onPickerCancel: data => { //console.log(data); }, onPickerSelect: data => { this.setState({start:data+''}) } }); Picker.show(); }}> <ItemView name='ios-arrow-forward' title='出发国家' rightText={this.state.start}/> </TouchableOpacity> <TouchableOpacity style={{height:50,}} onPress={()=>{ let index=0; for(let i=0;i<this.countryEnd.length;i++){ if(this.countryEnd[i]==this.state.reach){ index=i; //console.log(`index:`,index); break; } } Picker.init({ pickerData: this.countryEnd, pickerConfirmBtnText:'确定', pickerCancelBtnText:'取消', pickerTitleText:'目的国家', selectedValue: [this.countryEnd[index]], onPickerConfirm: data => { this.setState({reach:data+''}) }, onPickerCancel: data => { //console.log(data); }, onPickerSelect: data => { this.setState({reach:data+''}) } }); Picker.show(); }}> <ItemView name='ios-arrow-forward' title='目的国家' rightText={this.state.reach} hasLine={false}/> </TouchableOpacity> <Text style={[styles.labelText,{marginLeft:constants.MarginLeftRight,paddingTop:5,paddingBottom:5,}]}>上传资料</Text> <ShowPhotoView style={{flex:1,backgroundColor:'white', paddingLeft:constants.MarginLeftRight,paddingRight:constants.MarginLeftRight,}} navigator={this.props.navigator} photoList={this.state.photoList} UploadPage={UploadPage} isUploading={this._isUploading} /> <Text style={[styles.labelText,{marginLeft:constants.MarginLeftRight,paddingTop:5,paddingBottom:5,}]}>货代服务</Text> <TouchableOpacity style={{height:50,}} onPress={()=>{ /* let select if (this.state.clearance==1) { select=0 }else{ select=1 } this.setState({clearance:select});*/ }}> <ItemView color={this.state.clearance==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.clearance==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='进口清关' rightText='' /> </TouchableOpacity> <TouchableOpacity style={{height:50,}} onPress={()=>{ let select if (this.state.logistics==1) { //取消国际物流 select=0 this.setState({logistics:select,land:0,sea_air:0}); }else{ //需求国际物流选中了 select=1 this.setState({logistics:select,land:1,sea_air:0}); } }}> <ItemView color={this.state.logistics==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.logistics==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='国际物流' rightText='' /> </TouchableOpacity> {this.state.logistics==1? <TouchableOpacity style={{height:50,}} onPress={()=>{ let select if (this.state.land==1) { //取消 select=0 }else{ //出口国陆运选中 select=1 } this.setState({land:select}); }}> <ItemView color={this.state.land==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.land==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='出口国陆运' rightText='' /> </TouchableOpacity>:null } {this.state.logistics==1? <View style={[{height:50,flexDirection:'row',alignItems:'stretch', paddingLeft:constants.MarginLeftRight,backgroundColor:'white',}]}> <View style={{flexDirection:'row',backgroundColor:'white',alignItems:'center', borderColor: constants.UIInActiveColor,borderBottomWidth:StyleSheet.hairlineWidth,}}> <Text style={[styles.labelText,{textAlignVertical:'center',color:constants.PointColor}]}>订舱服务</Text> </View> <TouchableOpacity style={{flex:1,borderColor: constants.UIInActiveColor,borderBottomWidth:StyleSheet.hairlineWidth,}} onPress={()=>{ let select let airSelect if (this.state.sea_air==0) { select=0 }else{ select=0 } this.setState({sea_air:select,}); }}> <ItemView color={this.state.sea_air==0?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.sea_air==0?'md-checkmark-circle':'ios-radio-button-off-outline'} hasLine={false} showRightText={false} title='海运' rightText='' /> </TouchableOpacity> <TouchableOpacity style={{flex:1,borderColor: constants.UIInActiveColor,borderBottomWidth:StyleSheet.hairlineWidth,}} onPress={()=>{ /* let select if (this.state.sea_air==1) { //取消 select=1 }else{ //出口国陆运选中 select=1 } this.setState({sea_air:select});*/ }}> <ItemView color={this.state.sea_air==1?constants.UIActiveColor:constants.UIBackgroundColor} name={this.state.sea_air==1?'md-checkmark-circle':'ios-radio-button-off-outline'} hasLine={false} showRightText={false} title='空运' titleColor={constants.UIBackgroundColor} rightText='' /> </TouchableOpacity> </View>:null } <TouchableOpacity style={{height:50,}} onPress={()=>{ let select if (this.state.internal==1) { select=0 }else{ select=1 } this.setState({internal:select}); }}> <ItemView color={this.state.internal==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.internal==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='国内物流' rightText='' hasLine={false} /> </TouchableOpacity> <Text style={[styles.labelText,{marginLeft:constants.MarginLeftRight,paddingTop:5,paddingBottom:5,}]}>支付方式</Text> <TouchableOpacity style={{height:50,}} onPress={()=>{ this.setState({ cash:1, trans:0, aliPay:0 }); }}> <ItemView color={this.state.cash==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.cash==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='现金' rightText='' hasLine={true} /> </TouchableOpacity> <TouchableOpacity style={{height:50,}} onPress={()=>{ this.setState({ cash:0, trans:1, aliPay:0 }); }}> <ItemView color={this.state.trans==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.trans==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='转账' rightText='' hasLine={true} /> </TouchableOpacity> <TouchableOpacity style={{height:50,}} onPress={()=>{ this.setState({ cash:0, trans:0, aliPay:1 }); }}> <ItemView color={this.state.aliPay==1?constants.UIActiveColor:constants.UIInActiveColor} name={this.state.aliPay==1?'md-checkmark-circle':'ios-radio-button-off-outline'} title='支付宝' rightText='' hasLine={false} /> </TouchableOpacity> <Text style={[styles.labelText,{marginLeft:constants.MarginLeftRight,paddingTop:5,paddingBottom:5,}]}>委托内容</Text> <View style={{height:150,}}> <TextInput style={[styles.labelText,{flex:1, fontSize:14, backgroundColor:'white', textAlignVertical:'top', padding:constants.MarginLeftRight, borderColor: constants.UIInActiveColor, justifyContent:'flex-start', }]} clearButtonMode="while-editing" //placeholder='委托内容' maxLength={300} underlineColorAndroid='transparent' multiline={true}//多行输入 numberOfLines={6} editable={true} value={this.state.commission_content} onChangeText={(text) => this.setState({commission_content:text})}/> <Text style={{color:constants.UIInActiveColor,position:'absolute',bottom:5,right:5,backgroundColor:'transparent'}}>300字以内</Text> </View> <View style={[{flex:1,paddingTop:10,paddingBottom:10,paddingLeft:constants.MarginLeftRight,paddingRight:constants.MarginLeftRight}, this.state.keyboardSpace?{paddingBottom:this.state.keyboardSpace}:{}]}> <Button ref={ component => this.button2 = component } touchableType={Button.constants.touchableTypes.fadeContent} style={styles.button} textStyle={{fontSize: 17, color: 'white'}} loadingComponent={ <View style={{flexDirection: 'row', alignItems: 'center'}}> { //this._renderActivityIndicator() } <Text style={{fontSize: 17, color: 'white', fontWeight: 'bold', fontFamily: '.HelveticaNeueInterface-MediumP4',}}>委托中...</Text> </View> } onPress={ () => { if(!this._phoneReg.test(this.state.phone)){ this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '联系电话格式不正确' }) return } if(!this._realName.test(this.state.realName)){ this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '委托人格式不正确' }) return } if(!this._receivingReg.test(this.state.receiving_address)){ this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '收货地址不能为空' }) return } /*if(!this._commission_content.test(this.state.commission_content.replace(/^\s*!/g,""))){ this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '委托内容不能为空' }) return }*/ if(this.state.photoList&&this.state.photoList.length>0){ }else{ this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '请上传相关照片' }) return } /* this.button2.setState({ loading: true, //disabled: true, });*/ this._modalLoadingSpinnerOverLay.show() if(this.state.id==''){ this._fetchData() }else{ this._fetchData_update() } /* setTimeout( () => { this.button2.setState({ loading: false, //disabled: false }) /!** * 提交订单数据 *!/ this.props.navigator.pop(); }, 3000)*/ }}> {this.state.id==''?'发起委托':'保存'} </Button> </View> </ScrollView> } <ImageZoomModal ref={ component => this._ImageZoomModal = component } /> <Toast ref={ component => this._toast = component } marginTop={64}> </Toast> <LoadingSpinnerOverlay ref={ component => this._modalLoadingSpinnerOverLay = component }/> </View> ); } onBackAndroid = () => { const routers = this.props.navigator.getCurrentRoutes(); if (routers.length > 1) { /* Alert.alert('温馨提醒','确定退出吗?',[ {text:'取消',onPress:()=>{}}, {text:'确定',onPress:()=>this.props.navigator.popToTop()} ])*/ this.props.navigator.pop() return true; } }; async _fetchData() { //console.log(`_fetchData`) try { let departure = countryData[this.countryShow.indexOf(this.state.start)] //console.log(`departure_id_start`, departure) let departure_id = departure.id let destination = countryData[this.countryEnd.indexOf(this.state.reach)] //console.log(`destination_id_reach`, destination) let destination_id = destination.id let file_ids = '' for (let data of this.state.photoList) { file_ids += data.id + ',' } let token = await getToken() let deviceID = await getDeviceID() let options = { method: 'post', url: constants.api.service, data: { iType: constants.iType.commissionOrderStart, commissionOrder: { import_clearance: this.state.clearance, international_logistics: this.state.logistics, export_country_land: this.state.land, booking_service: this.state.sea_air, domestic_logistics: this.state.internal, credit_letter: this.state.pay, trade_terms: this.state.type, departure_id: departure_id, departure_name: this.state.start, destination_id: destination_id, destination_name: this.state.reach, client_name: this.state.realName, client_phone: this.state.phone, commission_content: this.state.commission_content, receiving_address: this.state.receiving_address, cash: this.state.cash, trans: this.state.trans, aliPay: this.state.aliPay, }, file_ids: file_ids, deviceId: deviceID, token: token, } } options.data = await this.gZip(options) //console.log(`_fetch_sendCode options:`, options) let resultData = await this.fetch(options) let result = await this.gunZip(resultData) if (!result) { this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '服务器打盹了,稍后再试试吧' }) return } result = JSON.parse(result) //console.log('gunZip:', result) if (!result) { this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '服务器打盹了,稍后再试试吧' }) return } if (result.code && result.code == -54) { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } /** * 发送事件去登录 */ AsyncStorage.removeItem('token') AsyncStorage.removeItem('realName') this.props.navigator.push({ title: '用户登录', component: LoginPage, }) return; } if (result.code && result.code == 10) { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '发送成功' }) this.props.navigator.push({ title: '发起委托', component: AddOrderfinishPage, }) this.setState({ photoList: [], commission_content:'', pay: 0, cash:0,// 现金 ,0否,1是 trans:0,// 转账 ,0否,1是 aliPay:1,//支付宝 ,0否,1是 //selectedItems: selectedItems, type:typeData[0].value, start:countryData[0].name, reach:countryData[0].name, clearance:1,//进口清关 logistics:1,//需求国际物流 land:1,//出口国陆运 sea_air:0,//海运 internal:1,//国内物流 }) } else { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: result.msg }) } } catch (error) { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } //console.log(error) if (this._toast) { this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: error }) } } finally { /*this.button2.setState({ loading: false, //disabled: false })*/ //if (this._modalLoadingSpinnerOverLay) { // this._modalLoadingSpinnerOverLay.hide({duration: 0,}) //} } } async _fetchData_update() { //console.log(`_fetchData_update`) try { let departure = countryData[this.countryShow.indexOf(this.state.start)] //console.log(`departure_id_start`, departure) let departure_id = departure.id let destination = countryData[this.countryEnd.indexOf(this.state.reach)] //console.log(`destination_id_reach`, destination) let destination_id = destination.id let file_ids = '' for (let data of this.state.photoList) { file_ids += data.id + ',' } let token = await getToken() let deviceID = await getDeviceID() let options = { method: 'post', url: constants.api.service, data: { iType: constants.iType.commissionOrder_commissionOrderEditSave, commissionOrder: { id: this.state.id, import_clearance: this.state.clearance, international_logistics: this.state.logistics, export_country_land: this.state.land, booking_service: this.state.sea_air, domestic_logistics: this.state.internal, credit_letter: this.state.pay, trade_terms: this.state.type, departure_id: departure_id, departure_name: this.state.start, destination_id: destination_id, destination_name: this.state.reach, client_name: this.state.realName, client_phone: this.state.phone, commission_content: this.state.commission_content, receiving_address: this.state.receiving_address, cash: this.state.cash, trans: this.state.trans, aliPay: this.state.aliPay, }, file_ids: file_ids, deviceId: deviceID, token: token, } } options.data = await this.gZip(options) //console.log(`_fetch_sendCode options:`, options) let resultData = await this.fetch(options) let result = await this.gunZip(resultData) if (!result) { this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '服务器打盹了,稍后再试试吧' }) return } result = JSON.parse(result) //console.log('gunZip:', result) if (!result) { this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: '服务器打盹了,稍后再试试吧' }) return } if (result.code && result.code == -54) { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } /** * 发送事件去登录 */ AsyncStorage.removeItem('token') AsyncStorage.removeItem('realName') this.props.navigator.push({ title: '用户登录', component: LoginPage, }) return; } if (result.code && result.code == 10) { //修改订单状态 NativeAppEventEmitter.emit('orderDetail_hasUpdate_should_resetState', this.state.id) Alert.alert('温馨提醒', '修改成功?', [{ text: '确定', onPress: ()=> { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } this.props.navigator.pop() } } ]) /* this.props.navigator.push({ title: '修改委托', component: AddOrderfinishPage, })*/ } else { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: result.msg }) } } catch (error) { if (this._modalLoadingSpinnerOverLay) { this._modalLoadingSpinnerOverLay.hide({duration: 0,}) } //console.log(error) if (this._toast) { this._toast.show({ position: Toast.constants.gravity.center, duration: 255, children: error }) } } finally { /*this.button2.setState({ loading: false, //disabled: false })*/ //if (this._modalLoadingSpinnerOverLay) { // this._modalLoadingSpinnerOverLay.hide({duration: 0,}) //} } } _renderActivityIndicator() { return ActivityIndicator ? ( <ActivityIndicator style={{margin: 10,}} animating={true} color={'#fff'} size={'small'}/> ) : Platform.OS == 'android' ? ( <ProgressBarAndroid style={{margin: 10,}} color={'#fff'} styleAttr={'small'}/> ) : ( <ActivityIndicatorIOS style={{margin: 10,}} animating={true} color={'#fff'} size={'small'}/> ) } } const styles = StyleSheet.create({ container: { flex: 1, marginTop: Platform.OS == 'ios' ? 64 : 56, backgroundColor: constants.UIBackgroundColor, flexDirection: 'column', }, labelText: { fontSize: 14, color: constants.LabelColor, }, button: { height: 40, backgroundColor: constants.UIActiveColor, borderWidth: StyleSheet.hairlineWidth, borderColor: constants.UIActiveColor, justifyContent: 'center', borderRadius: 30, }, textInput: { flex: 1, alignSelf: 'stretch', marginRight: 10, }, textLine: { flex: 1, justifyContent: 'center', backgroundColor: 'white', marginLeft: constants.MarginLeftRight, borderBottomWidth: StyleSheet.hairlineWidth, borderColor: constants.UIInActiveColor, }, inputView: { height: 50, flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'stretch', backgroundColor: 'white', }, }); export default AppEventListenerEnhance(XhrEnhance(AddOrder)) import {navigationBar} from '../components/NavigationBarRouteMapper' const navigationBarRouteMapper = { ...navigationBar, LeftButton: function (route, navigator, index, navState) { if (index === 0) { return null; } var previousRoute = navState.routeStack[index - 1]; return ( <TouchableOpacity onPress={() => navigator.pop()} style={navigatorStyle.navBarLeftButton}> <View style={navigatorStyle.navBarLeftButtonAndroid}> <Icon style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText,{fontSize: 30,}]} name={'ios-arrow-back'} size={constants.IconSize} color={'white'}/> </View> </TouchableOpacity> ); }, } /* const navigationBarRouteMapper = { LeftButton: function (route, navigator, index, navState) { if (index === 0) { return null; } var previousRoute = navState.routeStack[index - 1]; return ( <TouchableOpacity onPress={() => navigator.popToTop()} style={navigatorStyle.navBarLeftButton}> <View style={navigatorStyle.navBarLeftButtonAndroid}> <Icon style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText,{fontSize: 20,}]} name={'ios-arrow-back'} size={constants.IconSize} color={'white'}/> </View> </TouchableOpacity> ); }, RightButton: function (route, navigator, index, navState) { }, Title: function (route, navigator, index, navState) { return ( Platform.OS == 'ios' ? <Text style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText]}> {route.title} </Text> : <View style={navigatorStyle.navBarTitleAndroid}> <Text style={[navigatorStyle.navBarText, navigatorStyle.navBarTitleText]}> {route.title} </Text> </View> ) }, }*/
app/javascript/mastodon/features/compose/components/reply_indicator.js
anon5r/mastonon
import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import Avatar from '../../../components/avatar'; import IconButton from '../../../components/icon_button'; import DisplayName from '../../../components/display_name'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { isRtl } from '../../../rtl'; const messages = defineMessages({ cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, }); @injectIntl export default class ReplyIndicator extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object, }; static propTypes = { status: ImmutablePropTypes.map, onCancel: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; handleClick = () => { this.props.onCancel(); } handleAccountClick = (e) => { if (e.button === 0) { e.preventDefault(); this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); } } render () { const { status, intl } = this.props; if (!status) { return null; } const content = { __html: status.get('contentHtml') }; const style = { direction: isRtl(status.get('search_index')) ? 'rtl' : 'ltr', }; return ( <div className='reply-indicator'> <div className='reply-indicator__header'> <div className='reply-indicator__cancel'><IconButton title={intl.formatMessage(messages.cancel)} icon='times' onClick={this.handleClick} inverted /></div> <a href={status.getIn(['account', 'url'])} onClick={this.handleAccountClick} className='reply-indicator__display-name'> <div className='reply-indicator__display-avatar'><Avatar account={status.get('account')} size={24} /></div> <DisplayName account={status.get('account')} /> </a> </div> <div className='reply-indicator__content' style={style} dangerouslySetInnerHTML={content} /> </div> ); } }
modules/components/Route.js
epeli/react-router
var React = require('react'); var warning = require('react/lib/warning'); var invariant = require('react/lib/invariant'); var ExecutionEnvironment = require('react/lib/ExecutionEnvironment'); var mergeProperties = require('../helpers/mergeProperties'); var goBack = require('../helpers/goBack'); var replaceWith = require('../helpers/replaceWith'); var transitionTo = require('../helpers/transitionTo'); var withoutProperties = require('../helpers/withoutProperties'); var Path = require('../helpers/Path'); var ActiveStore = require('../stores/ActiveStore'); var RouteStore = require('../stores/RouteStore'); var URLStore = require('../stores/URLStore'); var Promise = require('es6-promise').Promise; /** * A map of <Route> component props that are reserved for use by the * router and/or React. All other props are considered "static" and * are passed through to the route handler. */ var RESERVED_PROPS = { location: true, handler: true, name: true, path: true, children: true // ReactChildren }; /** * The ref name that can be used to reference the active route component. */ var REF_NAME = '__activeRoute__'; /** * <Route> components specify components that are rendered to the page when the * URL matches a given pattern. * * Routes are arranged in a nested tree structure. When a new URL is requested, * the tree is searched depth-first to find a route whose path matches the URL. * When one is found, all routes in the tree that lead to it are considered * "active" and their components are rendered into the DOM, nested in the same * order as they are in the tree. * * Unlike Ember, a nested route's path does not build upon that of its parents. * This may seem like it creates more work up front in specifying URLs, but it * has the nice benefit of decoupling nested UI from "nested" URLs. * * The preferred way to configure a router is using JSX. The XML-like syntax is * a great way to visualize how routes are laid out in an application. * * React.renderComponent(( * <Route handler={App}> * <Route name="login" handler={Login}/> * <Route name="logout" handler={Logout}/> * <Route name="about" handler={About}/> * </Route> * ), document.body); * * If you don't use JSX, you can also assemble a Router programmatically using * the standard React component JavaScript API. * * React.renderComponent(( * Route({ handler: App }, * Route({ name: 'login', handler: Login }), * Route({ name: 'logout', handler: Logout }), * Route({ name: 'about', handler: About }) * ) * ), document.body); * * Handlers for Route components that contain children can render their active * child route using the activeRouteHandler prop. * * var App = React.createClass({ * render: function () { * return ( * <div class="application"> * {this.props.activeRouteHandler()} * </div> * ); * } * }); */ var Route = React.createClass({ displayName: 'Route', statics: { getUnreservedProps: function (props) { return withoutProperties(props, RESERVED_PROPS); }, /** * Handles errors that were thrown asynchronously. By default, the * error is re-thrown so we don't swallow them silently. */ handleAsyncError: function (error, route) { throw error; // This error probably originated in a transition hook. }, /** * Handles cancelled transitions. By default, redirects replace the * current URL and aborts roll it back. */ handleCancelledTransition: function (transition, route) { var reason = transition.cancelReason; if (reason instanceof Redirect) { replaceWith(reason.to, reason.params, reason.query); } else if (reason instanceof Abort) { goBack(); } } }, propTypes: { location: React.PropTypes.oneOf([ 'hash', 'history' ]).isRequired, handler: React.PropTypes.any.isRequired, path: React.PropTypes.string, name: React.PropTypes.string, }, getDefaultProps: function () { return { location: 'hash' }; }, getInitialState: function () { return {}; }, componentWillMount: function () { RouteStore.registerRoute(this); if (!URLStore.isSetup() && ExecutionEnvironment.canUseDOM) URLStore.setup(this.props.location); URLStore.addChangeListener(this.handleRouteChange); }, componentDidMount: function () { this.dispatch(URLStore.getCurrentPath()); }, componentWillUnmount: function () { URLStore.removeChangeListener(this.handleRouteChange); }, handleRouteChange: function () { this.dispatch(URLStore.getCurrentPath()); }, /** * Performs a depth-first search for the first route in the tree that matches * on the given path. Returns an array of all routes in the tree leading to * the one that matched in the format { route, params } where params is an * object that contains the URL parameters relevant to that route. Returns * null if no route in the tree matches the path. * * ( <Route handler={App}> * <Route name="posts" handler={Posts}> * <Route name="newPost" path="/posts/new" handler={NewPost}/> * <Route name="showPost" path="/posts/:id" handler={Post}/> * </Route> * </Route> * ).match('/posts/123'); => [ { route: <AppRoute>, params: {} }, * { route: <PostsRoute>, params: {} }, * { route: <PostRoute>, params: { id: '123' } } ] */ match: function (path) { return findMatches(Path.withoutQuery(path), this); }, /** * Performs a transition to the given path and returns a promise for the * Transition object that was used. * * In order to do this, the router first determines which routes are involved * in the transition beginning with the current route, up the route tree to * the first parent route that is shared with the destination route, and back * down the tree to the destination route. The willTransitionFrom static * method is invoked on all route handlers we're transitioning away from, in * reverse nesting order. Likewise, the willTransitionTo static method * is invoked on all route handlers we're transitioning to. * * Both willTransitionFrom and willTransitionTo hooks may either abort or * redirect the transition. If they need to resolve asynchronously, they may * return a promise. * * Any error that occurs asynchronously during the transition is re-thrown in * the top-level scope unless returnRejectedPromise is true, in which case a * rejected promise is returned so the caller may handle the error. * * Note: This function does not update the URL in a browser's location bar. * If you want to keep the URL in sync with transitions, use Router.transitionTo, * Router.replaceWith, or Router.goBack instead. */ dispatch: function (path, returnRejectedPromise) { var transition = new Transition(path); var route = this; var promise = syncWithTransition(route, transition).then(function (newState) { if (transition.isCancelled) { Route.handleCancelledTransition(transition, route); } else if (newState) { ActiveStore.updateState(newState); } return transition; }); if (!returnRejectedPromise) { promise = promise.then(undefined, function (error) { // Use setTimeout to break the promise chain. setTimeout(function () { Route.handleAsyncError(error, route); }); }); } return promise; }, render: function () { if (!this.state.path) return null; return this.props.handler(computeHandlerProps(this.state.matches || [], this.state.activeQuery)); } }); function Transition(path) { this.path = path; this.cancelReason = null; this.isCancelled = false; } mergeProperties(Transition.prototype, { abort: function () { this.cancelReason = new Abort(); this.isCancelled = true; }, redirect: function (to, params, query) { this.cancelReason = new Redirect(to, params, query); this.isCancelled = true; }, retry: function () { transitionTo(this.path); } }); function Abort() {} function Redirect(to, params, query) { this.to = to; this.params = params; this.query = query; } function findMatches(path, route) { var children = route.props.children, matches; // Check the subtree first to find the most deeply-nested match. if (Array.isArray(children)) { for (var i = 0, len = children.length; matches == null && i < len; ++i) { matches = findMatches(path, children[i]); } } else if (children) { matches = findMatches(path, children); } if (matches) { var rootParams = getRootMatch(matches).params; var params = {}; Path.extractParamNames(route.props.path).forEach(function (paramName) { params[paramName] = rootParams[paramName]; }); matches.unshift(makeMatch(route, params)); return matches; } // No routes in the subtree matched, so check this route. var params = Path.extractParams(route.props.path, path); if (params) return [ makeMatch(route, params) ]; return null; } function makeMatch(route, params) { return { route: route, params: params }; } function hasMatch(matches, match) { return matches.some(function (m) { if (m.route !== match.route) return false; for (var property in m.params) { if (m.params[property] !== match.params[property]) return false; } return true; }); } function getRootMatch(matches) { return matches[matches.length - 1]; } function updateMatchComponents(matches, refs) { var i = 0, component; while (component = refs[REF_NAME]) { matches[i++].component = component; refs = component.refs; } } /** * Runs all transition hooks that are required to get from the current state * to the state specified by the given transition and updates the current state * if they all pass successfully. Returns a promise that resolves to the new * state if it needs to be updated, or undefined if not. */ function syncWithTransition(route, transition) { if (route.state.path === transition.path) return Promise.resolve(); // Nothing to do! var currentMatches = route.state.matches; var nextMatches = route.match(transition.path); warning( nextMatches, 'No route matches path "' + transition.path + '". Make sure you have ' + '<Route path="' + transition.path + '"> somewhere in your routes' ); if (!nextMatches) nextMatches = []; var fromMatches, toMatches; if (currentMatches) { updateMatchComponents(currentMatches, route.refs); fromMatches = currentMatches.filter(function (match) { return !hasMatch(nextMatches, match); }); toMatches = nextMatches.filter(function (match) { return !hasMatch(currentMatches, match); }); } else { fromMatches = []; toMatches = nextMatches; } return checkTransitionFromHooks(fromMatches, transition).then(function () { if (transition.isCancelled) return; // No need to continue. return checkTransitionToHooks(toMatches, transition).then(function () { if (transition.isCancelled) return; // No need to continue. var rootMatch = getRootMatch(nextMatches); var params = (rootMatch && rootMatch.params) || {}; var query = Path.extractQuery(transition.path) || {}; var state = { path: transition.path, matches: nextMatches, activeParams: params, activeQuery: query, activeRoutes: nextMatches.map(function (match) { return match.route; }) }; route.setState(state); return state; }); }); } /** * Calls the willTransitionFrom hook of all handlers in the given matches * serially in reverse with the transition object and the current instance of * the route's handler, so that the deepest nested handlers are called first. * Returns a promise that resolves after the last handler. */ function checkTransitionFromHooks(matches, transition) { var promise = Promise.resolve(); reversedArray(matches).forEach(function (match) { promise = promise.then(function () { var handler = match.route.props.handler; if (!transition.isCancelled && handler.willTransitionFrom) return handler.willTransitionFrom(transition, match.component); }); }); return promise; } /** * Calls the willTransitionTo hook of all handlers in the given matches serially * with the transition object and any params that apply to that handler. Returns * a promise that resolves after the last handler. */ function checkTransitionToHooks(matches, transition) { var promise = Promise.resolve(); matches.forEach(function (match, index) { promise = promise.then(function () { var handler = match.route.props.handler; if (!transition.isCancelled && handler.willTransitionTo) return handler.willTransitionTo(transition, match.params); }); }); return promise; } /** * Returns a props object for a component that renders the routes in the * given matches. */ function computeHandlerProps(matches, query) { var props = { ref: null, key: null, params: null, query: null, activeRouteHandler: returnNull }; var childHandler; reversedArray(matches).forEach(function (match) { var route = match.route; props = Route.getUnreservedProps(route.props); props.ref = REF_NAME; props.key = Path.injectParams(route.props.path, match.params); props.params = match.params; props.query = query; if (childHandler) { props.activeRouteHandler = childHandler; } else { props.activeRouteHandler = returnNull; } childHandler = function (props, addedProps) { if (arguments.length > 2 && typeof arguments[2] !== 'undefined') throw new Error('Passing children to a route handler is not supported'); return route.props.handler(mergeProperties(props, addedProps)); }.bind(this, props); }); return props; } function returnNull() { return null; } function reversedArray(array) { return array.slice(0).reverse(); } module.exports = Route;
src/components/SwitchToggle/index.js
hasibsahibzada/quran.com-frontend
import React from 'react'; import PropTypes from 'prop-types'; const styles = require('./style.scss'); const SwitchToggle = ({ id, flat, checked, onToggle }) => ( <div className={`${styles.switch} switch`}> <input id={id} className={`${styles.toggle} ${flat ? styles.toggleFlat : styles.toggleRound}`} type="checkbox" checked={checked} onChange={onToggle} /> <label htmlFor={id} className={styles.label} /> </div> ); SwitchToggle.propTypes = { id: PropTypes.string, flat: PropTypes.bool, checked: PropTypes.bool, onToggle: PropTypes.func.isRequired }; SwitchToggle.defaultProps = { flat: false, checked: false }; export default SwitchToggle;
app/components/Logout.js
klpdotorg/tada-frontend
import React from 'react'; import { Link } from 'react-router'; const klplogo = require('../css/images/KLP_logo.png'); const klpImage = require('../css/images/klp.png'); const Logout = () => { return ( <div id="logout_page"> <nav className="main__header navbar navbar-white navbar-fixed-top"> <div id="header" className="container-fluid"> <div className="navbar-header"> <a className="navbar-brand" href="/"> <img src={klplogo} /> </a> </div> <div id="navbar" className="navbar-collapse collapse"> <p className="app-name navbar-text pull-left">Data Entry Operations 2015-2016</p> <p className="navbar-text pull-right"> <Link to="/login" className="btn btn-primary padded-btn"> LOGIN </Link> </p> </div> </div> </nav> <div className="klpimage-cont"> <img src={klpImage} className="klpImage" /> </div> <div className="row logout-text"> <div className="col-lg-12"> <span>You have successfully logged out. Come back soon!</span> </div> </div> </div> ); }; export default Logout;
app/containers/NavigatorPage/index.js
wanbinkimoon/wordlift-playground
/* * HomePage * * This is the first thing users see of our App, at the '/' route * * NOTE: while this component should technically be a stateless functional * component (SFC), hot reloading does not currently support SFCs. If hot * reloading is not a necessity for you then you can refactor it and remove * the linting exception. */ import React from 'react'; import Navigator from '../../components/Navigator'; export default class NavigatorPage extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function render() { return ( <Navigator /> ); } }
src/shipit/frontend/src/views/CredentialsMenu/index.js
lundjordan/services
import React from 'react'; import { object } from 'prop-types'; import { Glyphicon, NavDropdown, NavItem } from 'react-bootstrap'; import Auth0LoginMenuItem from '../../components/auth/Auth0LoginMenuItem'; export default class CredentialsMenu extends React.PureComponent { static contextTypes = { authController: object.isRequired, }; componentDidMount() { this.context.authController.on( 'user-session-changed', this.handleUserSessionChanged, ); } componentWillUnmount() { this.context.authController.off( 'user-session-changed', this.handleUserSessionChanged, ); } handleUserSessionChanged = () => { this.forceUpdate(); }; renderWithoutUser = () => <Auth0LoginMenuItem />; renderWithUser(userSession) { const { authController } = this.context; const icon = userSession.picture ? ( <img alt={userSession.name} src={userSession.picture} style={{ width: 18, height: 18, borderRadius: 9 }} /> ) : ( <Glyphicon glyph="user" /> ); const title = ( <span> {icon}&nbsp;{userSession.name} </span> ); return ( <NavDropdown id="sign-in-menu" key="sign-in-menu" title={title}> <NavItem onSelect={() => authController.setUserSession(null)}> <Glyphicon glyph="log-out" /> Sign Out </NavItem> </NavDropdown> ); } render() { // note: an update to the userSession will cause a forceUpdate const userSession = this.context.authController.getUserSession(); return userSession ? this.renderWithUser(userSession) : this.renderWithoutUser(); } }
src/svg-icons/device/battery-charging-60.js
pradel/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceBatteryCharging60 = (props) => ( <SvgIcon {...props}> <path fillOpacity=".3" d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V11h3.87L13 7v4h4V5.33C17 4.6 16.4 4 15.67 4z"/><path d="M13 12.5h2L11 20v-5.5H9l1.87-3.5H7v9.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V11h-4v1.5z"/> </SvgIcon> ); DeviceBatteryCharging60 = pure(DeviceBatteryCharging60); DeviceBatteryCharging60.displayName = 'DeviceBatteryCharging60'; export default DeviceBatteryCharging60;
desktop-application/release/PCB CNC Machine-darwin-x64/PCB CNC Machine.app/Contents/Resources/app/app/components/serialmonitor.js
santosh-surya/pcb-cnc-machine
import React, { Component } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Link } from 'react-router'; import {Grid, Row, Col, Panel, Table, Button, ButtonGroup, Input} from 'react-bootstrap'; import GridList from 'material-ui/lib/grid-list/grid-list'; import GridTile from 'material-ui/lib/grid-list/grid-tile'; import Divider from 'material-ui/lib/divider'; import Checkbox from 'material-ui/lib/checkbox'; import Toggle from 'material-ui/lib/toggle'; import RaisedButton from 'material-ui/lib/raised-button'; export default class SerialMonitor extends Component { propTypes: { height: React.PropTypes.number, rows: React.PropTypes.number.isRequired, home: React.PropTypes.object } constructor(props) { super(props); } _handleClean = () => { this.props.home.setState({commandLogs:[]}); } _handleShowOutgoing = (e, isOn) => { this.props.home.setState({showOutgoing: isOn}); } _handleShowIncoming = (e, isOn) => { this.props.home.setState({showIncoming: isOn}); } _renderList = () => { var logs = []; for (var i=0; i<this.props.home.state.commandLogs.length; i++){ var line = this.props.home.state.commandLogs[i]; var style = {marginTop: 10, borderBottom: '1px solid #dddddd', color: 'green'}; if (line.indexOf(">>") == 0){ if (this.props.home.state.showOutgoing) { line = line.substring(2); style = {marginTop: 10, borderBottom: '1px solid #dddddd', color: 'blue', fontWeight: 'bold'}; logs.push ( <GridTile key={i} cols={1} rows={1} style={style}> {line} </GridTile> ); } }else if (this.props.home.state.showIncoming){ logs.push( <GridTile key={i} cols={1} rows={1} style={style}> {line} </GridTile> ); } } return logs; } render() { if (["serialmonitor", "millingjob", "advancedcontrol"].indexOf(this.props.home.state.menu.page)<0) return (null); var height = Number(this.props.rows)*22; if (this.props.height != undefined) height = this.props.height; const monitor = { overflowY: 'scroll', width: '100%', maxHeight: height } if (this.props.home.state.commandLogs.length==0){ var style = {marginTop: 1, borderBottom: '1px solid #222', color: '#222'}; return ( <div> <Panel header={this.props.home.state.connectionPort}> <GridList key={1} cellHeight={30} cols={1} padding={5} style={monitor}> <GridTile key={1} cols={1} rows={1} style={style}> {"No logs to display..."} </GridTile> </GridList> </Panel> </div> ); } var list = this._renderList(); return ( <div> <Panel header={this.props.home.state.connectionPort}> <GridList key={1} cellHeight={50} cols={3} padding={1}> <GridTile key={1} cols={1} rows={1} style={{}}> <Toggle key={1} labelStyle={{width: ''}} label="Show Incoming" defaultToggled={this.props.home.state.showIncoming} onToggle={this._handleShowIncoming.bind(this)}/> </GridTile> <GridTile key={2} cols={1} rows={1} style={{}}> <Toggle key={2} labelStyle={{width: ''}} label="Show Outgoing" defaultToggled={this.props.home.state.showOutgoing} onToggle={this._handleShowOutgoing.bind(this)}/> </GridTile> <GridTile key={4} cols={1} rows={1} style={{float: "right"}}> <RaisedButton label="Clear" secondary={true} onTouchTap={this._handleClean.bind(this)}/> </GridTile> </GridList> <Divider /> <GridList key={2} cellHeight={30} cols={1} padding={5} style={monitor}> {list} </GridList> </Panel> </div> ); } }
src/browser/main.js
sikhote/davidsinclair
// @flow import type { Action } from '../common/types'; import React from 'react'; import ReactDOM from 'react-dom'; import Root from './app/Root'; import configureFound from './configureFound'; import configureReporting from '../common/configureReporting'; import configureStorage from '../common/configureStorage'; import configureStore from '../common/configureStore'; import localforage from 'localforage'; import uuid from 'uuid'; import { persistStore } from 'redux-persist'; const initialState = window.__INITIAL_STATE__; // eslint-disable-line no-underscore-dangle const reportingMiddleware = configureReporting({ appVersion: initialState.config.appVersion, sentryUrl: initialState.config.sentryUrl, unhandledRejection: fn => window.addEventListener('unhandledrejection', fn), }); // Why Found instead of React Router? Because Found is more powerful. // medium.com/@taion/react-routing-and-data-fetching-ec519428135c const found = configureFound(Root.routeConfig); const store = configureStore({ initialState, platformDeps: { uuid }, platformReducers: { found: found.reducer }, platformMiddleware: [reportingMiddleware], platformStoreEnhancers: found.storeEnhancers, }); const appElement = document.getElementById('app'); // 1. get found render args // 2. initial render (before rehydrate, to match client and server render) // 3. rehydrate local app state // 4. dispatch APP_STARTED found.getRenderArgs(store, renderArgs => { const onRehydrate = () => { // Don't import appStarted action creator since it would break hot reload. store.dispatch(({ type: 'APP_STARTED' }: Action)); // gist.github.com/gaearon/06bd9e2223556cb0d841#file-naive-js if (!module.hot || typeof module.hot.accept !== 'function') return; module.hot.accept('./app/Root', () => { const NextRoot = require('./app/Root').default; found.replaceRouteConfig(NextRoot.routeConfig); found.getRenderArgs(store, renderArgs => { ReactDOM.render( <NextRoot renderArgs={renderArgs} store={store} />, appElement, ); }); }); }; const afterInitialRender = () => { persistStore( store, { ...configureStorage(initialState.config.appName), storage: localforage, }, onRehydrate, ); }; ReactDOM.render( <Root renderArgs={renderArgs} store={store} />, appElement, afterInitialRender, ); });
src/js/SecondPage.js
merlox/dapp-transactions
import React from 'react' import Header from './Header' import { Link } from 'react-router-dom' import './../stylus/index.styl' import './../stylus/secondpage.styl' import LINKS from './utils.js' class SecondPage extends React.Component { constructor(props){ super(props) this.state = { dialog1: false, dialog2: false, dialog3: false, dialog4: false, oneActive: false, isMobile: false, } this.updateWindowDimensions = this.updateWindowDimensions.bind(this) } componentDidMount() { this.updateWindowDimensions() window.addEventListener('resize', this.updateWindowDimensions) } componentWillUnmount() { window.removeEventListener('resize', this.updateWindowDimensions) } updateWindowDimensions() { if(window.innerWidth <= 750 && this.state.isMobile === false) this.setState({ isMobile: true }) else if(window.innerWidth > 750 && this.state.isMobile) this.setState({ isMobile: false }) } render(){ return ( <div style={{height: '100%'}}> <div style={{display: this.props.showRetailers ? 'block' : 'none'}} className="retailers-container"> <h1 className="title">Choose a Retailer</h1> <div className="icon-box-container"> <div className="icon-box"> <img src="../img/retailer/garden.png" onClick={() => { this.setState({ dialog1: !this.state.dialog1, dialog2: false, dialog3: false, dialog4: false, oneActive: !this.state.dialog1, }) }} /> <p>Garden Gear</p> <input ref="retailer1-address" type="hidden" value="8 sloane square, South Kensignton" /> <input ref="retailer1-city" type="hidden" value="London" /> <input ref="retailer1-code" type="hidden" value="SW75RD" /> <Dialog extraClass="dialog-number-1" style={{ display: this.state.dialog1 ? 'block' : 'none' }} checkoutItem={data => { this.props.checkoutItem({ ...data, retailerName: 'Garden Gear', retailerImage: '../img/retailer/garden.png', retailerAddress: this.refs['retailer1-address'].value, retailerCity: this.refs['retailer1-city'].value, retailerCode: this.refs['retailer1-code'].value, }) }} item1={{ image: LINKS.baseUrl + "img/retailer/lawnmover.png", name: "Lawnmover", price: "12.99", }} item2={{ image: LINKS.baseUrl + "img/retailer/hedgetrimmer.png", name: "Hedgetrimmer", price: "12.99", }} item3={{ image: LINKS.baseUrl + "img/retailer/mover.png", name: "Wheelbarrow", price: "12.99", }} /> </div> <div className="icon-box" ref="second-box"> <img src="../img/retailer/suits.png" onClick={() => { this.setState({ dialog1: false, dialog2: !this.state.dialog2, dialog3: false, dialog4: false, oneActive: !this.state.dialog2, }) }} /> <p>Sharp Suits</p> <input ref="retailer2-address" type="hidden" value="8 sloane square, South Kensignton" /> <input ref="retailer2-city" type="hidden" value="London" /> <input ref="retailer2-code" type="hidden" value="SW75RD" /> <Dialog extraClass="dialog-number-2" style={{ display: this.state.dialog2 ? 'block' : 'none' }} checkoutItem={data => { this.props.checkoutItem({ ...data, retailerName: 'Sharp Suits', retailerImage: "../img/retailer/suits.png", retailerAddress: this.refs['retailer2-address'].value, retailerCity: this.refs['retailer2-city'].value, retailerCode: this.refs['retailer2-code'].value, }) }} item1={{ image: LINKS.baseUrl + "img/retailer/suit-jacket.png", name: "Suit Jacket", price: "12.99", }} item2={{ image: LINKS.baseUrl + "img/retailer/tie.png", name: "Tie", price: "12.99", }} item3={{ image: LINKS.baseUrl + "img/retailer/shirt.png", name: "Shirt", price: "12.99", }} /> </div> <div className="icon-box"> <img src="../img/retailer/box.png" onClick={() => { this.setState({ dialog1: false, dialog2: false, dialog3: !this.state.dialog3, dialog4: false, oneActive: !this.state.dialog3, }) }} /> <p>Toy Box</p> <input ref="retailer3-address" type="hidden" value="8 sloane square, South Kensignton" /> <input ref="retailer3-city" type="hidden" value="London" /> <input ref="retailer3-code" type="hidden" value="SW75RD" /> <Dialog extraClass="dialog-number-3" style={{ display: this.state.dialog3 ? 'block' : 'none' }} checkoutItem={data => { this.props.checkoutItem({ ...data, retailerName: 'Toy Box', retailerImage: "../img/retailer/box.png", retailerAddress: this.refs['retailer3-address'].value, retailerCity: this.refs['retailer3-city'].value, retailerCode: this.refs['retailer3-code'].value, }) }} item1={{ image: LINKS.baseUrl + "img/retailer/teddy-bear.png", name: "Teddy Bear", price: "12.99", }} item2={{ image: LINKS.baseUrl + "img/retailer/doll.png", name: "Doll", price: "12.99", }} item3={{ image: LINKS.baseUrl + "img/retailer/scooter.png", name: "Scooter", price: "12.99", }} /> </div> <div className="icon-box"> <img src="../img/retailer/jewelry.png" onClick={() => { this.setState({ dialog1: false, dialog2: false, dialog3: false, dialog4: !this.state.dialog4, oneActive: !this.state.dialog4, }) }} /> <p>Rhombus Jewelry</p> <input ref="retailer4-address" type="hidden" value="8 sloane square, South Kensignton" /> <input ref="retailer4-city" type="hidden" value="London" /> <input ref="retailer4-code" type="hidden" value="SW75RD" /> <Dialog extraClass="dialog-number-4" style={{ display: this.state.dialog4 ? 'block' : 'none' }} checkoutItem={data => { this.props.checkoutItem({ ...data, retailerName: 'Rhombus Jewelry', retailerImage: "../img/retailer/jewelry.png", retailerAddress: this.refs['retailer4-address'].value, retailerCity: this.refs['retailer4-city'].value, retailerCode: this.refs['retailer4-code'].value, }) }} item1={{ image: LINKS.baseUrl + "img/retailer/diamond-necklace.png", name: "Diamond Necklace", price: "12.99", }} item2={{ image: LINKS.baseUrl + "img/retailer/diamond-bracelet.png", name: "Diamond Bracelet", price: "12.99", }} item3={{ image: LINKS.baseUrl + "img/retailer/diamond-ring.png", name: "Diamond Ring", price: "12.99", }} /> </div> </div> </div> <div style={{display: this.props.showRetailers ? 'none' : 'block'}} className={ !this.state.isMobile && this.state.oneActive ? 'wholesalers-container expand-retailers' : 'wholesalers-container' }> <h2>Wholesalers</h2> <div className="icon-box-container"> <div className="icon-box"> <Link to={LINKS.counterSign}><img src={LINKS.baseUrl + "img/retailer/menswear.png"} /></Link> <p>Menswear Stockist</p> </div> <div className="icon-box"> <Link to={LINKS.counterSign}><img src={LINKS.baseUrl + "img/retailer/toydealer.png"} /></Link> <p>Toy Dealer</p> </div> <div className="icon-box"> <Link to={LINKS.counterSign}><img src={LINKS.baseUrl + "img/retailer/diamondis.png"} /></Link> <p>Diamondis</p> </div> <div className="icon-box"> <Link to={LINKS.counterSign}><img src={LINKS.baseUrl + "img/retailer/gardenerworld.png"} /></Link> <p>Gardener's World</p> </div> </div> </div> </div> ) } } class Dialog extends React.Component { constructor(props){ super(props) } render(){ return ( <div className={'dialog-box ' + (this.props.extraClass ? this.props.extraClass : '')} style={this.props.style} > <h3>Choose a product</h3> <div className="dialog-box-items"> <DialogItem image={this.props.item1.image} name={this.props.item1.name} price={this.props.item1.price} checkoutItem={data => this.props.checkoutItem(data)} /> <div className="dialog-border"></div> <DialogItem image={this.props.item2.image} name={this.props.item2.name} price={this.props.item2.price} checkoutItem={data => this.props.checkoutItem(data)} /> <div className="dialog-border"></div> <DialogItem image={this.props.item3.image} name={this.props.item3.name} price={this.props.item3.price} checkoutItem={data => this.props.checkoutItem(data)} /> </div> </div> ) } } class DialogItem extends React.Component{ constructor(props){ super(props) this.state = { quantity: 1 } } updateQuantity(increase){ if(increase) this.setState({ quantity: this.state.quantity + 1 }) else if(this.state.quantity > 1) this.setState({ quantity: this.state.quantity - 1 }) } render(){ return ( <div className="dialog-box-item"> <img src={this.props.image} /> <p className="product-title">{this.props.name}</p> <p className="product-price">$ {this.props.price}</p> <p className="qty">QTY</p> <div className="counter-container"> <button className="counter-sign" onClick={e => { e.preventDefault() this.updateQuantity(false) }} >-</button> <span className="qty-selected">{this.state.quantity}</span> <button className="counter-sign" onClick={e => { e.preventDefault() this.updateQuantity(true) }} >+</button> </div> <button className="checkout-button" onClick={() => { this.props.checkoutItem({ itemName: this.props.name, itemPrice: this.props.price, itemQuantity: this.state.quantity, }) }} >Checkout</button> </div> ) } } export default SecondPage
react/src/components/table/Footer.js
VREMSoftwareDevelopment/bwmon
/* * Copyright (C) 2010 - 2020 VREM Software Development <VREMSoftwareDevelopment@gmail.com> * * 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. * * Bandwidth Monitor */ import React from 'react'; import { TableHead, TableRow, TableCell } from '@material-ui/core'; const Footer = ({ prefix, cellInfos, values }) => ( <TableHead> <TableRow key="footer" id={prefix + '-footer'}> {cellInfos.map((cellInfo, index) => { const text = index === 0 ? 'Totals' : cellInfo.footer ? cellInfo.convert ? cellInfo.convert(values[cellInfo.id]) : values[cellInfo.id] : ''; return ( <TableCell key={cellInfo.id} align={cellInfo.align}> {text} </TableCell> ); })} </TableRow> </TableHead> ); export default Footer;
ajax/libs/mediaelement/1.1.1/jquery.js
sujonvidia/cdnjs
/*! * jQuery JavaScript Library v1.4.4 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Thu Nov 11 19:04:53 2010 -0500 */ (function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, "`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, "margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== -1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& !F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| [];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= 1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= "none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== 1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, "__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== 8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== "click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== "form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== 0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== "object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); c.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".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, [y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, "")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- 0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== "first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, 2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, "<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- 1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== "object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& !this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| !T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", [b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", 3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== "inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| 1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, "marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
app/components/header.js
7kfpun/TWAQIReactNative
import React from 'react'; import { func, string } from 'prop-types'; import { Platform, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; import { iOSColors } from 'react-native-typography'; import Ionicons from 'react-native-vector-icons/Ionicons'; import noop from '../utils/helpers'; const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingTop: Platform.OS === 'ios' ? 50 : 20, paddingHorizontal: 10, backgroundColor: 'white', }, titleText: { fontSize: 24, color: 'black', }, descriptionText: { marginTop: 6, fontSize: 16, color: 'black', lineHeight: 16, }, rightIcon: { flex: 1, alignItems: 'flex-end', paddingRight: 5, }, }); const Header = ({ title, description, iconName, onPress, backOnPress }) => ( <TouchableOpacity style={{ height: 100 }} onPress={backOnPress}> <View style={styles.container}> {backOnPress && backOnPress !== noop && ( <Ionicons style={{ marginRight: 10 }} name="ios-arrow-back" size={30} color={iOSColors.black} /> )} <View style={{ flex: 5, flexDirection: 'row', alignItems: 'center' }}> {title && <Text style={styles.titleText}>{title}</Text>} {description && ( <Text style={styles.descriptionText}>{description}</Text> )} </View> {iconName && ( <TouchableOpacity style={styles.rightIcon} onPress={onPress}> <Ionicons name={iconName} size={26} color={iOSColors.gray} /> </TouchableOpacity> )} </View> </TouchableOpacity> ); Header.defaultProps = { title: null, description: null, onPress: noop, backOnPress: noop, iconName: null, }; Header.propTypes = { title: string, description: string, onPress: func, backOnPress: func, iconName: string, }; export default Header;
src/by-arrow-keys.js
reactabular/selectabular
import React from 'react'; import Select from './components/select'; const byArrowKeys = props => children => React.createElement(Select, props, children); export default byArrowKeys;
packages/flow-upgrade/src/upgrades/0.53.0/ReactComponentExplicitTypeArgs/__tests__/fixtures/PropsInline.js
samwgoldman/flow
// @flow import React from 'react'; class MyComponent extends React.Component { props: {a: number, b: number, c: number}; defaultProps: T; static props: T; static state: T; a: T; b = 5; c: T = 5; method() {} } const expression = () => class extends React.Component { props: {a: number, b: number, c: number}; defaultProps: T; static props: T; static state: T; a: T; b = 5; c: T = 5; method() {} }
src/svg-icons/action/eject.js
mit-cml/iot-website-source
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionEject = (props) => ( <SvgIcon {...props}> <path d="M5 17h14v2H5zm7-12L5.33 15h13.34z"/> </SvgIcon> ); ActionEject = pure(ActionEject); ActionEject.displayName = 'ActionEject'; ActionEject.muiName = 'SvgIcon'; export default ActionEject;
Examples/BabelES6/src/components/App.js
nevir/react-native-webpack-server
'use strict'; import React from 'react-native'; import docs from '../data/docs'; import DocIndex from './DocIndex'; const { NavigatorIOS, View, Text, StyleSheet, } = React; export default class App extends React.Component { render() { return ( <NavigatorIOS style={styles.container} initialRoute={{ title: 'React Native Docs', component: DocIndex, passProps: {docs}, }} /> ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', }, });
assets/blog/js/Article.js
mywei1989/blog_react
import React from 'react'; import { Link } from 'react-router'; import $ from 'jquery'; import Settings from '../../../settings'; class Article extends React.Component{ constructor(props){ super(props); this.state={ title:'', timeStr:'', tags:[], post:'' } } componentDidMount(){ this.getArticle(this.props); } componentWillReceiveProps(nextProps){ this.getArticle(nextProps); } getArticle(props){ let self = this; let url = Settings.getServiceUrl(); //判断是否是从router进入 从router进入这是是undefined if(props.params){ let queryType = props.route.to.queryType; if(queryType!='info'){ url = url + '/' + props.params.year + '/' + props.params.month + '/' + props.params.name; }else{ url = url + '/' + props.params.info; } $.ajax({ url:url, type:'GET', }).done(function(result){ self.setState({ title:result.article.title, timeStr:result.article.timeStr, tags:result.article.tags, post:result.article.post }); }.bind(self)); } } render(){ if(this.props.route){ return ( <article> <header> <h2> <a href="#">{this.state.title}</a> </h2> </header> <div className="article-meta clearfix"> <time className="left">{this.state.timeStr}</time> <ul className="tags left"></ul> <ul className="tags right"> { this.state.tags.map(function(item,index){ return (<li><Link to={"/tag"+"/"+item.tag+"/"}>{item.tagName}</Link></li>) }) } </ul> </div> <div className="markdown-body" dangerouslySetInnerHTML={{__html: this.state.post}}> </div> </article> ) }else{ return( <article> <header> <h2> <Link to={"/"+this.props.articleModel.time.year+"/"+this.props.articleModel.time.month+"/"+this.props.articleModel.name}>{this.props.articleModel.title}</Link> </h2> </header> <div className="article-meta clearfix"> <time className="left" >{this.props.articleModel.timeStr}</time> <ul className="tags right"> { this.props.articleModel.tags.map(function(item,index){ return (<li key={index}><Link to={"/tag"+"/"+item.tag+"/"}>{item.tagName}</Link></li>) }) } </ul> </div> <div className="markdown-body" dangerouslySetInnerHTML={{__html: this.props.articleModel.post}}> </div> </article> ) } } } export default Article
scully.js
ben-scully/eMazon-Me
import React from 'react' import { render } from 'react-dom' import { Router, Route, Link, browserHistory } from 'react-router' import App from './components/App' import HomePage from './components/HomePage' import Store from './components/Store' import Item from './components/Item' render(( <Router history={browserHistory}> <Route path="/" component={App}> <Route path="home" component={HomePage}/> <Route path="/store/:storeID" component={Store}/> <Route path="/item/:itemID" component={Item}/> </Route> </Router> ), document.body) // app // homepage // searchBar // storesListings // storeTN [has links to store/:storeID] // // store :storeID // itemTN [has links to item/:itemID] // // resultsListings // itemTN [has links to item/:itemID] // // item :itemID // import React from 'react' // import { render } from 'react-dom' // import HomePage from './components/HomePage' // // import testData from '.././data/thumbnailSampleData' // // render( // <HomePage stores={testData}/>, // document.querySelector('body') // ) // import React from 'react' // import { render } from 'react-dom' // import Store from './components/Store' // // import testData from './data/sampleData' // // render( // <Store storeName="SampleStoreName" storeItems={testData}/>, // document.querySelector('body') // ) // import React from 'react' // import { render } from 'react-dom' // import ResultsListings from './components/ResultsListings' // // import testData from './data/sampleData' // // render( // <ResultsListings resultItems={testData} />, // document.querySelector('body') // ) // import React from 'react' // import { render } from 'react-dom' // import Item from './components/Item' // // import testData from './data/sampleData' // var oneItem = testData[0] // // render( // <Item itemID={oneItem.itemID} // name={oneItem.name} // image={oneItem.image} // start_price={oneItem.start_price} // buynow_price={oneItem.buynow_price} />, // document.querySelector('body') // )
src/index.js
josmardias/frontend-boilerplate
import React from 'react' import ReactDOM from 'react-dom' import App from './App' import './index.css' const rootElement = document.getElementById('root') ReactDOM.render( <App />, rootElement ) if (module.hot) { module.hot.accept('./App', () => { // If using Webpack 2 with ES modules mode, you can // use <App /> here rather than require() a <NextApp />. const NextApp = require('./App').default ReactDOM.render( <NextApp />, rootElement ) }) }
examples/pinterest/app.js
okcoker/react-router
import React from 'react'; import { Router, Route, IndexRoute, Link } from 'react-router'; var PICTURES = [ { id: 0, src: 'http://placekitten.com/601/601' }, { id: 1, src: 'http://placekitten.com/610/610' }, { id: 2, src: 'http://placekitten.com/620/620' } ]; var Modal = React.createClass({ styles: { position: 'fixed', top: '20%', right: '20%', bottom: '20%', left: '20%', padding: 20, boxShadow: '0px 0px 150px 130px rgba(0, 0, 0, 0.5)', overflow: 'auto', background: '#fff' }, render () { return ( <div style={this.styles}> <p><Link to={this.props.returnTo}>Back</Link></p> {this.props.children} </div> ) } }) var App = React.createClass({ componentWillReceiveProps (nextProps) { // if we changed routes... if (( nextProps.location.key !== this.props.location.key && nextProps.location.state && nextProps.location.state.modal )) { // save the old children (just like animation) this.previousChildren = this.props.children } }, render() { var { location } = this.props var isModal = ( location.state && location.state.modal && this.previousChildren ) return ( <div> <h1>Pinterest Style Routes</h1> <div> {isModal ? this.previousChildren : this.props.children } {isModal && ( <Modal isOpen={true} returnTo={location.state.returnTo}> {this.props.children} </Modal> )} </div> </div> ); } }); var Index = React.createClass({ render () { return ( <div> <p> The url `/pictures/:id` can be rendered anywhere in the app as a modal. Simply put `modal: true` in the `state` prop of links. </p> <p> Click on an item and see its rendered as a modal, then copy/paste the url into a different browser window (with a different session, like Chrome -> Firefox), and see that the image does not render inside the overlay. One URL, two session dependent screens :D </p> <div> {PICTURES.map(picture => ( <Link key={picture.id} to={`/pictures/${picture.id}`} state={{ modal: true, returnTo: this.props.location.pathname }}> <img style={{ margin: 10 }} src={picture.src} height="100" /> </Link> ))} </div> <p><Link to="/some/123/deep/456/route">Go to some deep route</Link></p> </div> ) } }) var Deep = React.createClass({ render () { return ( <div> <p>You can link from anywhere really deep too</p> <p>Params stick around: {this.props.params.one} {this.props.params.two}</p> <p> <Link to={`/pictures/0`} state={{ modal: true, returnTo: this.props.location.pathname}}> Link to picture with Modal </Link><br/> <Link to={`/pictures/0`}> Without modal </Link> </p> </div> ) } }) var Picture = React.createClass({ render() { return ( <div> <img src={PICTURES[this.props.params.id].src} style={{ height: '80%' }} /> </div> ); } }); React.render(( <Router> <Route path="/" component={App}> <IndexRoute component={Index}/> <Route path="/pictures/:id" component={Picture}/> <Route path="/some/:one/deep/:two/route" component={Deep}/> </Route> </Router> ), document.getElementById('example'))
packages/react-scripts/fixtures/kitchensink/src/features/env/FileEnvVariables.js
reedsa/create-react-app
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; export default () => ( <span> <span id="feature-file-env-original-1"> {process.env.REACT_APP_ORIGINAL_1} </span> <span id="feature-file-env-original-2"> {process.env.REACT_APP_ORIGINAL_2} </span> <span id="feature-file-env"> {process.env.REACT_APP_DEVELOPMENT} {process.env.REACT_APP_PRODUCTION} </span> <span id="feature-file-env-x">{process.env.REACT_APP_X}</span> </span> );
lib/components/admin/field-trip-windows.js
opentripplanner/otp-react-redux
import React from 'react' import { connect } from 'react-redux' import FieldTripDetails from './field-trip-details' import FieldTripList from './field-trip-list' const WINDOW_WIDTH = 450 const MARGIN = 15 /** * Collects the various draggable windows for the Field Trip module. */ const FieldTripWindows = ({callTaker}) => { const {fieldTrip} = callTaker // Do not render details or list if visible is false. if (!fieldTrip.visible) return null return ( <> <FieldTripDetails style={{ bottom: `${MARGIN}px`, right: `${MARGIN * 2 + WINDOW_WIDTH}px`, width: `${WINDOW_WIDTH}px`, // Ensure this window stays above the list. zIndex: 9999999 + 1 }} /> <FieldTripList draggableProps={{positionOffset: {x: '-40%'}}} style={{ bottom: `${MARGIN}px`, right: `${MARGIN}px`, width: `${WINDOW_WIDTH}px` }} /> </> ) } const mapStateToProps = (state, ownProps) => { return { callTaker: state.callTaker } } export default connect(mapStateToProps)(FieldTripWindows)
app/components/Resume/Education/Degree.js
sysrex/sysrex
import React from 'react'; import PropTypes from 'prop-types'; const Degree = props => ( <article className="degree-container"> <header> <h4 className="degree">{props.data.degree}</h4> <p className="school"><a href={props.data.link}>{props.data.school}</a>, {props.data.year}</p> </header> </article> ); Degree.propTypes = { data: PropTypes.shape({ degree: PropTypes.string.isRequired, link: PropTypes.string.isRequired, school: PropTypes.string.isRequired, year: PropTypes.number.isRequired, }).isRequired, }; export default Degree;
js/components/home/index.js
kondoSoft/que_hacer_movil
import React, { Component } from 'react'; import { TouchableOpacity, Image, WebView,BackAndroid } from 'react-native'; import { connect } from 'react-redux'; import { actions } from 'react-native-navigation-redux-helpers'; import { Container, Content, Card, CardItem, Thumbnail, Header, Title, Text, Button, Item, Icon, Input, Left, Body, Right } from 'native-base'; import { Grid, Row, Col } from 'react-native-easy-grid'; import { openDrawer } from '../../actions/drawer'; import { setIndex, fetchCategory, fetchAdvertising, fetchVideo } from '../../actions/list'; import { fetchClassifiedsCategory } from '../../actions/listCategory'; import { setLoading } from '../../actions/listZone'; import { fetchSearch } from '../../actions/search'; import styles from './styles'; const { reset, pushRoute, pushRouteC, } = actions; class Home extends Component { static propTypes = { list: React.PropTypes.arrayOf(React.PropTypes.object), advertising: React.PropTypes.arrayOf(React.PropTypes.object), listSearch: React.PropTypes.arrayOf(React.PropTypes.object), setIndex: React.PropTypes.func, openDrawer: React.PropTypes.func, pushRoute: React.PropTypes.func, reset: React.PropTypes.func, navigation: React.PropTypes.shape({ key: React.PropTypes.string, }), } constructor(props) { super(props); this.state = {value: ''}; this.getRandomIndex = this.getRandomIndex.bind(this) this.handleChange = this.handleChange.bind(this) } componentWillMount(){ this.props.fetchCategory() this.props.fetchAdvertising() this.props.fetchVideo() } pushRoute(route, index, value) { this.props.setIndex(index); this.props.setLoading() this.props.fetchSearch(value); this.props.pushRoute({ key: route, index: 1 }, this.props.navigation.key); } pushRouteC(route, index) { this.props.setIndex(index); this.props.setLoading() this.props.fetchClassifiedsCategory(this.props.list[index].id, 1) this.props.pushRoute({ key: route, index: 1 }, this.props.navigation.key); } pushRouteZone(route, index) { console.log(index); this.props.setIndex(index); this.props.setLoading() // this.props.fetchClassifiedsCategory(this.props.list[index].id, 1) this.props.pushRoute({ key: route, index: 1 }, this.props.navigation.key); } getRandomIndex(){ const advertising = this.props.advertising randomIndex = Math.floor(Math.random()*advertising.length) return randomIndex } handleChange(event) { this.setState({value: event.nativeEvent.text}); } render() { var randomIndex = this.getRandomIndex() var url if(this.props.video[0] != undefined){ url = this.props.video[0].url } return ( <Container style={styles.container}> <Image source={require('../../../assets/img/mapsMerida.png')} style={styles.backgroundImage} > <Header searchBar style={styles.header}> <Item style={styles.item}> <Icon name="search" onPress={() => this.pushRoute('establishments', this.props.navigation.key, this.state.value)}/> <Input placeholder="A dónde quieres ir?" onChange={event => this.handleChange(event)} style={styles.itemInput}/> </Item> <Right style={{ flex: 1 }}> <Button transparent onPress={this.props.openDrawer}> <Icon style={{color: 'dimgray'}} name="md-more" /> </Button> </Right> </Header> <Grid style={{ maxHeight: 62, flex: 1 }}> <Row> <Thumbnail style={styles.imagePub} square source={{ uri: this.props.advertising[randomIndex].image}} /> </Row> </Grid> <Content padder scrollEnabled={true} style={styles.contentHome}> <Grid style={styles.videoGrid}> <Row style={styles.videoRow}> {(this.props.video[0] != undefined) ? <Text style={{ flex: 1, textAlign: 'center', maxHeight: 20, fontSize:11, top: 5, width: 239 }}>{this.props.video[0].name}</Text> : <Text></Text>} {/* <Text style={{ flex: 1, textAlign: 'center', maxHeight: 20, fontSize:11, top: 5, width: 239 }}>{this.props.video[0].name}</Text> */} <WebView source={{ uri: url }} style={styles.webView} javaScriptEnabled={true} /> </Row> </Grid> <Grid style={styles.mt}> {this.props.list.map((item, i) => <Card key={i} style={{ flex: 1 }}> <CardItem style={styles.cardItem}> { this.props.list[i] == this.props.list[0] ? ( <TouchableOpacity onPress={() => this.pushRouteZone('blankPage', i)} > <Body style={{ flex: 1, alignItems: 'center'}}> <Thumbnail square source={{ uri: this.props.list[i].image }} style={styles.thumbnailHome} /> <Text style={styles.text}>CATEGORÍAS {this.props.list[i].category_name}</Text> </Body> </TouchableOpacity> ) : ( <TouchableOpacity onPress={() => this.pushRouteC('classified', i)} > <Body style={{ flex: 1, alignItems: 'center' }}> <Thumbnail square source={{ uri: this.props.list[i].image }} style={styles.thumbnailHome} /> <Text style={styles.text}>CATEGORÍAS {this.props.list[i].category_name}</Text> </Body> </TouchableOpacity> )} </CardItem> </Card> )} </Grid> <Grid> <Row style={styles.rowAnun}> <Button full warning onPress={() => this.pushRoute('contactus')}> <Text style={styles.textAun}> ANUNCIATE AQUI</Text> </Button> </Row> </Grid> </Content> </Image> </Container> ); } } function bindAction(dispatch) { return { setIndex: index => dispatch(setIndex(index)), fetchCategory: index => dispatch(fetchCategory(index)), fetchClassifiedsCategory: (index, page) => dispatch(fetchClassifiedsCategory(index, page)), fetchVideo: index => dispatch(fetchVideo(index)), fetchSearch: name => dispatch(fetchSearch(name)), fetchAdvertising: index => dispatch(fetchAdvertising(index)), openDrawer: () => dispatch(openDrawer()), pushRoute: (route, key) => dispatch(pushRoute(route, key)), reset: key => dispatch(reset([{ key: 'home' }], key, 0)), setLoading: () => dispatch(setLoading()), }; } const mapStateToProps = state => ({ list: state.list.list, advertising: state.list.advertising, video: state.list.videoSelected, navigation: state.cardNavigation, listSearch: state.search.results, }); export default connect(mapStateToProps, bindAction)(Home);
wrappers/yaml.js
johnpmorris/johnpmorris.github.io
import React from 'react' import yaml from 'js-yaml' module.exports = React.createClass({ propTypes () { return { route: React.PropTypes.object, } }, render () { const data = this.props.route.page.data return ( <div> <h1>{data.title}</h1> <p>Raw view of yaml file</p> <pre dangerouslySetInnerHTML={{ __html: yaml.safeDump(data) }} /> </div> ) }, })
src/Input/RichText.js
skystebnicki/chamel
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import ThemeService from '../styles/ChamelThemeService'; import { stateToHTML } from 'draft-js-export-html'; import { stateFromHTML } from 'draft-js-import-html'; import { Editor, EditorState, RichUtils } from 'draft-js'; // Custom overrides for "code" style. const styleMap = { CODE: { backgroundColor: 'rgba(0, 0, 0, 0.05)', fontFamily: '"Inconsolata", "Menlo", "Consolas", monospace', fontSize: 16, padding: 2, }, }; /** * Chamel Editor component for editing rich text and source code */ class RichText extends Component { /** * Set accepted properties */ static propTypes = { /** * The callback function used when user changes the content of the editor * * @type {function} */ onChange: PropTypes.func, /** * The callback function used when user toggles an icon of the editor * * @type {function} */ onToggle: PropTypes.func, /** * The callback function used when user looses the focus of the editor * * @type {function} */ onBlur: PropTypes.func, /** * The initial value of the content editor * * @type {string} */ value: PropTypes.string, /** * The command that will be executed based on the type that was provided * * @type {string} */ commandToggleType: PropTypes.string, /** * This will determine what style to toggle * * @type {string} */ commandToggleStyle: PropTypes.oneOf(['block', 'inline']), }; /** * An alternate theme may be passed down by a provider */ static contextTypes = { chamelTheme: PropTypes.object, }; /** * Class constructor * * @param {Object} props Properties to send to the render function */ constructor(props) { // Call parent constructor super(props); let initialEditorState = EditorState.createEmpty(); // Check if we have a value that we will set in the editor if (props.value) { // Set the EditorState that it will have an existing content initialEditorState = EditorState.createWithContent(stateFromHTML(props.value)); } this.state = { editorState: initialEditorState, }; } /** * Handle when the editor has changed * * @param {obj} editorState The top-level state object for the editor. * @private */ _onChange = editorState => { this.setState({ editorState }); if (this.props.onChange) { let content = stateToHTML(editorState.getCurrentContent()); this.props.onChange(content); } }; /** * Handles when the user set the focus in the editor * * @private */ _focus = () => { this.refs.editor.focus(); if (this.props.onFocus) { let content = stateToHTML(this.state.editorState.getCurrentContent()); this.props.onFocus(content); } }; /** * Handle when the editor looses the focus * * @private */ _onBlur = editorState => { if (this.props.onBlur) { let content = stateToHTML(this.state.editorState.getCurrentContent()); this.props.onBlur(content); } }; /** * Handle a RETURN keydown event * * @param {string} command The command that was sent * @returns {boolean} * @private */ _handleKeyCommand = command => { const { editorState } = this.state; const newState = RichUtils.handleKeyCommand(editorState, command); if (newState) { this._onChange(newState); return true; } return false; }; /** * Handle when user hits the tab button * * @param {DOMEvent} e Reference to the DOM event being sent * @returns {boolean} * @private */ _onTab = e => { const maxDepth = 4; this._onChange(RichUtils.onTab(e, this.state.editorState, maxDepth)); }; /** * Handles the toggling of block types in the toolbar icons * * @param {string} blockType The block type that was clicked * @private */ _toggleBlockType = blockType => { let editorState = RichUtils.toggleBlockType(this.state.editorState, blockType); if (this.props.onToggle) { let content = stateToHTML(editorState.getCurrentContent()); this.props.onToggle(content); } this.setState({ editorState }); }; /** * Handles the toggling of inline styles in the toolbar icons * * @param {string} inlineStyle The inline style that was clicked * @private */ _toggleInlineStyle = inlineStyle => { let editorState = RichUtils.toggleInlineStyle(this.state.editorState, inlineStyle); if (this.props.onToggle) { let content = stateToHTML(editorState.getCurrentContent()); this.props.onToggle(content); } this.setState({ editorState }); }; /** * Handles the getting of block class name * * @param {obj} theme The theme that we are currently using * @param {obj} block Represents the state of the entire document. * * @return {string} Returns the current theme class name * @private */ _getBlockStyle(theme, block) { switch (block.getType()) { case 'blockquote': return theme.RichTextBlockquote; default: return null; } } /** * Componenent is about to receive new props */ componentWillReceiveProps(nextProps) { if (nextProps.commandToggleStyle === 'block') { this._toggleBlockType(nextProps.commandToggleType); } else if (nextProps.commandToggleStyle === 'inline') { this._toggleInlineStyle(nextProps.commandToggleType); } } render() { const { editorState } = this.state; // Determine which theme to use let theme = this.context.chamelTheme && this.context.chamelTheme.input ? this.context.chamelTheme.input : ThemeService.defaultTheme.input; // Set the classes let classes = theme.richText; // Determine if the editor has text let contentState = editorState.getCurrentContent(); if (!contentState.hasText()) { if ( contentState .getBlockMap() .first() .getType() !== 'unstyled' ) { classes += theme.RichTextHidePlaceholder; } } // Append the className specified in the this.props if (this.props.className) { classes += ' ' + this.props.className; } let selection = editorState.getSelection(); let blockType = editorState .getCurrentContent() .getBlockForKey(selection.getStartKey()) .getType(); return ( <div className={theme.richTextContainer}> <div className={classes} onClick={this._focus}> <Editor blockStyleFn={this._getBlockStyle.bind(this, theme)} customStyleMap={styleMap} editorState={editorState} handleKeyCommand={this._handleKeyCommand} onChange={this._onChange} onBlur={this._onBlur} onTab={this._onTab} ref="editor" spellCheck={true} /> </div> </div> ); } } export default RichText;
chrome/extension/inject.js
altany/react-new-tab-chrome-extension
import React, { Component } from 'react'; import { render } from 'react-dom'; import Dock from 'react-dock'; class InjectApp extends Component { constructor(props) { super(props); this.state = { isVisible: false }; } buttonOnClick = () => { this.setState({ isVisible: !this.state.isVisible }); }; render() { return ( <div> <button onClick={this.buttonOnClick}> Open TodoApp </button> <Dock position='right' dimMode='transparent' defaultSize={0.4} isVisible={this.state.isVisible} > <iframe style={{ width: '100%', height: '100%', }} frameBorder={0} allowTransparency='true' src={chrome.extension.getURL(`inject.html?protocol=${location.protocol}`)} /> </Dock> </div> ); } } window.addEventListener('load', () => { const injectDOM = document.createElement('div'); injectDOM.className = 'inject-react-example'; injectDOM.style.textAlign = 'center'; document.body.appendChild(injectDOM); render(<InjectApp />, injectDOM); });
ajax/libs/asynquence-contrib/0.5.2-c/contrib.js
jonobr1/cdnjs
/*! asynquence-contrib v0.5.2-c (c) Kyle Simpson MIT License: http://getify.mit-license.org */ !function(n,e){"undefined"!=typeof module&&module.exports?(module.exports=function t(n){if("string"==typeof n)try{n=require(n)}catch(r){return t}return e(n)},"string"==typeof n&&(module.exports=module.exports(require("path").join("..",n)))):"function"==typeof define&&define.amd?define([n],e):e(n)}(this.ASQ||"asynquence",function(n){"use strict";function e(e,a,u,i,o){a=a.map(function(e,a){var c;return n.isSequence(e)?(c={fn:e},l(c),function(n){c.fn.val(function(){u(n,a,t.call(arguments))}).or(function(){i(n,a,t.call(arguments))})}):function(n){var l=t.call(arguments);l[0]=function(){u(n,a,t.call(arguments))},l[0].fail=function(){i(n,a,t.call(arguments))},l[0].abort=function(){o()},l[0].errfcb=function(e){e?i(n,a,[e]):u(n,a,t.call(arguments,1))},e.apply(r,l)}}),e.then(function(){var n=t.call(arguments);a.forEach(function(e){e.apply(r,n)})})}var t=Array.prototype.slice,r=Object.create(null),a="__ASQ__",u=n.__schedule,l=n.__tapSequence;return n.extend("after",function(n){return function(e){var a=arguments.length>1?t.call(arguments,1):void 0;return e=+e||0,n.then(function(n){a=a||t.call(arguments,1),setTimeout(function(){n.apply(r,a)},e)}),n}}),n.after=function(){return n().after.apply(r,arguments)},n.extend("any",function(a,u){return function(){function l(){g=!0,p.length=0,h.length=0}function i(n){h.length>0?(h.length=s.length,n.apply(r,h)):(p.length=s.length,n.fail.apply(r,p)),l()}function o(e,t,a){g||(f++,h[t]=a.length>1?n.messages.apply(r,a):a[0],f===s.length&&(g=!0,i(e)))}function c(e,t,a){g||t in p||(f++,p[t]=a.length>1?n.messages.apply(r,a):a[0]),g||f!==s.length||(g=!0,i(e))}if(u("seq_error")||u("seq_aborted")||0===arguments.length)return a;var s,f=0,p=[],g=!1,h=[];return s=t.call(arguments),e(a,s,o,c,l),a}}),n.extend("errfcb",function(n){return function(){var e={val:function(n){return e.val_cb=n,e},or:function(n){return e.or_cb=n,e}};return e[a]=!0,n.seq(e),function(n){n?e.or_cb(n):e.val_cb.apply(r,t.call(arguments,1))}}}),n.extend("failAfter",function(n){return function(e){var a=arguments.length>1?t.call(arguments,1):void 0;return e=+e||0,n.then(function(n){setTimeout(function(){n.fail.apply(r,a)},e)}),n}}),n.failAfter=function(){return n().failAfter.apply(r,arguments)},n.extend("first",function(a,u){return function(){function l(){f.length=0}function i(e,t,a){p||(p=!0,e(a.length>1?n.messages.apply(r,a):a[0]),l())}function o(e,t,a){p||t in f||(s++,f[t]=a.length>1?n.messages.apply(r,a):a[0],s===c.length&&(p=!0,f.length=c.length,e.fail.apply(r,f),l()))}if(u("seq_error")||u("seq_aborted")||0===arguments.length)return a;var c,s=0,f=[],p=!1;return c=t.call(arguments),e(a,c,i,o,l),a}}),function(){var e;n.iterable=function(){function l(){throw 1===w.length?w[0]:w}function i(){var n;if(d=null,b)for(0!==S.length||_||(_=!0,l());S.length>0;){_=!0,n=S.shift();try{n.apply(r,w)}catch(e){checkBranding(e)?w=w.concat(e):(w.push(e),e.stack&&w.push(e.stack)),0===S.length&&l()}}}function o(){return b||q||0===arguments.length?v:(x.push.apply(x,arguments),v)}function c(){return q||0===arguments.length?v:(S.push.apply(S,arguments),d||(d=u(i)),v)}function s(){return q||0===arguments.length?v:(t.call(arguments).forEach(function(n){o(n).or(n.fail)}),v)}function f(){if(b||q||0===x.length)return x.length>0&&p("Sequence cannot be iterated"),{done:!0};try{return{value:x.shift().apply(r,arguments)}}catch(e){return n.isMessageWrapper(e)?p.apply(r,e):e.stack?p(e,e.stack):p(e),{}}}function p(){return b||q?v:(w.push.apply(w,arguments),b=!0,d||(d=u(i)),v)}function g(){b||q||(q=!0,clearTimeout(d),d=null,x.length=S.length=w.length=0)}function h(){var t;return e={val_queue:x.slice(),or_queue:S.slice()},t=n.iterable(),e=null,t}function m(){return S.push(function(){}),v}function y(n){return Object.defineProperty(n,a,{enumerable:!1,value:!0}),n}var v,d,b=!1,_=!1,q=!1,x=[],S=[],w=[];return v=y({val:o,then:o,or:c,pipe:s,next:f,"throw":p,abort:g,duplicate:h,defer:m}),v["object"==typeof Symbol&&null!=Symbol&&Symbol.iterator||"@@iterator"]=function(){return v},e&&(x=e.val_queue.slice(0),S=e.or_queue.slice(0)),v.val.apply(r,arguments),v}}(),n.extend("last",function(a,u){return function(){function l(){h=!0,g.length=0,f=null}function i(e){null!=f?e(f.length>1?n.messages.apply(r,f):f[0]):(g.length=s.length,e.fail.apply(r,g)),l()}function o(n,e,t){h||(p++,f=t,p===s.length&&(h=!0,i(n)))}function c(e,t,a){h||t in g||(p++,g[t]=a.length>1?n.messages.apply(r,a):a[0]),h||p!==s.length||(h=!0,i(e))}if(u("seq_error")||u("seq_aborted")||0===arguments.length)return a;var s,f,p=0,g=[],h=!1;return s=t.call(arguments),e(a,s,o,c,l),a}}),n.extend("map",function(e,a){return function(u,l){return a("seq_error")||a("seq_aborted")?e:(e.seq(function(){var e,a=t.call(arguments);return l||(l=a.shift()),u||(u=a.shift()),"function"==typeof u&&Array.isArray(l)&&(e=u,u=l,l=e),n.apply(r,a).gate.apply(r,u.map(function(n){return function(){l.apply(r,[n].concat(t.call(arguments)))}}))}).val(function(){return t.call(arguments)}),e)}}),n.extend("none",function(a,u){return function(){function l(){g=!0,p.length=0,h.length=0}function i(n){h.length>0?(h.length=s.length,n.fail.apply(r,h)):(p.length=s.length,n.apply(r,p)),l()}function o(e,t,a){g||(f++,h[t]=a.length>1?n.messages.apply(r,a):a[0],f===s.length&&(g=!0,i(e)))}function c(e,t,a){g||t in p||(f++,p[t]=a.length>1?n.messages.apply(r,a):a[0]),g||f!==s.length||(g=!0,i(e))}if(u("seq_error")||u("seq_aborted")||0===arguments.length)return a;var s,f=0,p=[],g=!1,h=[];return s=t.call(arguments),e(a,s,o,c,l),a}}),n.extend("pThen",function(e,a){return function(u,l){if(a("seq_aborted"))return e;var i=!1,o=!1;return"function"==typeof u&&e.then(function(e){if(i)e.apply(r,t.call(arguments,1));else{var a,l=n.messages.apply(r,arguments);l.shift(),1===l.length&&(l=l[0]),o=!0;try{a=u(l)}catch(c){return n.isMessageWrapper(c)||(c=[c]),void e.fail.apply(r,c)}n.isSequence(a)?a.pipe(e):n.isMessageWrapper(a)?e.apply(r,a):("object"==typeof a||"function"==typeof a)&&"then"in a?a.then(e,e.fail):e(a)}}),"function"==typeof l&&e.or(function(){if(!o){var u,c,s=n.messages.apply(r,arguments),f=t.call(a("or_queue"));1===s.length&&(s=s[0]),i=!0,u=l(s),c=a("sequence_messages"),c.length=0,"undefined"!=typeof u&&(n.isMessageWrapper(u)||(u=[u]),c.push.apply(c,u)),a("sequence_errors").length=0,a("seq_error",!1),a("then_ready",!0),a("or_queue").length=0,e.val(function(){return n.messages.apply(r,arguments)}),f.length>0&&n.__schedule(function(){e.or.apply(r,f)})}}),e}}),n.extend("pCatch",function(n,e){return function(t){return e("seq_aborted")?n:(n.pThen(void 0,t),n)}}),n.extend("race",function(e,a){return function(){if(a("seq_error")||a("seq_aborted")||0===arguments.length)return e;var u=t.call(arguments).map(function(e){var t;return n.isSequence(e)?(t={fn:e},l(t),function(n){t.fn.pipe(n)}):e});return e.then(function(){var n=t.call(arguments);u.forEach(function(e){e.apply(r,n)})}),e}}),n.react=function(e){function a(){if(i){var e=i.duplicate();return e.unpause.apply(r,arguments),e}return n().val(function(){throw"Disabled Sequence"})}function u(){i&&(i=null,o.forEach(function(n){n()}),o.length=0)}function l(n){i&&"function"==typeof n&&o.push(n)}var i,o=[];return a.onStream=function(){t.call(arguments).forEach(function(n){n.on("data",a),n.on("error",a)})},a.unStream=function(){t.call(arguments).forEach(function(n){n.removeListener("data",a),n.removeListener("error",a)})},n(function(){e.call(i,a,l)}),i=n().duplicate(),i.stop=u,i},n.extend("runner",function(e,a){return function(){if(a("seq_error")||a("seq_aborted")||0===arguments.length)return e;var u=t.call(arguments),l={};return e.then(function(e){var a,i,o,c=l;l.messages=t.call(arguments,1),a=u.map(function(t){var a=t;return"function"==typeof t&&t.constructor&&"GeneratorFunction"===t.constructor.name?a=t.call(r,c):n.isSequence(t)&&"next"in t||(a=n.iterable().val(t)),n.isSequence(a)&&a.or(function(){e.fail.apply(r,arguments)}),a}),u=null,function s(){var t;i=a.shift();try{o=n.isMessageWrapper(c)&&n.isSequence(i)?i.next.apply(i,c):i.next(c)}catch(u){return e.fail(u)}o.value===l?(a.push(i),c=l,n(s)):(n.isSequence(o.value)||(t=typeof o.value,o.value=null!==o.value&&("object"===t||"function"===t)&&"then"in o.value?n().promise(o.value):n.isMessageWrapper(o.value)?n.apply(r,o.value):"undefined"!=typeof o.value?n(o.value):n()),o.value.val(function(){arguments.length>0&&(c=arguments.length>1?n.messages.apply(r,arguments):arguments[0]),o.done||(c===l?a.push(i):a.unshift(i)),a.length>0?s():"undefined"!=typeof c?n.isMessageWrapper(c)?e.apply(r,c):e(c):e()}).or(function(){i["throw"].apply(i,arguments)}))}()}),e}}),n.extend("toPromise",function(e){return function(){return new Promise(function(a,u){e.val(function(){var e=t.call(arguments);return a.call(r,e.length>1?e:e[0]),n.messages.apply(r,e)}).or(function(){var n=t.call(arguments);u.call(r,n.length>1?n:n[0])})})}}),n.extend("try",function(e,a){return function(){if(a("seq_error")||a("seq_aborted")||0===arguments.length)return e;var u=t.call(arguments).map(function(e){return function(a){var u=t.call(arguments),l=n.apply(r,u.slice(1));l.then(function(){e.apply(r,arguments)}).val(function(){a.apply(r,arguments)}).or(function(){var e=n.messages.apply(r,arguments);a({"catch":e.length>1?e:e[0]})})}});return e.then.apply(r,u),e}}),n.extend("until",function(e,a){return function(){if(a("seq_error")||a("seq_aborted")||0===arguments.length)return e;var u=t.call(arguments).map(function(e){return function a(u){var l=t.call(arguments),i=n.apply(r,l.slice(1));i.then(function(){var n=t.call(arguments);n[0]["break"]=function(){u.fail.apply(r,arguments),i.abort()},e.apply(r,n)}).val(function(){u.apply(r,arguments)}).or(function(){a.apply(r,l)})}});return e.then.apply(r,u),e}}),n.extend("waterfall",function(e,a){return function(){if(a("seq_error")||a("seq_aborted")||0===arguments.length)return e;var u=n.messages();return t.call(arguments).forEach(function(t){e.then(t).val(function(){var e=n.messages.apply(r,arguments);return u.push(e.length>1?e:e[0]),u})}),e}}),n.wrap=function(e,a){function u(n,e){return!n||"undefined"!=typeof window&&n===window||"undefined"!=typeof global&&n===global?e:n}var l,i,o,c;if(a=a&&"object"==typeof a?a:{},a.errfcb&&a.splitcb||a.errfcb&&a.simplecb||a.splitcb&&a.simplecb||"errfcb"in a&&!a.errfcb&&!a.splitcb&&!a.simplecb||a.params_first&&a.params_last)throw Error("Invalid options");return c=a["this"]&&"object"==typeof a["this"]?a["this"]:r,l=a.errfcb||!(a.splitcb||a.simplecb),i=!!a.params_first||!a.params_last&&!("params_first"in a||a.params_first)||"params_last"in a&&!a.params_first&&!a.params_last,o=i?"push":"unshift",l?function(){var r=t.call(arguments),a=u(this,c);return n(function(n){r[o](n.errfcb),e.apply(a,r)})}:a.splitcb?function(){var r=t.call(arguments),a=u(this,c);return n(function(n){r[o](n,n.fail),e.apply(a,r)})}:a.simplecb?function(){var r=t.call(arguments),a=u(this,c);return n(function(n){r[o](n),e.apply(a,r)})}:void 0},n});
src/svg-icons/maps/pin-drop.js
tan-jerene/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsPinDrop = (props) => ( <SvgIcon {...props}> <path d="M18 8c0-3.31-2.69-6-6-6S6 4.69 6 8c0 4.5 6 11 6 11s6-6.5 6-11zm-8 0c0-1.1.9-2 2-2s2 .9 2 2-.89 2-2 2c-1.1 0-2-.9-2-2zM5 20v2h14v-2H5z"/> </SvgIcon> ); MapsPinDrop = pure(MapsPinDrop); MapsPinDrop.displayName = 'MapsPinDrop'; MapsPinDrop.muiName = 'SvgIcon'; export default MapsPinDrop;
src/svg-icons/action/all-out.js
w01fgang/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionAllOut = (props) => ( <SvgIcon {...props}> <path d="M16.21 4.16l4 4v-4zm4 12l-4 4h4zm-12 4l-4-4v4zm-4-12l4-4h-4zm12.95-.95c-2.73-2.73-7.17-2.73-9.9 0s-2.73 7.17 0 9.9 7.17 2.73 9.9 0 2.73-7.16 0-9.9zm-1.1 8.8c-2.13 2.13-5.57 2.13-7.7 0s-2.13-5.57 0-7.7 5.57-2.13 7.7 0 2.13 5.57 0 7.7z"/> </SvgIcon> ); ActionAllOut = pure(ActionAllOut); ActionAllOut.displayName = 'ActionAllOut'; ActionAllOut.muiName = 'SvgIcon'; export default ActionAllOut;
client/src/components/Catch.js
BDiuguid/fantasy-fifa
import React, { Component } from 'react'; class Catch extends Component { state = { hasError: false, }; componentDidCatch(error, info) { this.setState({ hasError: true }); console.log('error'); console.log(error); console.log('info'); console.log(info); } render() { return this.state.hasError ? ( <h1>Something went wrong. Please Refresh the page!</h1> ) : ( this.props.children ); } } export default Catch;
docs/src/pages/demos/buttons/FlatButtons.js
AndriusBil/material-ui
// @flow weak import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import Button from 'material-ui/Button'; import Link from 'docs/src/modules/components/Link'; const styles = theme => ({ button: { margin: theme.spacing.unit, }, }); function doSomething(event) { // eslint-disable-next-line no-console console.log(event.currentTarget.getAttribute('data-something')); } function FlatButtons(props) { const classes = props.classes; return ( <div> <Button className={classes.button}>Default</Button> <Button color="primary" className={classes.button}> Primary </Button> <Button color="accent" className={classes.button}> Accent </Button> <Button color="contrast" className={classes.button}> Contrast </Button> <Button disabled className={classes.button}> Disabled </Button> <Button href="#flat-buttons" className={classes.button}> Link </Button> <Button disabled component={Link} href="/" className={classes.button}> Link disabled </Button> <Button dense className={classes.button}> Dense </Button> <Button className={classes.button} onClick={doSomething} data-something="here I am"> Does something </Button> </div> ); } FlatButtons.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(FlatButtons);
Admin/Layout/DefaultLayout.js
wangmengling/MaoMobxBlog
import React, { Component } from 'react'; import { BrowserRouter as Router, Route, Redirect, Link } from 'react-router-dom' // import {Redirect, Route} from 'react-router'; import Auth from '../Stores/Auth.js' import Header from '../Header/Index' import Footer from '../Footer/Index' import './DefaultLayout.scss' const DefaultLayout = ({ component: Component, ...rest }) => { return ( // call some method/function that will validate if user is logged in <AuthRequiredRoute {...rest} render={matchProps => ( <div className='LayoutRoot'> <div className="LayoutHeader"> <Header /> </div> <div className="LayoutContent"> <div className="columns"> <aside className="column is-2 aside hero is-fullheight is-hidden-mobile"> <div> <div className="main"> {/* <div className="title">家</div> */} <Link to="/admin" className="item active"> <span className="icon"> <i className="fa fa-home"> </i> </span> <span className="name">首页</span> </Link> <Link to="/admin/list" className="item"> <span className="icon"> <i className="fa fa-th-list"></i> </span> <span className="name">列表</span> </Link> </div> </div> </aside> <div className="column is-10 admin-panel"> <Component {...matchProps} /> </div> </div> </div> </div> )} /> ) }; /** * Class representing a route that checks if user is logged in. * @extends Route */ class AuthRequiredRoute extends Route{ /** * @example <AuthRequiredRoute path="/" component={Products}> */ render() { let component = super.render(); let {user, path} = this.props; let match = this.state.match; if (match) { const authStore = new Auth(); if (authStore.isLoggedIn) { return component; } else { return <Redirect to="/admin/login"></Redirect>; } } else { return null; } } isLogin() { let userName = localStorage.getItem(); if(!userName.length > 0) { return true; }else { return false; } } } export default DefaultLayout;
antd-dva/ant-design-pro-demo/test/src/components/AvatarList/index.js
JianmingXia/StudyTest
import React from 'react'; import { Tooltip, Avatar } from 'antd'; import classNames from 'classnames'; import styles from './index.less'; const AvatarList = ({ children, size, ...other }) => { const childrenWithProps = React.Children.map(children, child => React.cloneElement(child, { size, }) ); return ( <div {...other} className={styles.avatarList}> <ul> {childrenWithProps} </ul> </div> ); }; const Item = ({ src, size, tips, onClick = (() => {}) }) => { const cls = classNames(styles.avatarItem, { [styles.avatarItemLarge]: size === 'large', [styles.avatarItemSmall]: size === 'small', [styles.avatarItemMini]: size === 'mini', }); return ( <li className={cls} onClick={onClick} > { tips ? ( <Tooltip title={tips}> <Avatar src={src} size={size} style={{ cursor: 'pointer' }} /> </Tooltip> ) : <Avatar src={src} size={size} /> } </li> ); }; AvatarList.Item = Item; export default AvatarList;
src/ui/components/views/Onboard/CheckedLabel.js
belng/pure
/* @flow */ import React, { Component, PropTypes } from 'react'; import { View, StyleSheet } from 'react-native'; import Icon from '../Core/Icon'; import AppText from '../Core/AppText'; import Colors from '../../../Colors'; const styles = StyleSheet.create({ item: { flexDirection: 'row', alignItems: 'center', marginVertical: 4, }, icon: { height: 20, width: 20, color: Colors.accent, }, label: { color: Colors.darkGrey, marginHorizontal: 8, } }); type Props = { label: string; style?: any; } export default class CheckedLabel extends Component<void, Props, void> { static propTypes = { label: PropTypes.string.isRequired, style: View.propTypes.style, }; render() { return ( <View style={[ styles.item, this.props.style ]}> <Icon size={20} name='done' style={styles.icon} /> <AppText style={styles.label}>{this.props.label}</AppText> </View> ); } }
files/rxjs/2.2.7/rx.js
ajibolam/jsdelivr
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. (function (window, undefined) { var freeExports = typeof exports == 'object' && exports, freeModule = typeof module == 'object' && module && module.exports == freeExports && module, freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal) { window = freeGlobal; } /** * @name Rx * @type Object */ var Rx = { Internals: {} }; // Defaults function noop() { } function identity(x) { return x; } var defaultNow = Date.now; function defaultComparer(x, y) { return isEqual(x, y); } function defaultSubComparer(x, y) { return x - y; } function defaultKeySerializer(x) { return x.toString(); } function defaultError(err) { throw err; } // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } /** Used to determine if values are of the language type Object */ var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch(e) { suportNodeClass = true; } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } function isFunction(value) { return typeof value == 'function'; } // fallback for older versions of Chrome and Safari if (isFunction(/x/)) { isFunction = function(value) { return typeof value == 'function' && toString.call(value) == funcClass; }; } var isEqual = Rx.Internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { var result; // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && !(a && objectTypes[type]) && !(b && objectTypes[otherType])) { return false; } // exit early for `null` and `undefined`, avoiding ES3's Function#call behavior // http://es5.github.io/#x15.3.4.4 if (a == null || b == null) { return a === b; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b // but treat `+0` vs. `-0` as not equal : (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!suportNodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !supportsArgsClass && isArguments(a) ? Object : a.constructor, ctorB = !supportsArgsClass && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !( isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB )) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { length = a.length; size = b.length; // compare lengths to determine if a deep comparison is necessary result = size == a.length; // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } return result; } // deep compare each object for(var key in b) { if (hasOwnProperty.call(b, key)) { // count properties and deep compare each property value size++; return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], b[key], stackA, stackB)); } } if (result) { // ensure both objects have the same number of properties for (var key in a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; /** @private */ var inherits = this.inherits = Rx.Internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; /** @private */ var addProperties = Rx.Internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.Internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; // Collection polyfills function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Collections var IndexedItem = function (id, value) { this.id = id; this.value = value; }; IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); if (c === 0) { c = this.id - other.id; } return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.Internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { if (index === undefined) { index = 0; } if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable. */ CompositeDisposablePrototype.clear = function () { var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } }; /** * Determines whether the CompositeDisposable contains a specific disposable. * @param {Mixed} item Disposable to search for. * @returns {Boolean} true if the disposable was found; otherwise, false. */ CompositeDisposablePrototype.contains = function (item) { return this.disposables.indexOf(item) !== -1; }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; /** * Represents a disposable resource which only allows a single assignment of its underlying disposable resource. * If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error. * * @constructor */ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () { this.isDisposed = false; this.current = null; }; var SingleAssignmentDisposablePrototype = SingleAssignmentDisposable.prototype; /** * Gets the underlying disposable. After disposal, the result of getting this method is undefined. * @returns {Disposable} The underlying disposable. */ SingleAssignmentDisposablePrototype.getDisposable = function () { return this.current; }; /* @private */ SingleAssignmentDisposable.disposable = function (value) { return arguments.length ? this.getDisposable() : this.setDisposable(value); }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ SingleAssignmentDisposablePrototype.setDisposable = function (value) { if (this.current) { throw new Error('Disposable has already been assigned'); } var shouldDispose = this.isDisposed; if (!shouldDispose) { this.current = value; } if (shouldDispose && value) { value.dispose(); } }; /** * Disposes the underlying disposable. */ SingleAssignmentDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } if (old) { old.dispose(); } }; /** * Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. * @constructor */ var SerialDisposable = Rx.SerialDisposable = function () { this.isDisposed = false; this.current = null; }; var serialDisposablePrototype = SerialDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ serialDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ serialDisposablePrototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } if (old) { old.dispose(); } if (shouldDispose && value) { value.dispose(); } }; /* @private */ serialDisposablePrototype.disposable = function (value) { if (!value) { return this.getDisposable(); } else { this.setDisposable(value); } }; /** * Disposes the underlying disposable as well as all future replacements. */ serialDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } if (old) { old.dispose(); } }; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); /** * @constructor * @private */ function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler, this.disposable = disposable, this.isDisposed = false; } /** * @private * @memberOf ScheduledDisposable# */ ScheduledDisposable.prototype.dispose = function () { var parent = this; this.scheduler.schedule(function () { if (!parent.isDisposed) { parent.isDisposed = true; parent.disposable.dispose(); } }); }; var ScheduledItem = Rx.Internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { /** * @constructor * @private */ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchException = schedulerProto['catch'] = function (handler) { return new CatchScheduler(this, handler); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, function () { action(); }); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodicWithState = function (state, period, action) { var s = state, id = window.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { window.clearInterval(id); }); }; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, function (s, p) { return invokeRecImmediate(s, p); }); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, function (_action, self) { _action(function (dt) { self(_action, dt); }); }); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, function (_action, self) { _action(function (dt) { self(_action, dt); }); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { if (timeSpan < 0) { timeSpan = 0; } return timeSpan; }; return Scheduler; }()); var SchedulePeriodicRecursive = Rx.Internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); var schedulerNoBlockError = 'Scheduler is not allowed to block the thread'; /** * Gets a scheduler that schedules work immediately on the current thread. */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { if (dueTime > 0) throw new Error(schedulerNoBlockError); return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function Trampoline() { queue = new PriorityQueue(4); } Trampoline.prototype.dispose = function () { queue = null; }; Trampoline.prototype.run = function () { var item; while (queue.length > 0) { item = queue.dequeue(); if (!item.isCancelled()) { while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } }; function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt), t; if (!queue) { t = new Trampoline(); try { queue.enqueue(si); t.run(); } catch (e) { throw e; } finally { t.dispose(); } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return queue === null; }; currentScheduler.ensureTrampoline = function (action) { if (queue === null) { return this.schedule(action); } else { return action(); } }; return currentScheduler; }()); var scheduleMethod, clearMethod = noop; (function () { function postMessageSupported () { // Ensure not in a worker if (!window.postMessage || window.importScripts) { return false; } var isAsync = false, oldHandler = window.onmessage; // Test for async window.onmessage = function () { isAsync = true; }; window.postMessage('','*'); window.onmessage = oldHandler; return isAsync; } // Check for setImmediate first for Node v0.11+ if (typeof window.setImmediate === 'function') { scheduleMethod = window.setImmediate; clearMethod = clearImmediate; } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (window.addEventListener) { window.addEventListener('message', onGlobalPostMessage, false); } else { window.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; window.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!window.MessageChannel) { var channel = new window.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in window && 'onreadystatechange' in window.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = window.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; window.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return window.setTimeout(action, 0); }; clearMethod = window.clearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = window.setTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { window.clearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** @private */ var CatchScheduler = (function (_super) { function localNow() { return this._scheduler.now(); } function scheduleNow(state, action) { return this._scheduler.scheduleWithState(state, this._wrap(action)); } function scheduleRelative(state, dueTime, action) { return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action)); } function scheduleAbsolute(state, dueTime, action) { return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action)); } inherits(CatchScheduler, _super); /** @private */ function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; _super.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } /** @private */ CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; /** @private */ CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { try { return action(parent._getRecursiveWrapper(self), state); } catch (e) { if (!parent._handler(e)) { throw e; } return disposableEmpty; } }; }; /** @private */ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; /** @private */ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) { if (failed) { return null; } try { return action(state1); } catch (e) { failed = true; if (!self._handler(e)) { throw e; } d.dispose(); return null; } })); return d; }; return CatchScheduler; }(Scheduler)); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } var NotificationPrototype = Notification.prototype; /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) { if (arguments.length === 1 && typeof observerOrOnNext === 'object') { return this._acceptObservable(observerOrOnNext); } return this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notification * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ NotificationPrototype.toObservable = function (scheduler) { var notification = this; scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); if (notification.kind === 'N') { observer.onCompleted(); } }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (exception) { var notification = new Notification('E'); notification.exception = exception; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * @constructor * @private */ var Enumerator = Rx.Internals.Enumerator = function (moveNext, getCurrent, dispose) { this.moveNext = moveNext; this.getCurrent = getCurrent; this.dispose = dispose; }; /** * @static * @memberOf Enumerator * @private */ var enumeratorCreate = Enumerator.create = function (moveNext, getCurrent, dispose) { var done = false; dispose || (dispose = noop); return new Enumerator(function () { if (done) { return false; } var result = moveNext(); if (!result) { done = true; dispose(); } return result; }, function () { return getCurrent(); }, function () { if (!done) { dispose(); done = true; } }); }; /** @private */ var Enumerable = Rx.Internals.Enumerable = (function () { /** * @constructor * @private */ function Enumerable(getEnumerator) { this.getEnumerator = getEnumerator; } /** * @private * @memberOf Enumerable# */ Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e = sources.getEnumerator(), isDisposed = false, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, ex, hasNext = false; if (!isDisposed) { try { hasNext = e.moveNext(); if (hasNext) { current = e.getCurrent(); } else { e.dispose(); } } catch (exception) { ex = exception; e.dispose(); } } else { return; } if (ex) { observer.onError(ex); return; } if (!hasNext) { observer.onCompleted(); return; } var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; e.dispose(); })); }); }; /** * @private * @memberOf Enumerable# */ Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e = sources.getEnumerator(), isDisposed = false, lastException; var subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, ex, hasNext; hasNext = false; if (!isDisposed) { try { hasNext = e.moveNext(); if (hasNext) { current = e.getCurrent(); } } catch (exception) { ex = exception; } } else { return; } if (ex) { observer.onError(ex); return; } if (!hasNext) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; return Enumerable; }()); /** * @static * @private * @memberOf Enumerable */ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount === undefined) { repeatCount = -1; } return new Enumerable(function () { var current, left = repeatCount; return enumeratorCreate(function () { if (left === 0) { return false; } if (left > 0) { left--; } current = value; return true; }, function () { return current; }); }); }; /** * @static * @private * @memberOf Enumerable */ var enumerableFor = Enumerable.forEach = function (source, selector) { selector || (selector = identity); return new Enumerable(function () { var current, index = -1; return enumeratorCreate( function () { if (++index < source.length) { current = selector(source[index], index); return true; } return false; }, function () { return current; } ); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * * @param observer Observer object. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * * @static * @memberOf Observer * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler) { return new AnonymousObserver(function (x) { return handler(notificationCreateOnNext(x)); }, function (exception) { return handler(notificationCreateOnError(exception)); }, function () { return handler(notificationCreateOnCompleted()); }); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.Internals.AbstractObserver = (function (_super) { inherits(AbstractObserver, _super); /** * Creates a new observer in a non-stopped state. * * @constructor */ function AbstractObserver() { this.isStopped = false; _super.call(this); } /** * Notifies the observer of a new element in the sequence. * * @memberOf AbstractObserver * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * * @memberOf AbstractObserver * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (_super) { inherits(AnonymousObserver, _super); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * * @constructor * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { _super.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * * @memberOf AnonymousObserver * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * * @memberOf AnonymousObserver * @param {Any{ error The error that has occurred. */ AnonymousObserver.prototype.error = function (exception) { this._onError(exception); }; /** * Calls the onCompleted action. * * @memberOf AnonymousObserver */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (_super) { inherits(CheckedObserver, _super); function CheckedObserver(observer) { _super.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); try { this._observer.onNext(value); } catch (e) { throw e; } finally { this._state = 0; } }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); try { this._observer.onError(err); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); try { this._observer.onCompleted(); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); /** @private */ var ScheduledObserver = Rx.Internals.ScheduledObserver = (function (_super) { inherits(ScheduledObserver, _super); function ScheduledObserver(scheduler, observer) { _super.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } /** @private */ ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; /** @private */ ScheduledObserver.prototype.error = function (exception) { var self = this; this.queue.push(function () { self.observer.onError(exception); }); }; /** @private */ ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; /** @private */ ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; /** @private */ ScheduledObserver.prototype.dispose = function () { _super.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); /** @private */ var ObserveOnObserver = (function (_super) { inherits(ObserveOnObserver, _super); /** @private */ function ObserveOnObserver() { _super.apply(this, arguments); } /** @private */ ObserveOnObserver.prototype.next = function (value) { _super.prototype.next.call(this, value); this.ensureActive(); }; /** @private */ ObserveOnObserver.prototype.error = function (e) { _super.prototype.error.call(this, e); this.ensureActive(); }; /** @private */ ObserveOnObserver.prototype.completed = function () { _super.prototype.completed.call(this); this.ensureActive(); }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { /** * @constructor * @private */ function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; observableProto.finalValue = function () { var source = this; return new AnonymousObservable(function (observer) { var hasValue = false, value; return source.subscribe(function (x) { hasValue = true; value = x; }, observer.onError.bind(observer), function () { if (!hasValue) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); }; /** * Subscribes an observer to the observable sequence. * * @example * 1 - source.subscribe(); * 2 - source.subscribe(observer); * 3 - source.subscribe(function (x) { console.log(x); }); * 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }); * 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); }); * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { var subscriber; if (typeof observerOrOnNext === 'object') { subscriber = observerOrOnNext; } else { subscriber = observerCreate(observerOrOnNext, onError, onCompleted); } return this._subscribe(subscriber); }; /** * Creates a list from an observable sequence. * * @memberOf Observable * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { function accumulator(list, i) { var newList = list.slice(0); newList.push(i); return newList; } return this.scan([], accumulator).startWith([]).finalValue(); }; return Observable; })(); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(new ObserveOnObserver(scheduler, observer)); }); }; /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(scheduler.schedule(function () { d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer))); })); return d; }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * var res = Rx.Observable.fromArray([1,2,3]); * var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0; return scheduler.scheduleRecursive(function (self) { if (count < array.length) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { scheduler || (scheduler = currentThreadScheduler); if (repeatCount == null) { repeatCount = -1; } return observableReturn(value, scheduler).repeat(repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.returnValue = function (value, scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwException' for browsers <IE9. * * @example * var res = Rx.Observable.throwException(new Error('Error')); * var res = Rx.Observable.throwException(new Error('Error'), Rx.Scheduler.timeout); * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * * @example * var res = Rx.Observable.using(function () { return new AsyncSubject(); }, function (s) { return s; }); * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new AnonymousObservable(function (observer) { var disposable = disposableEmpty, resource, source; try { resource = resourceFactory(); if (resource) { disposable = resource; } source = observableFactory(resource); } catch (exception) { return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable); } return new CompositeDisposable(source.subscribe(observer), disposable); }); }; /** * Propagates the observable sequence that reacts first. * @param {Observable} rightSource Second observable sequence. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } leftSubscription.setDisposable(leftSource.subscribe(function (left) { choiceL(); if (choice === leftChoice) { observer.onNext(left); } }, function (err) { choiceL(); if (choice === leftChoice) { observer.onError(err); } }, function () { choiceL(); if (choice === leftChoice) { observer.onCompleted(); } })); rightSubscription.setDisposable(rightSource.subscribe(function (right) { choiceR(); if (choice === rightChoice) { observer.onNext(right); } }, function (err) { choiceR(); if (choice === rightChoice) { observer.onError(err); } }, function () { choiceR(); if (choice === rightChoice) { observer.onCompleted(); } })); return new CompositeDisposable(leftSubscription, rightSubscription); }); }; /** * Propagates the observable sequence that reacts first. * * @example * var = Rx.Observable.amb(xs, ys, zs); * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items = argsOrArray(arguments, 0); function func(previous, current) { return previous.amb(current); } for (var i = 0, len = items.length; i < len; i++) { acc = func(acc, items[i]); } return acc; }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) { if (typeof handlerOrSecond === 'function') { return observableCatchHandler(this, handlerOrSecond); } return observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.catchException(xs, ys, zs); * 2 - res = Rx.Observable.catchException([xs, ys, zs]); * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = Observable['catch'] = function () { var items = argsOrArray(arguments, 0); return enumerableFor(items).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(args[i].subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * * @example * 1 - res = Rx.Observable.concat(xs, ys, zs); * 2 - res = Rx.Observable.concat([xs, ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { var sources = argsOrArray(arguments, 0); return enumerableFor(sources).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [], subscribe = function (xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { var s; group.remove(subscription); if (q.length > 0) { s = q.shift(); subscribe(s); } else { activeCount--; if (isStopped && activeCount === 0) { observer.onCompleted(); } } })); }; group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; if (activeCount === 0) { observer.onCompleted(); } })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll =function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe(function (x) { observer.onNext(x); }, observer.onError.bind(observer), function () { group.remove(innerSubscription); if (isStopped && group.length === 1) { observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; if (group.length === 1) { observer.onCompleted(); } })); return group; }); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs); * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]); * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var pos = 0, subscription = new SerialDisposable(), cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, d; if (pos < sources.length) { current = sources[pos++]; d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe(observer.onNext.bind(observer), function () { self(); }, function () { self(); })); } else { observer.onCompleted(); } }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable} other The observable sequence that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { if (isOpen) { observer.onNext(left); } }, observer.onError.bind(observer), function () { if (isOpen) { observer.onCompleted(); } })); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe(function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); d.setDisposable(innerSource.subscribe(function (x) { if (latest === id) { observer.onNext(x); } }, function (e) { if (latest === id) { observer.onError(e); } }, function () { if (latest === id) { hasLatest = false; if (isStopped) { observer.onCompleted(); } } })); }, observer.onError.bind(observer), function () { isStopped = true; if (!hasLatest) { observer.onCompleted(); } }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable} other Observable sequence that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); var next = function (i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = slice.call(arguments); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(observer); }); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * * @example * var res = xs.bufferWithCount(10); * var res = xs.bufferWithCount(10, 1); * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = function (count, skip) { if (arguments.length === 1) { skip = count; } return this.windowWithCount(count, skip).selectMany(function (x) { return x.toArray(); }).where(function (x) { return x.length > 0; }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * * @example * var res = observable.doAction(observer); * var res = observable.doAction(onNext); * var res = observable.doAction(onNext, onError); * var res = observable.doAction(onNext, onError, onCompleted); * @param {Mixed} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (exception) { if (!onError) { observer.onError(exception); } else { try { onError(exception); } catch (e) { observer.onError(e); } observer.onError(exception); } }, function () { if (!onCompleted) { observer.onCompleted(); } else { try { onCompleted(); } catch (e) { observer.onError(e); } observer.onCompleted(); } }); }); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * var res = observable.finallyAction(function () { console.log('sequence ended'; }); * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription = source.subscribe(observer); return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * var res = repeated = source.repeat(); * var res = repeated = source.repeat(42); * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(42); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { try { if (!hasValue) { hasValue = true; } if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { if (!hasValue && hasSeed) { observer.onNext(seed); } observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { observer.onNext(q.shift()); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * * @memberOf Observable# * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && 'now' in Object(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableFor([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence, using an optional scheduler to drain the queue. * * @example * var res = source.takeLast(5); * var res = source.takeLast(5, Rx.Scheduler.timeout); * * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @param {Scheduler} [scheduler] Scheduler used to drain the queue upon completion of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count, scheduler) { return this.takeLastBuffer(count).selectMany(function (xs) { return observableFromArray(xs, scheduler); }); }; /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { q.shift(); } }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * * var res = xs.windowWithCount(10); * var res = xs.windowWithCount(10, 1); * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = function (count, skip) { var source = this; if (count <= 0) { throw new Error(argumentOutOfRange); } if (arguments.length === 1) { skip = count; } if (skip <= 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = [], createWindow = function () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); }; createWindow(); m.setDisposable(source.subscribe(function (x) { var s; for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; if (c >= 0 && c % skip === 0) { s = q.shift(); s.onCompleted(); } n++; if (n % skip === 0) { createWindow(); } }, function (exception) { while (q.length > 0) { q.shift().onError(exception); } observer.onError(exception); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); })); return refCountDisposable; }); }; /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; if (defaultValue === undefined) { defaultValue = null; } return new AnonymousObservable(function (observer) { var found = false; return source.subscribe(function (x) { found = true; observer.onNext(x); }, observer.onError.bind(observer), function () { if (!found) { observer.onNext(defaultValue); } observer.onCompleted(); }); }); }; /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (x) { return x.toString(); }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, keySerializer) { var source = this; keySelector || (keySelector = identity); keySerializer || (keySerializer = defaultKeySerializer); return new AnonymousObservable(function (observer) { var hashSet = {}; return source.subscribe(function (x) { var key, serializedKey, otherKey, hasMatch = false; try { key = keySelector(x); serializedKey = keySerializer(key); } catch (exception) { observer.onError(exception); return; } for (otherKey in hashSet) { if (serializedKey === otherKey) { hasMatch = true; break; } } if (!hasMatch) { hashSet[serializedKey] = null; observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. * * @example * var res = observable.groupBy(function (x) { return x.id; }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} [elementSelector] A function to map each source element to an element in an observable group. * @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison. * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. */ observableProto.groupBy = function (keySelector, elementSelector, keySerializer) { return this.groupByUntil(keySelector, elementSelector, function () { return observableNever(); }, keySerializer); }; /** * Groups the elements of an observable sequence according to a specified key selector function. * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. * * @example * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} durationSelector A function to signal the expiration of a group. * @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison. * @returns {Observable} * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. * */ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, keySerializer) { var source = this; elementSelector || (elementSelector = identity); keySerializer || (keySerializer = defaultKeySerializer); return new AnonymousObservable(function (observer) { var map = {}, groupDisposable = new CompositeDisposable(), refCountDisposable = new RefCountDisposable(groupDisposable); groupDisposable.add(source.subscribe(function (x) { var duration, durationGroup, element, fireNewMapEntry, group, key, serializedKey, md, writer, w; try { key = keySelector(x); serializedKey = keySerializer(key); } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } fireNewMapEntry = false; try { writer = map[serializedKey]; if (!writer) { writer = new Subject(); map[serializedKey] = writer; fireNewMapEntry = true; } } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } if (fireNewMapEntry) { group = new GroupedObservable(key, writer, refCountDisposable); durationGroup = new GroupedObservable(key, writer); try { duration = durationSelector(durationGroup); } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } observer.onNext(group); md = new SingleAssignmentDisposable(); groupDisposable.add(md); var expire = function () { if (serializedKey in map) { delete map[serializedKey]; writer.onCompleted(); } groupDisposable.remove(md); }; md.setDisposable(duration.take(1).subscribe(noop, function (exn) { for (w in map) { map[w].onError(exn); } observer.onError(exn); }, function () { expire(); })); } try { element = elementSelector(x); } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } writer.onNext(element); }, function (ex) { for (var w in map) { map[w].onError(ex); } observer.onError(ex); }, function () { for (var w in map) { map[w].onCompleted(); } observer.onCompleted(); })); return refCountDisposable; }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} property The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (property) { return this.select(function (x) { return x[property]; }); }; function selectMany(selector) { return this.select(selector).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector) { if (resultSelector) { return this.selectMany(function (x) { return selector(x).select(function (y) { return resultSelector(x, y); }); }); } if (typeof selector === 'function') { return selectMany.call(this, selector); } return selectMany.call(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } if (running) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new Error(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining > 0) { remaining--; observer.onNext(x); if (remaining === 0) { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * * @example * var res = source.takeWhile(function (value) { return value < 10; }); * var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } if (shouldRun) { observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; var AnonymousObservable = Rx.Internals.AnonymousObservable = (function (_super) { inherits(AnonymousObservable, _super); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (typeof subscriber === 'undefined') { subscriber = disposableEmpty; } else if (typeof subscriber === 'function') { subscriber = disposableCreate(subscriber); } return subscriber; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }); } else { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } } return autoDetachObserver; } _super.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var GroupedObservable = (function (_super) { inherits(GroupedObservable, _super); function subscribe(observer) { return this.underlyingObservable.subscribe(observer); } /** * @constructor * @private */ function GroupedObservable(key, underlyingObservable, mergedDisposable) { _super.call(this, subscribe); this.key = key; this.underlyingObservable = !mergedDisposable ? underlyingObservable : new AnonymousObservable(function (observer) { return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer)); }); } return GroupedObservable; }(Observable)); /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception; var hv = this.hasValue; var v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, _super); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.value = null, this.hasValue = false, this.observers = [], this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; var v = this.value; var hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; this.hasValue = true; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); /** @private */ var AnonymousSubject = (function (_super) { inherits(AnonymousSubject, _super); function subscribe(observer) { return this.observable.subscribe(observer); } /** * @private * @constructor */ function AnonymousSubject(observer, observable) { _super.call(this, subscribe); this.observer = observer; this.observable = observable; } addProperties(AnonymousSubject.prototype, Observer, { /** * @private * @memberOf AnonymousSubject# */ onCompleted: function () { this.observer.onCompleted(); }, /** * @private * @memberOf AnonymousSubject# */ onError: function (exception) { this.observer.onError(exception); }, /** * @private * @memberOf AnonymousSubject# */ onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); // Check for AMD if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { window.Rx = Rx; return define(function () { return Rx; }); } else if (freeExports) { if (typeof module == 'object' && module && module.exports == freeExports) { module.exports = Rx; } else { freeExports = Rx; } } else { window.Rx = Rx; } }(this));
test/components/Counter.spec.js
alexdibattista/no-noise
import { spy } from 'sinon'; import React from 'react'; import { shallow } from 'enzyme'; import { BrowserRouter as Router } from 'react-router-dom'; import renderer from 'react-test-renderer'; import Counter from '../../app/components/Counter'; function setup() { const actions = { increment: spy(), incrementIfOdd: spy(), incrementAsync: spy(), decrement: spy() }; const component = shallow(<Counter counter={1} {...actions} />); return { component, actions, buttons: component.find('button'), p: component.find('.counter') }; } describe('Counter component', () => { it('should should display count', () => { const { p } = setup(); expect(p.text()).toMatch(/^1$/); }); it('should first button should call increment', () => { const { buttons, actions } = setup(); buttons.at(0).simulate('click'); expect(actions.increment.called).toBe(true); }); it('should match exact snapshot', () => { const { actions } = setup(); const tree = renderer .create( <div> <Router> <Counter counter={1} {...actions} /> </Router> </div> ) .toJSON(); expect(tree).toMatchSnapshot(); }); it('should second button should call decrement', () => { const { buttons, actions } = setup(); buttons.at(1).simulate('click'); expect(actions.decrement.called).toBe(true); }); it('should third button should call incrementIfOdd', () => { const { buttons, actions } = setup(); buttons.at(2).simulate('click'); expect(actions.incrementIfOdd.called).toBe(true); }); it('should fourth button should call incrementAsync', () => { const { buttons, actions } = setup(); buttons.at(3).simulate('click'); expect(actions.incrementAsync.called).toBe(true); }); });
src/Drawer/TemporaryDrawer/Content.js
gutenye/react-mc
// @flow import React from 'react' import cx from 'classnames' import type { PropsC } from '../../types' class Content extends React.Component { props: PropsC static defaultProps = { component: 'div', } static displayName = 'Drawer.Temporary.Content' render() { const { component: Component, className, ...rest } = this.props const rootClassName = cx('mdc-temporary-drawer__content', className) return <Component className={rootClassName} {...rest} /> } } export default Content
ajax/libs/inferno-router/3.4.2/inferno-router.js
jonobr1/cdnjs
/*! * Inferno.Router v3.4.2 * (c) 2017 Dominic Gannaway' * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('inferno-create-element'), require('inferno-component'), require('inferno'), require('path-to-regexp')) : typeof define === 'function' && define.amd ? define(['exports', 'inferno-create-element', 'inferno-component', 'inferno', 'path-to-regexp'], factory) : (factory((global.Inferno = global.Inferno || {}, global.Inferno.Router = global.Inferno.Router || {}),global.Inferno.createElement,global.Inferno.Component,global.Inferno)); }(this, (function (exports,createElement,Component,Inferno) { 'use strict'; createElement = 'default' in createElement ? createElement['default'] : createElement; Component = 'default' in Component ? Component['default'] : Component; var Inferno__default = 'default' in Inferno ? Inferno['default'] : Inferno; // This should be boolean and not reference to window.document var isBrowser = !!(typeof window !== 'undefined' && window.document); function toArray(children) { return isArray(children) ? children : (children ? [children] : children); } // this is MUCH faster than .constructor === Array and instanceof Array // in Node 7 and the later versions of V8, slower in older versions though var isArray = Array.isArray; function isString(o) { return typeof o === 'string'; } function warning(message) { // tslint:disable-next-line:no-console console.warn(message); } function combineFrom(first, second) { var out = {}; if (first) { for (var key in first) { out[key] = first[key]; } } if (second) { for (var key$1 in second) { out[key$1] = second[key$1]; } } return out; } var emptyObject = {}; function decode(val) { return typeof val !== 'string' ? val : decodeURIComponent(val); } function isEmpty(children) { return !children || !(isArray(children) ? children : Object.keys(children)).length; } function flatten(oldArray) { var newArray = []; flattenArray(oldArray, newArray); return newArray; } function getURLString(location) { return isString(location) ? location : (location.pathname + location.search); } /** * Maps a querystring to an object * Supports arrays and utf-8 characters * @param search * @returns {any} */ function mapSearchParams(search) { if (search === '') { return {}; } // Create an object with no prototype var map = Object.create(null); var fragments = search.split('&'); for (var i = 0, len = fragments.length; i < len; i++) { var fragment = fragments[i]; var ref = fragment.split('=').map(mapFragment).map(decodeURIComponent); var k = ref[0]; var v = ref[1]; if (map[k]) { map[k] = isArray(map[k]) ? map[k] : [map[k]]; map[k].push(v); } else { map[k] = v; } } return map; } /** * Gets the relevant part of the URL for matching * @param fullURL * @param partURL * @returns {string} */ function toPartialURL(fullURL, partURL) { if (fullURL.indexOf(partURL) === 0) { return fullURL.substr(partURL.length); } return fullURL; } /** * Simulates ... operator by returning first argument * with the keys in the second argument excluded * @param _args * @param excluded * @returns {{}} */ function rest(_args, excluded) { var t = {}; for (var p in _args) { if (excluded.indexOf(p) < 0) { t[p] = _args[p]; } } return t; } /** * Sorts an array according to its `path` prop length * @param a * @param b * @returns {number} */ function pathRankSort(a, b) { var aAttr = a.props || emptyObject; var bAttr = b.props || emptyObject; var diff = rank(bAttr.path) - rank(aAttr.path); return diff || ((bAttr.path && aAttr.path) ? (bAttr.path.length - aAttr.path.length) : 0); } /** * Helper function for parsing querystring arrays */ function mapFragment(p, isVal) { return decodeURIComponent(isVal | 0 ? p : p.replace('[]', '')); } function strip(url) { return url.replace(/(^\/+|\/+$)/g, ''); } function rank(url) { if ( url === void 0 ) url = ''; return (strip(url).match(/\/+/g) || '').length; } function flattenArray(oldArray, newArray) { for (var i = 0, len = oldArray.length; i < len; i++) { var item = oldArray[i]; if (isArray(item)) { flattenArray(item, newArray); } else { newArray.push(item); } } } var resolvedPromise = Promise.resolve(); var Route = (function (Component$$1) { function Route(props, context) { var this$1 = this; Component$$1.call(this, props, context); this._onComponentResolved = function (error, component) { this$1.setState({ asyncComponent: component }); }; this.state = { asyncComponent: null }; } if ( Component$$1 ) Route.__proto__ = Component$$1; Route.prototype = Object.create( Component$$1 && Component$$1.prototype ); Route.prototype.constructor = Route; Route.prototype.componentWillMount = function componentWillMount () { var this$1 = this; var ref = this.props; var onEnter = ref.onEnter; var ref$1 = this.context; var router = ref$1.router; if (onEnter) { resolvedPromise.then(function () { onEnter({ props: this$1.props, router: router }); }); } var ref$2 = this.props; var getComponent = ref$2.getComponent; if (getComponent) { resolvedPromise.then(function () { getComponent({ props: this$1.props, router: router }, this$1._onComponentResolved); }); } }; Route.prototype.onLeave = function onLeave (trigger) { if ( trigger === void 0 ) trigger = false; var ref = this.props; var onLeave = ref.onLeave; var ref$1 = this.context; var router = ref$1.router; if (onLeave && trigger) { onLeave({ props: this.props, router: router }); } }; Route.prototype.onEnter = function onEnter (nextProps) { var onEnter = nextProps.onEnter; var ref = this.context; var router = ref.router; if (this.props.path !== nextProps.path && onEnter) { onEnter({ props: nextProps, router: router }); } }; Route.prototype.getComponent = function getComponent (nextProps) { var getComponent = nextProps.getComponent; var ref = this.context; var router = ref.router; if (this.props.path !== nextProps.path && getComponent) { getComponent({ props: nextProps, router: router }, this._onComponentResolved); } }; Route.prototype.componentWillUnmount = function componentWillUnmount () { this.onLeave(true); }; Route.prototype.componentWillReceiveProps = function componentWillReceiveProps (nextProps) { this.getComponent(nextProps); this.onEnter(nextProps); this.onLeave(this.props.path !== nextProps.path); }; Route.prototype.render = function render (_args) { var component = _args.component; var children = _args.children; var props = rest(_args, ['component', 'children', 'path', 'getComponent']); var ref = this.state; var asyncComponent = ref.asyncComponent; var resolvedComponent = component || asyncComponent; if (!resolvedComponent) { return !isArray(children) ? children : null; } return createElement(resolvedComponent, props, children); }; return Route; }(Component)); /** * Helper function for parsing plain route configurations * based on react-router createRoutes handler. * * currently supported keys: * - path * - component * - childRoutes * - indexRoute * * Usage example: * const routes = createRoutes([ * { * path : '/', * component : App, * indexRoute : { * component : Home, * }, * childRoutes : [ * { * path : 'films/', * component : Films, * childRoutes : { * path : 'detail/:id', * component : FilmDetail, * } * }, * { * path : '/*', * component : NoMatch * } * ] * } * ]); * * Usage on Router JSX * <Router history={browserHistory} children={routes} /> */ var handleIndexRoute = function (indexRouteNode) { return createElement(Route, indexRouteNode); }; var handleChildRoute = function (childRouteNode) { return handleRouteNode(childRouteNode); }; var handleChildRoutes = function (childRouteNodes) { return childRouteNodes.map(handleChildRoute); }; function handleRouteNode(routeConfigNode) { if (routeConfigNode.indexRoute && !routeConfigNode.childRoutes) { return createElement(Route, routeConfigNode); } // create deep copy of config var node = {}; for (var key in routeConfigNode) { node[key] = routeConfigNode[key]; } node.children = []; // handle index route config if (node.indexRoute) { node.children.push(handleIndexRoute(node.indexRoute)); delete node.indexRoute; } // handle child routes config if (node.childRoutes) { var nodes = isArray(node.childRoutes) ? node.childRoutes : [node.childRoutes]; (ref = node.children).push.apply(ref, handleChildRoutes(nodes)); delete node.childRoutes; } // cleanup to match native rendered result if (node.children.length === 1) { node.children = node.children[0]; } if ((isArray(node.children) && node.children.length === 0) || (!isArray(node.children) && Object.keys(node.children).length === 0)) { delete node.children; } return createElement(Route, node); var ref; } var createRoutes = function (routeConfig) { return routeConfig.map(handleRouteNode); }; var __rest = (undefined && undefined.__rest) || function (s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) { t[p] = s[p]; } } if (s != null && typeof Object.getOwnPropertySymbols === "function") { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0) { t[p[i]] = s[p[i]]; } } } return t; }; function renderLink(classNm, children, otherProps) { return Inferno.createVNode(2 /* HtmlElement */, 'a', classNm, children, otherProps); } function Link(props, ref) { var router = ref.router; var activeClassName = props.activeClassName; var activeStyle = props.activeStyle; var className = props.className; var onClick = props.onClick; var children = props.children; var to = props.to; var otherProps = __rest(props, ["activeClassName", "activeStyle", "className", "onClick", "children", "to"]); var classNm; if (className) { classNm = className; } if (!router) { { warning('<Link/> component used outside of <Router/>. Fallback to <a> tag.'); } otherProps.href = to; otherProps.onClick = onClick; return renderLink(classNm, children, otherProps); } otherProps.href = isBrowser ? router.createHref({ pathname: to }) : router.location.baseUrl ? router.location.baseUrl + to : to; if (router.location.pathname === to) { if (activeClassName) { classNm = (className ? className + ' ' : '') + activeClassName; } if (activeStyle) { otherProps.style = combineFrom(props.style, activeStyle); } } otherProps.onclick = function navigate(e) { if (e.button !== 0 || e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) { return; } e.preventDefault(); if (typeof onClick === 'function') { onClick(e); } router.push(to, e.target.textContent); }; return renderLink(classNm, children, otherProps); } function IndexLink(props) { props.to = '/'; return Inferno.createVNode(8 /* ComponentFunction */, Link, null, null, props); } var IndexRoute = (function (Route$$1) { function IndexRoute(props, context) { Route$$1.call(this, props, context); props.path = '/'; } if ( Route$$1 ) IndexRoute.__proto__ = Route$$1; IndexRoute.prototype = Object.create( Route$$1 && Route$$1.prototype ); IndexRoute.prototype.constructor = IndexRoute; return IndexRoute; }(Route)); function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var index$5 = Array.isArray || function (arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; /** * Expose `pathToRegexp`. */ var index$2 = pathToRegexp$1; var parse_1 = parse; var compile_1 = compile; var tokensToFunction_1 = tokensToFunction; var tokensToRegExp_1 = tokensToRegExp; /** * The main path matching regexp utility. * * @type {RegExp} */ var PATH_REGEXP = new RegExp([ // Match escaped characters that would otherwise appear in future matches. // This allows the user to escape special characters that won't transform. '(\\\\.)', // Match Express-style parameters and un-named parameters with a prefix // and optional suffixes. Matches appear as: // // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' ].join('|'), 'g'); /** * Parse a string for the raw tokens. * * @param {string} str * @param {Object=} options * @return {!Array} */ function parse (str, options) { var tokens = []; var key = 0; var index = 0; var path = ''; var defaultDelimiter = options && options.delimiter || '/'; var res; while ((res = PATH_REGEXP.exec(str)) != null) { var m = res[0]; var escaped = res[1]; var offset = res.index; path += str.slice(index, offset); index = offset + m.length; // Ignore already escaped sequences. if (escaped) { path += escaped[1]; continue } var next = str[index]; var prefix = res[2]; var name = res[3]; var capture = res[4]; var group = res[5]; var modifier = res[6]; var asterisk = res[7]; // Push the current path onto the tokens. if (path) { tokens.push(path); path = ''; } var partial = prefix != null && next != null && next !== prefix; var repeat = modifier === '+' || modifier === '*'; var optional = modifier === '?' || modifier === '*'; var delimiter = res[2] || defaultDelimiter; var pattern = capture || group; tokens.push({ name: name || key++, prefix: prefix || '', delimiter: delimiter, optional: optional, repeat: repeat, partial: partial, asterisk: !!asterisk, pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') }); } // Match any characters still remaining. if (index < str.length) { path += str.substr(index); } // If the path exists, push it onto the end. if (path) { tokens.push(path); } return tokens } /** * Compile a string to a template function for the path. * * @param {string} str * @param {Object=} options * @return {!function(Object=, Object=)} */ function compile (str, options) { return tokensToFunction(parse(str, options)) } /** * Prettier encoding of URI path segments. * * @param {string} * @return {string} */ function encodeURIComponentPretty (str) { return encodeURI(str).replace(/[\/?#]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } /** * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. * * @param {string} * @return {string} */ function encodeAsterisk (str) { return encodeURI(str).replace(/[?#]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } /** * Expose a method for transforming tokens into the path function. */ function tokensToFunction (tokens) { // Compile all the tokens into regexps. var matches = new Array(tokens.length); // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$'); } } return function (obj, opts) { var path = ''; var data = obj || {}; var options = opts || {}; var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (typeof token === 'string') { path += token; continue } var value = data[token.name]; var segment; if (value == null) { if (token.optional) { // Prepend partial segment prefixes. if (token.partial) { path += token.prefix; } continue } else { throw new TypeError('Expected "' + token.name + '" to be defined') } } if (index$5(value)) { if (!token.repeat) { throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') } if (value.length === 0) { if (token.optional) { continue } else { throw new TypeError('Expected "' + token.name + '" to not be empty') } } for (var j = 0; j < value.length; j++) { segment = encode(value[j]); if (!matches[i].test(segment)) { throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') } path += (j === 0 ? token.prefix : token.delimiter) + segment; } continue } segment = token.asterisk ? encodeAsterisk(value) : encode(value); if (!matches[i].test(segment)) { throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') } path += token.prefix + segment; } return path } } /** * Escape a regular expression string. * * @param {string} str * @return {string} */ function escapeString (str) { return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') } /** * Escape the capturing group by escaping special characters and meaning. * * @param {string} group * @return {string} */ function escapeGroup (group) { return group.replace(/([=!:$\/()])/g, '\\$1') } /** * Attach the keys as a property of the regexp. * * @param {!RegExp} re * @param {Array} keys * @return {!RegExp} */ function attachKeys (re, keys) { re.keys = keys; return re } /** * Get the flags for a regexp from the options. * * @param {Object} options * @return {string} */ function flags (options) { return options.sensitive ? '' : 'i' } /** * Pull out keys from a regexp. * * @param {!RegExp} path * @param {!Array} keys * @return {!RegExp} */ function regexpToRegexp (path, keys) { // Use a negative lookahead to match only capturing groups. var groups = path.source.match(/\((?!\?)/g); if (groups) { for (var i = 0; i < groups.length; i++) { keys.push({ name: i, prefix: null, delimiter: null, optional: false, repeat: false, partial: false, asterisk: false, pattern: null }); } } return attachKeys(path, keys) } /** * Transform an array into a regexp. * * @param {!Array} path * @param {Array} keys * @param {!Object} options * @return {!RegExp} */ function arrayToRegexp (path, keys, options) { var parts = []; for (var i = 0; i < path.length; i++) { parts.push(pathToRegexp$1(path[i], keys, options).source); } var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); return attachKeys(regexp, keys) } /** * Create a path regexp from string input. * * @param {string} path * @param {!Array} keys * @param {!Object} options * @return {!RegExp} */ function stringToRegexp (path, keys, options) { return tokensToRegExp(parse(path, options), keys, options) } /** * Expose a function for taking tokens and returning a RegExp. * * @param {!Array} tokens * @param {(Array|Object)=} keys * @param {Object=} options * @return {!RegExp} */ function tokensToRegExp (tokens, keys, options) { if (!index$5(keys)) { options = /** @type {!Object} */ (keys || options); keys = []; } options = options || {}; var strict = options.strict; var end = options.end !== false; var route = ''; // Iterate over the tokens and create our regexp string. for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (typeof token === 'string') { route += escapeString(token); } else { var prefix = escapeString(token.prefix); var capture = '(?:' + token.pattern + ')'; keys.push(token); if (token.repeat) { capture += '(?:' + prefix + capture + ')*'; } if (token.optional) { if (!token.partial) { capture = '(?:' + prefix + '(' + capture + '))?'; } else { capture = prefix + '(' + capture + ')?'; } } else { capture = prefix + '(' + capture + ')'; } route += capture; } } var delimiter = escapeString(options.delimiter || '/'); var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; // In non-strict mode we allow a slash at the end of match. If the path to // match already ends with a slash, we remove it for consistency. The slash // is valid at the end of a path match, not in the middle. This is important // in non-ending mode, where "/test/" shouldn't match "/test//route". if (!strict) { route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'; } if (end) { route += '$'; } else { // In non-ending mode, we need the capturing groups to match as much as // possible by using a positive lookahead to the end or next path segment. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'; } return attachKeys(new RegExp('^' + route, flags(options)), keys) } /** * Normalize the given path string, returning a regular expression. * * An empty array can be passed in for the keys, which will hold the * placeholder key descriptions. For example, using `/user/:id`, `keys` will * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. * * @param {(string|RegExp|Array)} path * @param {(Array|Object)=} keys * @param {Object=} options * @return {!RegExp} */ function pathToRegexp$1 (path, keys, options) { if (!index$5(keys)) { options = /** @type {!Object} */ (keys || options); keys = []; } options = options || {}; if (path instanceof RegExp) { return regexpToRegexp(path, /** @type {!Array} */ (keys)) } if (index$5(path)) { return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) } return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) } index$2.parse = parse_1; index$2.compile = compile_1; index$2.tokensToFunction = tokensToFunction_1; index$2.tokensToRegExp = tokensToRegExp_1; var index$4 = Object.freeze({ default: index$2, __moduleExports: index$2, parse: parse_1, compile: compile_1, tokensToFunction: tokensToFunction_1, tokensToRegExp: tokensToRegExp_1 }); var pathToRegExp$1 = ( index$4 && index$2 ) || index$4; var index$1 = createCommonjsModule(function (module) { /** * Expose `pathToRegexp` as ES6 module */ module.exports = pathToRegExp$1; module.exports.parse = pathToRegExp$1.parse; module.exports.compile = pathToRegExp$1.compile; module.exports.tokensToFunction = pathToRegExp$1.tokensToFunction; module.exports.tokensToRegExp = pathToRegExp$1.tokensToRegExp; module.exports['default'] = module.exports; }); var cache = new Map(); /** * Returns a node containing only the matched components * @param routes * @param currentURL * @returns {*} */ function match(routes, currentURL) { var location = getURLString(currentURL); return matchRoutes(toArray(routes), encodeURI(location), '/'); } /** * Go through every route and create a new node * with the matched components * @param _routes * @param currentURL * @param parentPath * @param redirect * @returns {object} */ function matchRoutes(_routes, currentURL, parentPath, redirect) { if ( currentURL === void 0 ) currentURL = '/'; if ( parentPath === void 0 ) parentPath = '/'; if ( redirect === void 0 ) redirect = false; var routes = isArray(_routes) ? flatten(_routes) : toArray(_routes); var ref = currentURL.split('?'); var pathToMatch = ref[0]; if ( pathToMatch === void 0 ) pathToMatch = '/'; var search = ref[1]; if ( search === void 0 ) search = ''; var params = mapSearchParams(search); routes.sort(pathRankSort); for (var i = 0, len = routes.length; i < len; i++) { var route = routes[i]; var props = route.props || emptyObject; var routePath = props.from || props.path || '/'; var location = parentPath + toPartialURL(routePath, parentPath).replace(/\/\//g, '/'); var isLast = isEmpty(props.children); var matchBase = matchPath(isLast, location, pathToMatch); if (matchBase) { var children = props.children; if (props.from) { redirect = props.to; } if (children) { var matchChild = matchRoutes(children, currentURL, location, redirect); if (matchChild) { if (matchChild.redirect) { return { location: location, redirect: matchChild.redirect }; } children = matchChild.matched; var childProps = children.props.params; for (var key in childProps) { params[key] = childProps[key]; } } else { children = null; } } var matched = Inferno__default.cloneVNode(route, { children: children, params: combineFrom(params, matchBase.params) }); return { location: location, matched: matched, redirect: redirect }; } } } /** * Converts path to a regex, if a match is found then we extract params from it * @param end * @param routePath * @param pathToMatch * @returns {any} */ function matchPath(end, routePath, pathToMatch) { var key = routePath + "|" + end; var regexp = cache.get(key); if (regexp === void 0) { var keys = []; regexp = { pattern: index$1(routePath, keys, { end: end }), keys: keys }; cache.set(key, regexp); } var m = regexp.pattern.exec(pathToMatch); if (!m) { return null; } var path = m[0]; var params = Object.create(null); for (var i = 1, len = m.length; i < len; i += 1) { params[regexp.keys[i - 1].name] = decode(m[i]); } return { params: params, path: path === '' ? '/' : path }; } var Redirect = (function (Route$$1) { function Redirect(props, context) { Route$$1.call(this, props, context); if (!props.to) { props.to = '/'; } } if ( Route$$1 ) Redirect.__proto__ = Route$$1; Redirect.prototype = Object.create( Route$$1 && Route$$1.prototype ); Redirect.prototype.constructor = Redirect; return Redirect; }(Route)); var RouterContext = (function (Component$$1) { function RouterContext(props, context) { Component$$1.call(this, props, context); { if (!props.location || !props.matched) { throw new TypeError('"inferno-router" requires a "location" and "matched" props passed'); } } } if ( Component$$1 ) RouterContext.__proto__ = Component$$1; RouterContext.prototype = Object.create( Component$$1 && Component$$1.prototype ); RouterContext.prototype.constructor = RouterContext; RouterContext.prototype.getChildContext = function getChildContext () { return { router: this.props.router || { location: { baseUrl: this.props.baseUrl, pathname: this.props.location } } }; }; RouterContext.prototype.render = function render (props) { return props.matched; }; return RouterContext; }(Component)); function createrRouter(history) { if (!history) { throw new TypeError('Inferno: Error "inferno-router" requires a history prop passed'); } return { createHref: history.createHref, listen: history.listen, push: history.push, replace: history.replace, isActive: function isActive(url) { return matchPath(true, url, this.url); }, get location() { return history.location.pathname !== 'blank' ? history.location : { pathname: '/', search: '' }; }, get url() { return this.location.pathname + this.location.search; } }; } var Router = (function (Component$$1) { function Router(props, context) { Component$$1.call(this, props, context); this.router = createrRouter(props.history); this.state = { url: props.url || this.router.url }; } if ( Component$$1 ) Router.__proto__ = Component$$1; Router.prototype = Object.create( Component$$1 && Component$$1.prototype ); Router.prototype.constructor = Router; Router.prototype.componentWillMount = function componentWillMount () { var this$1 = this; if (this.router) { this.unlisten = this.router.listen(function () { this$1.routeTo(this$1.router.url); }); } }; Router.prototype.componentWillReceiveProps = function componentWillReceiveProps (nextProps) { var this$1 = this; this.setState({ url: nextProps.url }, this.props.onUpdate ? function () { return this$1.props.onUpdate(); } : void 0); }; Router.prototype.componentWillUnmount = function componentWillUnmount () { if (this.unlisten) { this.unlisten(); } }; Router.prototype.routeTo = function routeTo (url) { var this$1 = this; this.setState({ url: url }, this.props.onUpdate ? function () { return this$1.props.onUpdate(); } : void 0); }; Router.prototype.render = function render (props) { var this$1 = this; var hit = match(props.children, this.state.url); if (hit.redirect) { setTimeout(function () { this$1.router.replace(hit.redirect); }, 0); return null; } return Inferno.createVNode(4 /* ComponentClass */, RouterContext, null, null, { location: this.state.url, matched: hit.matched, router: this.router }); }; return Router; }(Component)); var index = { IndexLink: IndexLink, IndexRedirect: Redirect, IndexRoute: IndexRoute, Link: Link, Redirect: Redirect, Route: Route, Router: Router, RouterContext: RouterContext, createRoutes: createRoutes, match: match }; exports.IndexLink = IndexLink; exports.IndexRedirect = Redirect; exports.IndexRoute = IndexRoute; exports.Link = Link; exports.Redirect = Redirect; exports.Route = Route; exports.Router = Router; exports.RouterContext = RouterContext; exports.createRoutes = createRoutes; exports.match = match; exports['default'] = index; Object.defineProperty(exports, '__esModule', { value: true }); })));
src/components/common/svg-icons/image/panorama-horizontal.js
abzfarah/Pearson.NAPLAN.GnomeH
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImagePanoramaHorizontal = (props) => ( <SvgIcon {...props}> <path d="M20 6.54v10.91c-2.6-.77-5.28-1.16-8-1.16-2.72 0-5.4.39-8 1.16V6.54c2.6.77 5.28 1.16 8 1.16 2.72.01 5.4-.38 8-1.16M21.43 4c-.1 0-.2.02-.31.06C18.18 5.16 15.09 5.7 12 5.7c-3.09 0-6.18-.55-9.12-1.64-.11-.04-.22-.06-.31-.06-.34 0-.57.23-.57.63v14.75c0 .39.23.62.57.62.1 0 .2-.02.31-.06 2.94-1.1 6.03-1.64 9.12-1.64 3.09 0 6.18.55 9.12 1.64.11.04.21.06.31.06.33 0 .57-.23.57-.63V4.63c0-.4-.24-.63-.57-.63z"/> </SvgIcon> ); ImagePanoramaHorizontal = pure(ImagePanoramaHorizontal); ImagePanoramaHorizontal.displayName = 'ImagePanoramaHorizontal'; ImagePanoramaHorizontal.muiName = 'SvgIcon'; export default ImagePanoramaHorizontal;
src/Portal.js
simonliubo/react-ui
import React from 'react'; import CustomPropTypes from './utils/CustomPropTypes'; import domUtils from './utils/domUtils'; let Portal = React.createClass({ displayName: 'Portal', propTypes: { /** * The DOM Node that the Component will render it's children into */ container: CustomPropTypes.mountable }, componentDidMount() { this._renderOverlay(); }, componentDidUpdate() { this._renderOverlay(); }, componentWillUnmount() { this._unrenderOverlay(); this._unmountOverlayTarget(); }, _mountOverlayTarget() { if (!this._overlayTarget) { this._overlayTarget = document.createElement('div'); this.getContainerDOMNode() .appendChild(this._overlayTarget); } }, _unmountOverlayTarget() { if (this._overlayTarget) { this.getContainerDOMNode() .removeChild(this._overlayTarget); this._overlayTarget = null; } }, _renderOverlay() { let overlay = !this.props.children ? null : React.Children.only(this.props.children); // Save reference for future access. if (overlay !== null) { this._mountOverlayTarget(); this._overlayInstance = React.render(overlay, this._overlayTarget); } else { // Unrender if the component is null for transitions to null this._unrenderOverlay(); this._unmountOverlayTarget(); } }, _unrenderOverlay() { if (this._overlayTarget) { React.unmountComponentAtNode(this._overlayTarget); this._overlayInstance = null; } }, render() { return null; }, getOverlayDOMNode() { if (!this.isMounted()) { throw new Error('getOverlayDOMNode(): A component must be mounted to have a DOM node.'); } if (this._overlayInstance) { if (this._overlayInstance.getWrappedDOMNode) { return this._overlayInstance.getWrappedDOMNode(); } else { return React.findDOMNode(this._overlayInstance); } } return null; }, getContainerDOMNode() { return React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; } }); export default Portal;
src/components/Html/Html.js
AndreyPristupa/join.myadcenter
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React, { Component, PropTypes } from 'react'; import { googleAnalyticsId } from '../../config'; class Html extends Component { static propTypes = { title: PropTypes.string, description: PropTypes.string, css: PropTypes.string, body: PropTypes.string.isRequired, entry: PropTypes.string.isRequired, }; static defaultProps = { title: '', description: '', }; trackingCode() { return ({ __html: `(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=` + `function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;` + `e=o.createElement(i);r=o.getElementsByTagName(i)[0];` + `e.src='https://www.google-analytics.com/analytics.js';` + `r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));` + `ga('create','${googleAnalyticsId}','auto');ga('send','pageview');`, }); } render() { return ( <html className="no-js" lang=""> <head> <meta charSet="utf-8" /> <meta httpEquiv="X-UA-Compatible" content="IE=edge" /> <title>{this.props.title}</title> <meta name="description" content={this.props.description} /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="apple-touch-icon" href="apple-touch-icon.png" /> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"/> <style id="css" dangerouslySetInnerHTML={{ __html: this.props.css }} /> </head> <body> <div id="app" dangerouslySetInnerHTML={{ __html: this.props.body }} /> <script src={this.props.entry}></script> <script dangerouslySetInnerHTML={this.trackingCode()} /> </body> </html> ); } } export default Html;
Test_ReactNative_NativeModules/js/apps/testApp/src/screens/TestNavigatorScreen.js
ksti/Test_react-native-nativeModules
/** * Created by GJS on 2017/4/10. */ import React from 'react'; import { Platform, ScrollView, StyleSheet, TouchableOpacity, Button, Image, Text, View, } from 'react-native'; import { StackNavigator } from 'react-navigation'; import TestTabNavigator from './testScreens/TestTabNavigatorScreen'; import TestBluetoothScreen from './testScreens/TestBluetoothScreen'; const ExampleRoutes = { TestTabNavigator: { name: 'test tab navigator', description: 'A tab navigator', screen: TestTabNavigator, }, TestBluetooth: { name: 'test bluetooth', description: 'A test screen: bluetooth', screen: TestBluetoothScreen, }, }; const Banner = () => ( <View style={styles.banner}> <Image source={require('../../assets/NavLogo.png')} style={styles.bannerImage} /> <Text style={styles.bannerTitle}>Test React Navigation</Text> </View> ); const MainScreen = ({ navigation }) => ( <ScrollView> <Banner /> {Object.keys(ExampleRoutes).map((routeName: string) => <TouchableOpacity key={routeName} onPress={() => { const { path, params, screen } = ExampleRoutes[routeName]; const { router } = screen; const action = path && router.getActionForPathAndParams(path, params); navigation.navigate(routeName, {}, action); }} > <View style={styles.item}> <Text style={styles.title}>{ExampleRoutes[routeName].name}</Text> <Text style={styles.description}>{ExampleRoutes[routeName].description}</Text> </View> </TouchableOpacity> )} </ScrollView> ); MainScreen.navigationOptions = { title: 'test navigation screens', } const AppNavigator = StackNavigator({ ...ExampleRoutes, Index: { screen: MainScreen, }, }, { initialRouteName: 'Index', headerMode: 'none', /* * Use modal on iOS because the card mode comes from the right, * which conflicts with the drawer example gesture */ // mode: Platform.OS === 'ios' ? 'modal' : 'card', mode: 'card', }); // export default () => <AppNavigator />; export default AppNavigator; const styles = StyleSheet.create({ banner: { backgroundColor: '#673ab7', flexDirection: 'row', alignItems: 'center', padding: 16, // marginTop: Platform.OS === 'ios' ? 20 : 0, }, bannerImage: { width: 36, height: 36, resizeMode: 'contain', tintColor: '#fff', margin: 8, }, bannerTitle: { fontSize: 18, fontWeight: '200', color: '#fff', margin: 8, }, item: { backgroundColor: '#fff', paddingHorizontal: 16, paddingVertical: 12, borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: '#ddd', }, image: { width: 120, height: 120, alignSelf: 'center', marginBottom: 20, resizeMode: 'contain', }, title: { fontSize: 16, fontWeight: 'bold', color: '#444', }, description: { fontSize: 13, color: '#999', }, });
stories/legacy.stories.js
joshwcomeau/react-flip-move
/* eslint-disable react/forbid-prop-types */ import React, { Component } from 'react'; import { storiesOf } from '@storybook/react'; import shuffle from 'lodash/shuffle'; import range from 'lodash/range'; import PropTypes from 'prop-types'; import FlipMove from '../src'; const getPosition = node => Object.values(node.getBoundingClientRect()).reduce( (newRect, prop) => ({ ...newRect, [prop]: prop / 0.5 }), {}, ); storiesOf('Legacy Stories', module) .add('simple transition', () => <Controls duration={400} />) .add('when animation is disabled', () => <Controls disableAllAnimations />) .add('when removing items - elevator (default)', () => ( <Controls mode="remove" /> )) .add('when removing items - fade', () => ( <Controls mode="remove" enterAnimation="fade" leaveAnimation="fade" /> )) .add('when removing items - accordionVertical', () => ( <Controls mode="remove" enterAnimation="accordionVertical" leaveAnimation="accordionVertical" /> )) .add('when removing items - accordionHorizontal', () => ( <Controls mode="remove" enterAnimation="accordionHorizontal" leaveAnimation="accordionHorizontal" /> )) .add('when removing items - none', () => ( <Controls mode="remove" enterAnimation={false} leaveAnimation={false} /> )) .add( 'when adding/removing items - custom object with default "leave"', () => ( <Controls mode="remove" enterAnimation={{ from: { transform: 'translateY(-100px)', }, to: { transform: '', }, }} /> ), ) .add('when adding/removing items - custom object with rotate', () => ( <Controls mode="remove" enterAnimation={{ from: { transform: 'translateY(-100px) rotate(90deg) scale(0)' }, to: { transform: '' }, }} leaveAnimation={{ from: { transform: '' }, to: { transform: 'translateY(100px) rotate(-90deg) scale(0)' }, }} /> )) .add('when adding/removing items - custom object with 3D rotate', () => ( <Controls mode="remove" enterAnimation={{ from: { transform: 'rotateX(135deg)' }, to: { transform: '' }, }} leaveAnimation={{ from: { transform: '' }, to: { transform: 'rotateX(-120deg)', opacity: 0.6 }, }} /> )) .add('with centered flex content', () => ( <Controls style={{ display: 'flex', justifyContent: 'center' }} /> )) .add('with transition on child', () => ( <Controls styleFirstChild firstChildInnerStyles={{ transition: '100ms', backgroundColor: '#F00', }} /> )) .add('with onStartAll callback', () => ( <Controls onStartAll={(elements, nodes) => // eslint-disable-next-line no-console console.log('Started with', elements, nodes) } /> )) .add('when prop keys do not change, but items rearrange', () => ( <StaticItems /> )) .add('delegated prop - width', () => ( <Controls typeName="table" width="50%" /> )) .add('inside a scaled container', () => ( <Controls style={{ transform: 'scale(0.5)' }} getPosition={getPosition} /> )) .add('empty', () => { class HandleEmpty extends Component { constructor(props) { super(props); this.state = { empty: true, }; } render() { return ( <div> <button onClick={() => this.setState({ empty: !this.state.empty })}> Toggle! </button> <FlipMove> {this.state.empty ? null : <div>Not empty!</div>} </FlipMove> </div> ); } } return <HandleEmpty />; }) .add('maintain container height', () => ( <Controls maintainContainerHeight style={{ border: 'solid 2px magenta', padding: '7px' }} childOuterStyles={{ margin: '20px' }} /> )) .add('maintain container height with <ul>', () => ( <Controls typeName="ul" maintainContainerHeight style={{ border: 'solid 2px magenta' }} /> )); // Controlling component const items = [ { name: 'Potent Potables' }, { name: 'The Pen is Mightier' }, { name: 'Famous Horsemen' }, { name: 'A Petit Déjeuner' }, ]; // eslint-disable-next-line react/no-multi-comp class Controls extends Component { static defaultProps = { firstChildOuterStyles: {}, firstChildInnerStyles: {}, childInnerStyles: {}, childOuterStyles: {}, }; constructor() { super(); this.state = { items: items.slice() }; } buttonClickHandler = () => { let newItems; let newTopItem; switch (this.props.mode) { case 'remove': newItems = this.state.items.slice(); newItems.splice(1, 1); break; case 'rotate': newItems = this.state.items.slice(); newTopItem = newItems.pop(); newTopItem.name += Math.random(); newItems.unshift(newTopItem); break; default: newItems = shuffle(this.state.items); break; } this.setState({ items: newItems }); }; listItemClickHandler = clickedItem => { this.setState({ items: this.state.items.filter(item => item !== clickedItem), }); }; restore = () => { this.setState({ items, }); }; renderItems() { const stylesOuter = { position: 'relative', display: 'block', padding: '6px', listStyleType: 'none', }; const stylesInner = { padding: '8px', background: '#FFFFFF', color: '#F34D93', fontFamily: 'sans-serif', borderRadius: '4px', }; return this.state.items.map(item => { // Make a working copy of styles let stylesOuterCopy = { ...stylesOuter, ...this.props.childOuterStyles }; let stylesInnerCopy = { ...stylesInner, ...this.props.childInnerStyles }; if (this.props.styleFirstChild && item.name === 'Potent Potables') { stylesOuterCopy = { ...stylesOuterCopy, ...this.props.firstChildOuterStyles, }; stylesInnerCopy = { ...stylesInnerCopy, ...this.props.firstChildInnerStyles, }; } return ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions <li key={item.name} style={stylesOuterCopy} onClick={() => this.listItemClickHandler(item)} > <div style={stylesInnerCopy}> <button style={{ transition: '0.1s background-color' }}> {item.name} </button> </div> </li> ); }); } render() { /* eslint-disable no-unused-vars */ const { childInnerStyles, childOuterStyles, styleFirstChild, firstChildInnerStyles, firstChildOuterStyles, ...filteredProps } = this.props; /* eslint-enable no-unused-vars */ return ( <div style={{ padding: '50px', backgroundColor: '#333636', minHeight: '600px', }} > <div style={{ marginBottom: '50px' }}> <button onClick={this.buttonClickHandler}>Remove</button> <button onClick={this.restore}>Restore</button> </div> <FlipMove {...filteredProps}>{this.renderItems()}</FlipMove> </div> ); } } Controls.propTypes = { mode: PropTypes.string, childOuterStyles: PropTypes.object, childInnerStyles: PropTypes.object, styleFirstChild: PropTypes.bool, firstChildOuterStyles: PropTypes.object, firstChildInnerStyles: PropTypes.object, }; // eslint-disable-next-line react/no-multi-comp class StaticItems extends Component { static renderItems() { return range(4).map(i => { const left = `${Math.floor(Math.random() * 100)}px`; const top = `${Math.floor(Math.random() * 100)}px`; return ( <div key={i} style={{ position: 'absolute', padding: '1rem', background: '#F00', left, top, }} > Item! </div> ); }); } render() { return ( <div> <button onClick={() => this.forceUpdate.call(this, null)}> UPDATE </button> <FlipMove>{StaticItems.renderItems()}</FlipMove> </div> ); } }
examples/simple/src/components/header.js
herschel666/phox
import React from 'react'; import PropTypes from 'prop-types'; import { MAX_WIDTH, BREAKPOINT_MEDIUM } from '../constants'; const Header = ({ headline }) => ( <header> <style jsx> {` header { padding: 18px 0; background-color: #444; color: #f4f4f4; border-bottom: 2px solid #343434; } h1 { max-width: ${MAX_WIDTH}; margin: 0 18px; font-weight: normal; font-size: 24px; } @media screen and (min-width: ${BREAKPOINT_MEDIUM}) { h1 { margin-left: auto; margin-right: auto; } } `} </style> <h1>{headline}</h1> </header> ); Header.propTypes = { headline: PropTypes.string.isRequired }; export default Header;
pootle/static/js/user/components/UserProfileEdit.js
Jobava/pootle
/* * Copyright (C) Pootle contributors. * * This file is a part of the Pootle project. It is distributed under the GPL3 * or later license. See the LICENSE file for a copy of the license and the * AUTHORS file for copyright and authorship information. */ 'use strict'; import Backbone from 'backbone'; import React from 'react'; import { Dialog, Modal } from 'components/lightbox'; import { UserProfileForm } from '../forms'; let UserProfileEdit = React.createClass({ /* Lifecycle */ getInitialState() { return { editing: false, confirmClose: false, isDirty: false }; }, setupRoutes(router) { router.on('route:main', (qs) => { this.setState({editing: false}); }); router.on('route:edit', (id, qs) => { this.setState({editing: true}); }); }, componentWillMount() { this.setupRoutes(this.props.router); Backbone.history.start({pushState: true, root: this.props.appRoot}); }, componentWillUpdate(nextProps, nextState) { this.handleURL(nextState); }, /* State-changing handlers */ handleEdit() { this.setState({editing: true}); }, handleClose(opts) { opts = opts || {}; let forceClose = opts.forceClose || false; if (this.state.isDirty && !forceClose) { this.setState({confirmClose: true}); } else { this.setState({ editing: false, confirmClose: false, isDirty: false }); } }, handleSave(item) { this.handleClose(); window.location.reload(); }, handleDlgOk() { this.handleClose({forceClose: true}); }, handleDlgCancel() { this.setState({confirmClose: false}); }, handleDirtyFlag(isDirty) { this.setState({isDirty: isDirty}); }, /* Handlers */ handleURL(newState) { let newURL = newState.editing ? '/edit/' : '/'; this.props.router.navigate(newURL); }, /* Layout */ render() { return ( <div> <div className="edit-profile-btn"> <button className="btn btn-primary" onClick={this.handleEdit}> {gettext('Edit My Public Profile')} </button> </div> {this.state.editing && <Modal className="user-edit" onClose={this.handleClose} title={gettext('My Public Profile')}> <div id="user-edit"> <UserProfileForm model={this.props.user} onDirty={this.handleDirtyFlag} onSuccess={this.handleSave} /> </div> </Modal>} {this.state.confirmClose && <Dialog onAccept={this.handleDlgOk} onCancel={this.handleDlgCancel} onClose={this.handleDlgCancel} title={gettext('Discard changes.')} okLabel={gettext('Yes')} cancelLabel={gettext('No')}> {gettext('There are unsaved changes. Do you want to discard them?')} </Dialog>} </div> ); } }); export default UserProfileEdit;
ajax/libs/angular.js/0.9.7/angular-scenario.min.js
JeyKeu/cdnjs
/*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(aM,C){var a=function(aY,aZ){return new a.fn.init(aY,aZ)},n=aM.jQuery,R=aM.$,ab=aM.document,X,P=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,aW=/^.[^:#\[\.,]*$/,ax=/\S/,M=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,e=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,b=navigator.userAgent,u,K=false,ad=[],aG,at=Object.prototype.toString,ap=Object.prototype.hasOwnProperty,g=Array.prototype.push,F=Array.prototype.slice,s=Array.prototype.indexOf;a.fn=a.prototype={init:function(aY,a1){var a0,a2,aZ,a3;if(!aY){return this}if(aY.nodeType){this.context=this[0]=aY;this.length=1;return this}if(aY==="body"&&!a1){this.context=ab;this[0]=ab.body;this.selector="body";this.length=1;return this}if(typeof aY==="string"){a0=P.exec(aY);if(a0&&(a0[1]||!a1)){if(a0[1]){a3=(a1?a1.ownerDocument||a1:ab);aZ=e.exec(aY);if(aZ){if(a.isPlainObject(a1)){aY=[ab.createElement(aZ[1])];a.fn.attr.call(aY,a1,true)}else{aY=[a3.createElement(aZ[1])]}}else{aZ=J([a0[1]],[a3]);aY=(aZ.cacheable?aZ.fragment.cloneNode(true):aZ.fragment).childNodes}return a.merge(this,aY)}else{a2=ab.getElementById(a0[2]);if(a2){if(a2.id!==a0[2]){return X.find(aY)}this.length=1;this[0]=a2}this.context=ab;this.selector=aY;return this}}else{if(!a1&&/^\w+$/.test(aY)){this.selector=aY;this.context=ab;aY=ab.getElementsByTagName(aY);return a.merge(this,aY)}else{if(!a1||a1.jquery){return(a1||X).find(aY)}else{return a(a1).find(aY)}}}}else{if(a.isFunction(aY)){return X.ready(aY)}}if(aY.selector!==C){this.selector=aY.selector;this.context=aY.context}return a.makeArray(aY,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(aY){return aY==null?this.toArray():(aY<0?this.slice(aY)[0]:this[aY])},pushStack:function(aZ,a1,aY){var a0=a();if(a.isArray(aZ)){g.apply(a0,aZ)}else{a.merge(a0,aZ)}a0.prevObject=this;a0.context=this.context;if(a1==="find"){a0.selector=this.selector+(this.selector?" ":"")+aY}else{if(a1){a0.selector=this.selector+"."+a1+"("+aY+")"}}return a0},each:function(aZ,aY){return a.each(this,aZ,aY)},ready:function(aY){a.bindReady();if(a.isReady){aY.call(ab,a)}else{if(ad){ad.push(aY)}}return this},eq:function(aY){return aY===-1?this.slice(aY):this.slice(aY,+aY+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(aY){return this.pushStack(a.map(this,function(a0,aZ){return aY.call(a0,aZ,a0)}))},end:function(){return this.prevObject||a(null)},push:g,sort:[].sort,splice:[].splice};a.fn.init.prototype=a.fn;a.extend=a.fn.extend=function(){var a3=arguments[0]||{},a2=1,a1=arguments.length,a5=false,a6,a0,aY,aZ;if(typeof a3==="boolean"){a5=a3;a3=arguments[1]||{};a2=2}if(typeof a3!=="object"&&!a.isFunction(a3)){a3={}}if(a1===a2){a3=this;--a2}for(;a2<a1;a2++){if((a6=arguments[a2])!=null){for(a0 in a6){aY=a3[a0];aZ=a6[a0];if(a3===aZ){continue}if(a5&&aZ&&(a.isPlainObject(aZ)||a.isArray(aZ))){var a4=aY&&(a.isPlainObject(aY)||a.isArray(aY))?aY:a.isArray(aZ)?[]:{};a3[a0]=a.extend(a5,a4,aZ)}else{if(aZ!==C){a3[a0]=aZ}}}}}return a3};a.extend({noConflict:function(aY){aM.$=R;if(aY){aM.jQuery=n}return a},isReady:false,ready:function(){if(!a.isReady){if(!ab.body){return setTimeout(a.ready,13)}a.isReady=true;if(ad){var aZ,aY=0;while((aZ=ad[aY++])){aZ.call(ab,a)}ad=null}if(a.fn.triggerHandler){a(ab).triggerHandler("ready")}}},bindReady:function(){if(K){return}K=true;if(ab.readyState==="complete"){return a.ready()}if(ab.addEventListener){ab.addEventListener("DOMContentLoaded",aG,false);aM.addEventListener("load",a.ready,false)}else{if(ab.attachEvent){ab.attachEvent("onreadystatechange",aG);aM.attachEvent("onload",a.ready);var aY=false;try{aY=aM.frameElement==null}catch(aZ){}if(ab.documentElement.doScroll&&aY){x()}}}},isFunction:function(aY){return at.call(aY)==="[object Function]"},isArray:function(aY){return at.call(aY)==="[object Array]"},isPlainObject:function(aZ){if(!aZ||at.call(aZ)!=="[object Object]"||aZ.nodeType||aZ.setInterval){return false}if(aZ.constructor&&!ap.call(aZ,"constructor")&&!ap.call(aZ.constructor.prototype,"isPrototypeOf")){return false}var aY;for(aY in aZ){}return aY===C||ap.call(aZ,aY)},isEmptyObject:function(aZ){for(var aY in aZ){return false}return true},error:function(aY){throw aY},parseJSON:function(aY){if(typeof aY!=="string"||!aY){return null}aY=a.trim(aY);if(/^[\],:{}\s]*$/.test(aY.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return aM.JSON&&aM.JSON.parse?aM.JSON.parse(aY):(new Function("return "+aY))()}else{a.error("Invalid JSON: "+aY)}},noop:function(){},globalEval:function(a0){if(a0&&ax.test(a0)){var aZ=ab.getElementsByTagName("head")[0]||ab.documentElement,aY=ab.createElement("script");aY.type="text/javascript";if(a.support.scriptEval){aY.appendChild(ab.createTextNode(a0))}else{aY.text=a0}aZ.insertBefore(aY,aZ.firstChild);aZ.removeChild(aY)}},nodeName:function(aZ,aY){return aZ.nodeName&&aZ.nodeName.toUpperCase()===aY.toUpperCase()},each:function(a1,a5,a0){var aZ,a2=0,a3=a1.length,aY=a3===C||a.isFunction(a1);if(a0){if(aY){for(aZ in a1){if(a5.apply(a1[aZ],a0)===false){break}}}else{for(;a2<a3;){if(a5.apply(a1[a2++],a0)===false){break}}}}else{if(aY){for(aZ in a1){if(a5.call(a1[aZ],aZ,a1[aZ])===false){break}}}else{for(var a4=a1[0];a2<a3&&a5.call(a4,a2,a4)!==false;a4=a1[++a2]){}}}return a1},trim:function(aY){return(aY||"").replace(M,"")},makeArray:function(a0,aZ){var aY=aZ||[];if(a0!=null){if(a0.length==null||typeof a0==="string"||a.isFunction(a0)||(typeof a0!=="function"&&a0.setInterval)){g.call(aY,a0)}else{a.merge(aY,a0)}}return aY},inArray:function(a0,a1){if(a1.indexOf){return a1.indexOf(a0)}for(var aY=0,aZ=a1.length;aY<aZ;aY++){if(a1[aY]===a0){return aY}}return -1},merge:function(a2,a0){var a1=a2.length,aZ=0;if(typeof a0.length==="number"){for(var aY=a0.length;aZ<aY;aZ++){a2[a1++]=a0[aZ]}}else{while(a0[aZ]!==C){a2[a1++]=a0[aZ++]}}a2.length=a1;return a2},grep:function(aZ,a3,aY){var a0=[];for(var a1=0,a2=aZ.length;a1<a2;a1++){if(!aY!==!a3(aZ[a1],a1)){a0.push(aZ[a1])}}return a0},map:function(aZ,a4,aY){var a0=[],a3;for(var a1=0,a2=aZ.length;a1<a2;a1++){a3=a4(aZ[a1],a1,aY);if(a3!=null){a0[a0.length]=a3}}return a0.concat.apply([],a0)},guid:1,proxy:function(a0,aZ,aY){if(arguments.length===2){if(typeof aZ==="string"){aY=a0;a0=aY[aZ];aZ=C}else{if(aZ&&!a.isFunction(aZ)){aY=aZ;aZ=C}}}if(!aZ&&a0){aZ=function(){return a0.apply(aY||this,arguments)}}if(a0){aZ.guid=a0.guid=a0.guid||aZ.guid||a.guid++}return aZ},uaMatch:function(aZ){aZ=aZ.toLowerCase();var aY=/(webkit)[ \/]([\w.]+)/.exec(aZ)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(aZ)||/(msie) ([\w.]+)/.exec(aZ)||!/compatible/.test(aZ)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(aZ)||[];return{browser:aY[1]||"",version:aY[2]||"0"}},browser:{}});u=a.uaMatch(b);if(u.browser){a.browser[u.browser]=true;a.browser.version=u.version}if(a.browser.webkit){a.browser.safari=true}if(s){a.inArray=function(aY,aZ){return s.call(aZ,aY)}}X=a(ab);if(ab.addEventListener){aG=function(){ab.removeEventListener("DOMContentLoaded",aG,false);a.ready()}}else{if(ab.attachEvent){aG=function(){if(ab.readyState==="complete"){ab.detachEvent("onreadystatechange",aG);a.ready()}}}}function x(){if(a.isReady){return}try{ab.documentElement.doScroll("left")}catch(aY){setTimeout(x,1);return}a.ready()}function aV(aY,aZ){if(aZ.src){a.ajax({url:aZ.src,async:false,dataType:"script"})}else{a.globalEval(aZ.text||aZ.textContent||aZ.innerHTML||"")}if(aZ.parentNode){aZ.parentNode.removeChild(aZ)}}function an(aY,a6,a4,a0,a3,a5){var aZ=aY.length;if(typeof a6==="object"){for(var a1 in a6){an(aY,a1,a6[a1],a0,a3,a4)}return aY}if(a4!==C){a0=!a5&&a0&&a.isFunction(a4);for(var a2=0;a2<aZ;a2++){a3(aY[a2],a6,a0?a4.call(aY[a2],a2,a3(aY[a2],a6)):a4,a5)}return aY}return aZ?a3(aY[0],a6):C}function aP(){return(new Date).getTime()}(function(){a.support={};var a4=ab.documentElement,a3=ab.createElement("script"),aY=ab.createElement("div"),aZ="script"+aP();aY.style.display="none";aY.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var a6=aY.getElementsByTagName("*"),a5=aY.getElementsByTagName("a")[0];if(!a6||!a6.length||!a5){return}a.support={leadingWhitespace:aY.firstChild.nodeType===3,tbody:!aY.getElementsByTagName("tbody").length,htmlSerialize:!!aY.getElementsByTagName("link").length,style:/red/.test(a5.getAttribute("style")),hrefNormalized:a5.getAttribute("href")==="/a",opacity:/^0.55$/.test(a5.style.opacity),cssFloat:!!a5.style.cssFloat,checkOn:aY.getElementsByTagName("input")[0].value==="on",optSelected:ab.createElement("select").appendChild(ab.createElement("option")).selected,parentNode:aY.removeChild(aY.appendChild(ab.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};a3.type="text/javascript";try{a3.appendChild(ab.createTextNode("window."+aZ+"=1;"))}catch(a1){}a4.insertBefore(a3,a4.firstChild);if(aM[aZ]){a.support.scriptEval=true;delete aM[aZ]}try{delete a3.test}catch(a1){a.support.deleteExpando=false}a4.removeChild(a3);if(aY.attachEvent&&aY.fireEvent){aY.attachEvent("onclick",function a7(){a.support.noCloneEvent=false;aY.detachEvent("onclick",a7)});aY.cloneNode(true).fireEvent("onclick")}aY=ab.createElement("div");aY.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var a0=ab.createDocumentFragment();a0.appendChild(aY.firstChild);a.support.checkClone=a0.cloneNode(true).cloneNode(true).lastChild.checked;a(function(){var a8=ab.createElement("div");a8.style.width=a8.style.paddingLeft="1px";ab.body.appendChild(a8);a.boxModel=a.support.boxModel=a8.offsetWidth===2;ab.body.removeChild(a8).style.display="none";a8=null});var a2=function(a8){var ba=ab.createElement("div");a8="on"+a8;var a9=(a8 in ba);if(!a9){ba.setAttribute(a8,"return;");a9=typeof ba[a8]==="function"}ba=null;return a9};a.support.submitBubbles=a2("submit");a.support.changeBubbles=a2("change");a4=a3=aY=a6=a5=null})();a.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aI="jQuery"+aP(),aH=0,aT={};a.extend({cache:{},expando:aI,noData:{embed:true,object:true,applet:true},data:function(a0,aZ,a2){if(a0.nodeName&&a.noData[a0.nodeName.toLowerCase()]){return}a0=a0==aM?aT:a0;var a3=a0[aI],aY=a.cache,a1;if(!a3&&typeof aZ==="string"&&a2===C){return null}if(!a3){a3=++aH}if(typeof aZ==="object"){a0[aI]=a3;a1=aY[a3]=a.extend(true,{},aZ)}else{if(!aY[a3]){a0[aI]=a3;aY[a3]={}}}a1=aY[a3];if(a2!==C){a1[aZ]=a2}return typeof aZ==="string"?a1[aZ]:a1},removeData:function(a0,aZ){if(a0.nodeName&&a.noData[a0.nodeName.toLowerCase()]){return}a0=a0==aM?aT:a0;var a2=a0[aI],aY=a.cache,a1=aY[a2];if(aZ){if(a1){delete a1[aZ];if(a.isEmptyObject(a1)){a.removeData(a0)}}}else{if(a.support.deleteExpando){delete a0[a.expando]}else{if(a0.removeAttribute){a0.removeAttribute(a.expando)}}delete aY[a2]}}});a.fn.extend({data:function(aY,a0){if(typeof aY==="undefined"&&this.length){return a.data(this[0])}else{if(typeof aY==="object"){return this.each(function(){a.data(this,aY)})}}var a1=aY.split(".");a1[1]=a1[1]?"."+a1[1]:"";if(a0===C){var aZ=this.triggerHandler("getData"+a1[1]+"!",[a1[0]]);if(aZ===C&&this.length){aZ=a.data(this[0],aY)}return aZ===C&&a1[1]?this.data(a1[0]):aZ}else{return this.trigger("setData"+a1[1]+"!",[a1[0],a0]).each(function(){a.data(this,aY,a0)})}},removeData:function(aY){return this.each(function(){a.removeData(this,aY)})}});a.extend({queue:function(aZ,aY,a1){if(!aZ){return}aY=(aY||"fx")+"queue";var a0=a.data(aZ,aY);if(!a1){return a0||[]}if(!a0||a.isArray(a1)){a0=a.data(aZ,aY,a.makeArray(a1))}else{a0.push(a1)}return a0},dequeue:function(a1,a0){a0=a0||"fx";var aY=a.queue(a1,a0),aZ=aY.shift();if(aZ==="inprogress"){aZ=aY.shift()}if(aZ){if(a0==="fx"){aY.unshift("inprogress")}aZ.call(a1,function(){a.dequeue(a1,a0)})}}});a.fn.extend({queue:function(aY,aZ){if(typeof aY!=="string"){aZ=aY;aY="fx"}if(aZ===C){return a.queue(this[0],aY)}return this.each(function(a1,a2){var a0=a.queue(this,aY,aZ);if(aY==="fx"&&a0[0]!=="inprogress"){a.dequeue(this,aY)}})},dequeue:function(aY){return this.each(function(){a.dequeue(this,aY)})},delay:function(aZ,aY){aZ=a.fx?a.fx.speeds[aZ]||aZ:aZ;aY=aY||"fx";return this.queue(aY,function(){var a0=this;setTimeout(function(){a.dequeue(a0,aY)},aZ)})},clearQueue:function(aY){return this.queue(aY||"fx",[])}});var ao=/[\n\t]/g,S=/\s+/,av=/\r/g,aQ=/href|src|style/,d=/(button|input)/i,z=/(button|input|object|select|textarea)/i,j=/^(a|area)$/i,I=/radio|checkbox/;a.fn.extend({attr:function(aY,aZ){return an(this,aY,aZ,true,a.attr)},removeAttr:function(aY,aZ){return this.each(function(){a.attr(this,aY,"");if(this.nodeType===1){this.removeAttribute(aY)}})},addClass:function(a5){if(a.isFunction(a5)){return this.each(function(a8){var a7=a(this);a7.addClass(a5.call(this,a8,a7.attr("class")))})}if(a5&&typeof a5==="string"){var aY=(a5||"").split(S);for(var a1=0,a0=this.length;a1<a0;a1++){var aZ=this[a1];if(aZ.nodeType===1){if(!aZ.className){aZ.className=a5}else{var a2=" "+aZ.className+" ",a4=aZ.className;for(var a3=0,a6=aY.length;a3<a6;a3++){if(a2.indexOf(" "+aY[a3]+" ")<0){a4+=" "+aY[a3]}}aZ.className=a.trim(a4)}}}}return this},removeClass:function(a3){if(a.isFunction(a3)){return this.each(function(a7){var a6=a(this);a6.removeClass(a3.call(this,a7,a6.attr("class")))})}if((a3&&typeof a3==="string")||a3===C){var a4=(a3||"").split(S);for(var a0=0,aZ=this.length;a0<aZ;a0++){var a2=this[a0];if(a2.nodeType===1&&a2.className){if(a3){var a1=(" "+a2.className+" ").replace(ao," ");for(var a5=0,aY=a4.length;a5<aY;a5++){a1=a1.replace(" "+a4[a5]+" "," ")}a2.className=a.trim(a1)}else{a2.className=""}}}}return this},toggleClass:function(a1,aZ){var a0=typeof a1,aY=typeof aZ==="boolean";if(a.isFunction(a1)){return this.each(function(a3){var a2=a(this);a2.toggleClass(a1.call(this,a3,a2.attr("class"),aZ),aZ)})}return this.each(function(){if(a0==="string"){var a4,a3=0,a2=a(this),a5=aZ,a6=a1.split(S);while((a4=a6[a3++])){a5=aY?a5:!a2.hasClass(a4);a2[a5?"addClass":"removeClass"](a4)}}else{if(a0==="undefined"||a0==="boolean"){if(this.className){a.data(this,"__className__",this.className)}this.className=this.className||a1===false?"":a.data(this,"__className__")||""}}})},hasClass:function(aY){var a1=" "+aY+" ";for(var a0=0,aZ=this.length;a0<aZ;a0++){if((" "+this[a0].className+" ").replace(ao," ").indexOf(a1)>-1){return true}}return false},val:function(a5){if(a5===C){var aZ=this[0];if(aZ){if(a.nodeName(aZ,"option")){return(aZ.attributes.value||{}).specified?aZ.value:aZ.text}if(a.nodeName(aZ,"select")){var a3=aZ.selectedIndex,a6=[],a7=aZ.options,a2=aZ.type==="select-one";if(a3<0){return null}for(var a0=a2?a3:0,a4=a2?a3+1:a7.length;a0<a4;a0++){var a1=a7[a0];if(a1.selected){a5=a(a1).val();if(a2){return a5}a6.push(a5)}}return a6}if(I.test(aZ.type)&&!a.support.checkOn){return aZ.getAttribute("value")===null?"on":aZ.value}return(aZ.value||"").replace(av,"")}return C}var aY=a.isFunction(a5);return this.each(function(ba){var a9=a(this),bb=a5;if(this.nodeType!==1){return}if(aY){bb=a5.call(this,ba,a9.val())}if(typeof bb==="number"){bb+=""}if(a.isArray(bb)&&I.test(this.type)){this.checked=a.inArray(a9.val(),bb)>=0}else{if(a.nodeName(this,"select")){var a8=a.makeArray(bb);a("option",this).each(function(){this.selected=a.inArray(a(this).val(),a8)>=0});if(!a8.length){this.selectedIndex=-1}}else{this.value=bb}}})}});a.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(aZ,aY,a4,a7){if(!aZ||aZ.nodeType===3||aZ.nodeType===8){return C}if(a7&&aY in a.attrFn){return a(aZ)[aY](a4)}var a0=aZ.nodeType!==1||!a.isXMLDoc(aZ),a3=a4!==C;aY=a0&&a.props[aY]||aY;if(aZ.nodeType===1){var a2=aQ.test(aY);if(aY==="selected"&&!a.support.optSelected){var a5=aZ.parentNode;if(a5){a5.selectedIndex;if(a5.parentNode){a5.parentNode.selectedIndex}}}if(aY in aZ&&a0&&!a2){if(a3){if(aY==="type"&&d.test(aZ.nodeName)&&aZ.parentNode){a.error("type property can't be changed")}aZ[aY]=a4}if(a.nodeName(aZ,"form")&&aZ.getAttributeNode(aY)){return aZ.getAttributeNode(aY).nodeValue}if(aY==="tabIndex"){var a6=aZ.getAttributeNode("tabIndex");return a6&&a6.specified?a6.value:z.test(aZ.nodeName)||j.test(aZ.nodeName)&&aZ.href?0:C}return aZ[aY]}if(!a.support.style&&a0&&aY==="style"){if(a3){aZ.style.cssText=""+a4}return aZ.style.cssText}if(a3){aZ.setAttribute(aY,""+a4)}var a1=!a.support.hrefNormalized&&a0&&a2?aZ.getAttribute(aY,2):aZ.getAttribute(aY);return a1===null?C:a1}return a.style(aZ,aY,a4)}});var aC=/\.(.*)$/,A=function(aY){return aY.replace(/[^\w\s\.\|`]/g,function(aZ){return"\\"+aZ})};a.event={add:function(a1,a5,ba,a3){if(a1.nodeType===3||a1.nodeType===8){return}if(a1.setInterval&&(a1!==aM&&!a1.frameElement)){a1=aM}var aZ,a9;if(ba.handler){aZ=ba;ba=aZ.handler}if(!ba.guid){ba.guid=a.guid++}var a6=a.data(a1);if(!a6){return}var bb=a6.events=a6.events||{},a4=a6.handle,a4;if(!a4){a6.handle=a4=function(){return typeof a!=="undefined"&&!a.event.triggered?a.event.handle.apply(a4.elem,arguments):C}}a4.elem=a1;a5=a5.split(" ");var a8,a2=0,aY;while((a8=a5[a2++])){a9=aZ?a.extend({},aZ):{handler:ba,data:a3};if(a8.indexOf(".")>-1){aY=a8.split(".");a8=aY.shift();a9.namespace=aY.slice(0).sort().join(".")}else{aY=[];a9.namespace=""}a9.type=a8;a9.guid=ba.guid;var a0=bb[a8],a7=a.event.special[a8]||{};if(!a0){a0=bb[a8]=[];if(!a7.setup||a7.setup.call(a1,a3,aY,a4)===false){if(a1.addEventListener){a1.addEventListener(a8,a4,false)}else{if(a1.attachEvent){a1.attachEvent("on"+a8,a4)}}}}if(a7.add){a7.add.call(a1,a9);if(!a9.handler.guid){a9.handler.guid=ba.guid}}a0.push(a9);a.event.global[a8]=true}a1=null},global:{},remove:function(bd,a8,aZ,a4){if(bd.nodeType===3||bd.nodeType===8){return}var bg,a3,a5,bb=0,a1,a6,a9,a2,a7,aY,bf,bc=a.data(bd),a0=bc&&bc.events;if(!bc||!a0){return}if(a8&&a8.type){aZ=a8.handler;a8=a8.type}if(!a8||typeof a8==="string"&&a8.charAt(0)==="."){a8=a8||"";for(a3 in a0){a.event.remove(bd,a3+a8)}return}a8=a8.split(" ");while((a3=a8[bb++])){bf=a3;aY=null;a1=a3.indexOf(".")<0;a6=[];if(!a1){a6=a3.split(".");a3=a6.shift();a9=new RegExp("(^|\\.)"+a.map(a6.slice(0).sort(),A).join("\\.(?:.*\\.)?")+"(\\.|$)")}a7=a0[a3];if(!a7){continue}if(!aZ){for(var ba=0;ba<a7.length;ba++){aY=a7[ba];if(a1||a9.test(aY.namespace)){a.event.remove(bd,bf,aY.handler,ba);a7.splice(ba--,1)}}continue}a2=a.event.special[a3]||{};for(var ba=a4||0;ba<a7.length;ba++){aY=a7[ba];if(aZ.guid===aY.guid){if(a1||a9.test(aY.namespace)){if(a4==null){a7.splice(ba--,1)}if(a2.remove){a2.remove.call(bd,aY)}}if(a4!=null){break}}}if(a7.length===0||a4!=null&&a7.length===1){if(!a2.teardown||a2.teardown.call(bd,a6)===false){ag(bd,a3,bc.handle)}bg=null;delete a0[a3]}}if(a.isEmptyObject(a0)){var be=bc.handle;if(be){be.elem=null}delete bc.events;delete bc.handle;if(a.isEmptyObject(bc)){a.removeData(bd)}}},trigger:function(aY,a2,a0){var a7=aY.type||aY,a1=arguments[3];if(!a1){aY=typeof aY==="object"?aY[aI]?aY:a.extend(a.Event(a7),aY):a.Event(a7);if(a7.indexOf("!")>=0){aY.type=a7=a7.slice(0,-1);aY.exclusive=true}if(!a0){aY.stopPropagation();if(a.event.global[a7]){a.each(a.cache,function(){if(this.events&&this.events[a7]){a.event.trigger(aY,a2,this.handle.elem)}})}}if(!a0||a0.nodeType===3||a0.nodeType===8){return C}aY.result=C;aY.target=a0;a2=a.makeArray(a2);a2.unshift(aY)}aY.currentTarget=a0;var a3=a.data(a0,"handle");if(a3){a3.apply(a0,a2)}var a8=a0.parentNode||a0.ownerDocument;try{if(!(a0&&a0.nodeName&&a.noData[a0.nodeName.toLowerCase()])){if(a0["on"+a7]&&a0["on"+a7].apply(a0,a2)===false){aY.result=false}}}catch(a5){}if(!aY.isPropagationStopped()&&a8){a.event.trigger(aY,a2,a8,true)}else{if(!aY.isDefaultPrevented()){var a4=aY.target,aZ,a9=a.nodeName(a4,"a")&&a7==="click",a6=a.event.special[a7]||{};if((!a6._default||a6._default.call(a0,aY)===false)&&!a9&&!(a4&&a4.nodeName&&a.noData[a4.nodeName.toLowerCase()])){try{if(a4[a7]){aZ=a4["on"+a7];if(aZ){a4["on"+a7]=null}a.event.triggered=true;a4[a7]()}}catch(a5){}if(aZ){a4["on"+a7]=aZ}a.event.triggered=false}}}},handle:function(aY){var a6,a0,aZ,a1,a7;aY=arguments[0]=a.event.fix(aY||aM.event);aY.currentTarget=this;a6=aY.type.indexOf(".")<0&&!aY.exclusive;if(!a6){aZ=aY.type.split(".");aY.type=aZ.shift();a1=new RegExp("(^|\\.)"+aZ.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var a7=a.data(this,"events"),a0=a7[aY.type];if(a7&&a0){a0=a0.slice(0);for(var a3=0,a2=a0.length;a3<a2;a3++){var a5=a0[a3];if(a6||a1.test(a5.namespace)){aY.handler=a5.handler;aY.data=a5.data;aY.handleObj=a5;var a4=a5.handler.apply(this,arguments);if(a4!==C){aY.result=a4;if(a4===false){aY.preventDefault();aY.stopPropagation()}}if(aY.isImmediatePropagationStopped()){break}}}}return aY.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a1){if(a1[aI]){return a1}var aZ=a1;a1=a.Event(aZ);for(var a0=this.props.length,a3;a0;){a3=this.props[--a0];a1[a3]=aZ[a3]}if(!a1.target){a1.target=a1.srcElement||ab}if(a1.target.nodeType===3){a1.target=a1.target.parentNode}if(!a1.relatedTarget&&a1.fromElement){a1.relatedTarget=a1.fromElement===a1.target?a1.toElement:a1.fromElement}if(a1.pageX==null&&a1.clientX!=null){var a2=ab.documentElement,aY=ab.body;a1.pageX=a1.clientX+(a2&&a2.scrollLeft||aY&&aY.scrollLeft||0)-(a2&&a2.clientLeft||aY&&aY.clientLeft||0);a1.pageY=a1.clientY+(a2&&a2.scrollTop||aY&&aY.scrollTop||0)-(a2&&a2.clientTop||aY&&aY.clientTop||0)}if(!a1.which&&((a1.charCode||a1.charCode===0)?a1.charCode:a1.keyCode)){a1.which=a1.charCode||a1.keyCode}if(!a1.metaKey&&a1.ctrlKey){a1.metaKey=a1.ctrlKey}if(!a1.which&&a1.button!==C){a1.which=(a1.button&1?1:(a1.button&2?3:(a1.button&4?2:0)))}return a1},guid:100000000,proxy:a.proxy,special:{ready:{setup:a.bindReady,teardown:a.noop},live:{add:function(aY){a.event.add(this,aY.origType,a.extend({},aY,{handler:V}))},remove:function(aZ){var aY=true,a0=aZ.origType.replace(aC,"");a.each(a.data(this,"events").live||[],function(){if(a0===this.origType.replace(aC,"")){aY=false;return false}});if(aY){a.event.remove(this,aZ.origType,V)}}},beforeunload:{setup:function(a0,aZ,aY){if(this.setInterval){this.onbeforeunload=aY}return false},teardown:function(aZ,aY){if(this.onbeforeunload===aY){this.onbeforeunload=null}}}}};var ag=ab.removeEventListener?function(aZ,aY,a0){aZ.removeEventListener(aY,a0,false)}:function(aZ,aY,a0){aZ.detachEvent("on"+aY,a0)};a.Event=function(aY){if(!this.preventDefault){return new a.Event(aY)}if(aY&&aY.type){this.originalEvent=aY;this.type=aY.type}else{this.type=aY}this.timeStamp=aP();this[aI]=true};function aR(){return false}function f(){return true}a.Event.prototype={preventDefault:function(){this.isDefaultPrevented=f;var aY=this.originalEvent;if(!aY){return}if(aY.preventDefault){aY.preventDefault()}aY.returnValue=false},stopPropagation:function(){this.isPropagationStopped=f;var aY=this.originalEvent;if(!aY){return}if(aY.stopPropagation){aY.stopPropagation()}aY.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=f;this.stopPropagation()},isDefaultPrevented:aR,isPropagationStopped:aR,isImmediatePropagationStopped:aR};var Q=function(aZ){var aY=aZ.relatedTarget;try{while(aY&&aY!==this){aY=aY.parentNode}if(aY!==this){aZ.type=aZ.data;a.event.handle.apply(this,arguments)}}catch(a0){}},ay=function(aY){aY.type=aY.data;a.event.handle.apply(this,arguments)};a.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(aZ,aY){a.event.special[aZ]={setup:function(a0){a.event.add(this,aY,a0&&a0.selector?ay:Q,aZ)},teardown:function(a0){a.event.remove(this,aY,a0&&a0.selector?ay:Q)}}});if(!a.support.submitBubbles){a.event.special.submit={setup:function(aZ,aY){if(this.nodeName.toLowerCase()!=="form"){a.event.add(this,"click.specialSubmit",function(a2){var a1=a2.target,a0=a1.type;if((a0==="submit"||a0==="image")&&a(a1).closest("form").length){return aA("submit",this,arguments)}});a.event.add(this,"keypress.specialSubmit",function(a2){var a1=a2.target,a0=a1.type;if((a0==="text"||a0==="password")&&a(a1).closest("form").length&&a2.keyCode===13){return aA("submit",this,arguments)}})}else{return false}},teardown:function(aY){a.event.remove(this,".specialSubmit")}}}if(!a.support.changeBubbles){var aq=/textarea|input|select/i,aS,i=function(aZ){var aY=aZ.type,a0=aZ.value;if(aY==="radio"||aY==="checkbox"){a0=aZ.checked}else{if(aY==="select-multiple"){a0=aZ.selectedIndex>-1?a.map(aZ.options,function(a1){return a1.selected}).join("-"):""}else{if(aZ.nodeName.toLowerCase()==="select"){a0=aZ.selectedIndex}}}return a0},O=function O(a0){var aY=a0.target,aZ,a1;if(!aq.test(aY.nodeName)||aY.readOnly){return}aZ=a.data(aY,"_change_data");a1=i(aY);if(a0.type!=="focusout"||aY.type!=="radio"){a.data(aY,"_change_data",a1)}if(aZ===C||a1===aZ){return}if(aZ!=null||a1){a0.type="change";return a.event.trigger(a0,arguments[1],aY)}};a.event.special.change={filters:{focusout:O,click:function(a0){var aZ=a0.target,aY=aZ.type;if(aY==="radio"||aY==="checkbox"||aZ.nodeName.toLowerCase()==="select"){return O.call(this,a0)}},keydown:function(a0){var aZ=a0.target,aY=aZ.type;if((a0.keyCode===13&&aZ.nodeName.toLowerCase()!=="textarea")||(a0.keyCode===32&&(aY==="checkbox"||aY==="radio"))||aY==="select-multiple"){return O.call(this,a0)}},beforeactivate:function(aZ){var aY=aZ.target;a.data(aY,"_change_data",i(aY))}},setup:function(a0,aZ){if(this.type==="file"){return false}for(var aY in aS){a.event.add(this,aY+".specialChange",aS[aY])}return aq.test(this.nodeName)},teardown:function(aY){a.event.remove(this,".specialChange");return aq.test(this.nodeName)}};aS=a.event.special.change.filters}function aA(aZ,a0,aY){aY[0].type=aZ;return a.event.handle.apply(a0,aY)}if(ab.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(a0,aY){a.event.special[aY]={setup:function(){this.addEventListener(a0,aZ,true)},teardown:function(){this.removeEventListener(a0,aZ,true)}};function aZ(a1){a1=a.event.fix(a1);a1.type=aY;return a.event.handle.call(this,a1)}})}a.each(["bind","one"],function(aZ,aY){a.fn[aY]=function(a5,a6,a4){if(typeof a5==="object"){for(var a2 in a5){this[aY](a2,a6,a5[a2],a4)}return this}if(a.isFunction(a6)){a4=a6;a6=C}var a3=aY==="one"?a.proxy(a4,function(a7){a(this).unbind(a7,a3);return a4.apply(this,arguments)}):a4;if(a5==="unload"&&aY!=="one"){this.one(a5,a6,a4)}else{for(var a1=0,a0=this.length;a1<a0;a1++){a.event.add(this[a1],a5,a3,a6)}}return this}});a.fn.extend({unbind:function(a2,a1){if(typeof a2==="object"&&!a2.preventDefault){for(var a0 in a2){this.unbind(a0,a2[a0])}}else{for(var aZ=0,aY=this.length;aZ<aY;aZ++){a.event.remove(this[aZ],a2,a1)}}return this},delegate:function(aY,aZ,a1,a0){return this.live(aZ,a1,a0,aY)},undelegate:function(aY,aZ,a0){if(arguments.length===0){return this.unbind("live")}else{return this.die(aZ,null,a0,aY)}},trigger:function(aY,aZ){return this.each(function(){a.event.trigger(aY,aZ,this)})},triggerHandler:function(aY,a0){if(this[0]){var aZ=a.Event(aY);aZ.preventDefault();aZ.stopPropagation();a.event.trigger(aZ,a0,this[0]);return aZ.result}},toggle:function(a0){var aY=arguments,aZ=1;while(aZ<aY.length){a.proxy(a0,aY[aZ++])}return this.click(a.proxy(a0,function(a1){var a2=(a.data(this,"lastToggle"+a0.guid)||0)%aZ;a.data(this,"lastToggle"+a0.guid,a2+1);a1.preventDefault();return aY[a2].apply(this,arguments)||false}))},hover:function(aY,aZ){return this.mouseenter(aY).mouseleave(aZ||aY)}});var aw={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};a.each(["live","die"],function(aZ,aY){a.fn[aY]=function(a7,a4,a9,a2){var a8,a5=0,a6,a1,ba,a3=a2||this.selector,a0=a2?this:a(this.context);if(a.isFunction(a4)){a9=a4;a4=C}a7=(a7||"").split(" ");while((a8=a7[a5++])!=null){a6=aC.exec(a8);a1="";if(a6){a1=a6[0];a8=a8.replace(aC,"")}if(a8==="hover"){a7.push("mouseenter"+a1,"mouseleave"+a1);continue}ba=a8;if(a8==="focus"||a8==="blur"){a7.push(aw[a8]+a1);a8=a8+a1}else{a8=(aw[a8]||a8)+a1}if(aY==="live"){a0.each(function(){a.event.add(this,m(a8,a3),{data:a4,selector:a3,handler:a9,origType:a8,origHandler:a9,preType:ba})})}else{a0.unbind(m(a8,a3),a9)}}return this}});function V(aY){var a8,aZ=[],bb=[],a7=arguments,ba,a6,a9,a1,a3,a5,a2,a4,bc=a.data(this,"events");if(aY.liveFired===this||!bc||!bc.live||aY.button&&aY.type==="click"){return}aY.liveFired=this;var a0=bc.live.slice(0);for(a3=0;a3<a0.length;a3++){a9=a0[a3];if(a9.origType.replace(aC,"")===aY.type){bb.push(a9.selector)}else{a0.splice(a3--,1)}}a6=a(aY.target).closest(bb,aY.currentTarget);for(a5=0,a2=a6.length;a5<a2;a5++){for(a3=0;a3<a0.length;a3++){a9=a0[a3];if(a6[a5].selector===a9.selector){a1=a6[a5].elem;ba=null;if(a9.preType==="mouseenter"||a9.preType==="mouseleave"){ba=a(aY.relatedTarget).closest(a9.selector)[0]}if(!ba||ba!==a1){aZ.push({elem:a1,handleObj:a9})}}}}for(a5=0,a2=aZ.length;a5<a2;a5++){a6=aZ[a5];aY.currentTarget=a6.elem;aY.data=a6.handleObj.data;aY.handleObj=a6.handleObj;if(a6.handleObj.origHandler.apply(a6.elem,a7)===false){a8=false;break}}return a8}function m(aZ,aY){return"live."+(aZ&&aZ!=="*"?aZ+".":"")+aY.replace(/\./g,"`").replace(/ /g,"&")}a.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").split(" "),function(aZ,aY){a.fn[aY]=function(a0){return a0?this.bind(aY,a0):this.trigger(aY)};if(a.attrFn){a.attrFn[aY]=true}});if(aM.attachEvent&&!aM.addEventListener){aM.attachEvent("onunload",function(){for(var aZ in a.cache){if(a.cache[aZ].handle){try{a.event.remove(a.cache[aZ].handle.elem)}catch(aY){}}}}); /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ }(function(){var a9=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ba=0,bc=Object.prototype.toString,a4=false,a3=true;[0,0].sort(function(){a3=false;return 0});var a0=function(bl,bg,bo,bp){bo=bo||[];var br=bg=bg||ab;if(bg.nodeType!==1&&bg.nodeType!==9){return[]}if(!bl||typeof bl!=="string"){return bo}var bm=[],bi,bt,bw,bh,bk=true,bj=a1(bg),bq=bl;while((a9.exec(""),bi=a9.exec(bq))!==null){bq=bi[3];bm.push(bi[1]);if(bi[2]){bh=bi[3];break}}if(bm.length>1&&a5.exec(bl)){if(bm.length===2&&a6.relative[bm[0]]){bt=bd(bm[0]+bm[1],bg)}else{bt=a6.relative[bm[0]]?[bg]:a0(bm.shift(),bg);while(bm.length){bl=bm.shift();if(a6.relative[bl]){bl+=bm.shift()}bt=bd(bl,bt)}}}else{if(!bp&&bm.length>1&&bg.nodeType===9&&!bj&&a6.match.ID.test(bm[0])&&!a6.match.ID.test(bm[bm.length-1])){var bs=a0.find(bm.shift(),bg,bj);bg=bs.expr?a0.filter(bs.expr,bs.set)[0]:bs.set[0]}if(bg){var bs=bp?{expr:bm.pop(),set:a8(bp)}:a0.find(bm.pop(),bm.length===1&&(bm[0]==="~"||bm[0]==="+")&&bg.parentNode?bg.parentNode:bg,bj);bt=bs.expr?a0.filter(bs.expr,bs.set):bs.set;if(bm.length>0){bw=a8(bt)}else{bk=false}while(bm.length){var bv=bm.pop(),bu=bv;if(!a6.relative[bv]){bv=""}else{bu=bm.pop()}if(bu==null){bu=bg}a6.relative[bv](bw,bu,bj)}}else{bw=bm=[]}}if(!bw){bw=bt}if(!bw){a0.error(bv||bl)}if(bc.call(bw)==="[object Array]"){if(!bk){bo.push.apply(bo,bw)}else{if(bg&&bg.nodeType===1){for(var bn=0;bw[bn]!=null;bn++){if(bw[bn]&&(bw[bn]===true||bw[bn].nodeType===1&&a7(bg,bw[bn]))){bo.push(bt[bn])}}}else{for(var bn=0;bw[bn]!=null;bn++){if(bw[bn]&&bw[bn].nodeType===1){bo.push(bt[bn])}}}}}else{a8(bw,bo)}if(bh){a0(bh,br,bo,bp);a0.uniqueSort(bo)}return bo};a0.uniqueSort=function(bh){if(bb){a4=a3;bh.sort(bb);if(a4){for(var bg=1;bg<bh.length;bg++){if(bh[bg]===bh[bg-1]){bh.splice(bg--,1)}}}}return bh};a0.matches=function(bg,bh){return a0(bg,null,null,bh)};a0.find=function(bn,bg,bo){var bm,bk;if(!bn){return[]}for(var bj=0,bi=a6.order.length;bj<bi;bj++){var bl=a6.order[bj],bk;if((bk=a6.leftMatch[bl].exec(bn))){var bh=bk[1];bk.splice(1,1);if(bh.substr(bh.length-1)!=="\\"){bk[1]=(bk[1]||"").replace(/\\/g,"");bm=a6.find[bl](bk,bg,bo);if(bm!=null){bn=bn.replace(a6.match[bl],"");break}}}}if(!bm){bm=bg.getElementsByTagName("*")}return{set:bm,expr:bn}};a0.filter=function(br,bq,bu,bk){var bi=br,bw=[],bo=bq,bm,bg,bn=bq&&bq[0]&&a1(bq[0]);while(br&&bq.length){for(var bp in a6.filter){if((bm=a6.leftMatch[bp].exec(br))!=null&&bm[2]){var bh=a6.filter[bp],bv,bt,bj=bm[1];bg=false;bm.splice(1,1);if(bj.substr(bj.length-1)==="\\"){continue}if(bo===bw){bw=[]}if(a6.preFilter[bp]){bm=a6.preFilter[bp](bm,bo,bu,bw,bk,bn);if(!bm){bg=bv=true}else{if(bm===true){continue}}}if(bm){for(var bl=0;(bt=bo[bl])!=null;bl++){if(bt){bv=bh(bt,bm,bl,bo);var bs=bk^!!bv;if(bu&&bv!=null){if(bs){bg=true}else{bo[bl]=false}}else{if(bs){bw.push(bt);bg=true}}}}}if(bv!==C){if(!bu){bo=bw}br=br.replace(a6.match[bp],"");if(!bg){return[]}break}}}if(br===bi){if(bg==null){a0.error(br)}else{break}}bi=br}return bo};a0.error=function(bg){throw"Syntax error, unrecognized expression: "+bg};var a6=a0.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(bg){return bg.getAttribute("href")}},relative:{"+":function(bm,bh){var bj=typeof bh==="string",bl=bj&&!/\W/.test(bh),bn=bj&&!bl;if(bl){bh=bh.toLowerCase()}for(var bi=0,bg=bm.length,bk;bi<bg;bi++){if((bk=bm[bi])){while((bk=bk.previousSibling)&&bk.nodeType!==1){}bm[bi]=bn||bk&&bk.nodeName.toLowerCase()===bh?bk||false:bk===bh}}if(bn){a0.filter(bh,bm,true)}},">":function(bm,bh){var bk=typeof bh==="string";if(bk&&!/\W/.test(bh)){bh=bh.toLowerCase();for(var bi=0,bg=bm.length;bi<bg;bi++){var bl=bm[bi];if(bl){var bj=bl.parentNode;bm[bi]=bj.nodeName.toLowerCase()===bh?bj:false}}}else{for(var bi=0,bg=bm.length;bi<bg;bi++){var bl=bm[bi];if(bl){bm[bi]=bk?bl.parentNode:bl.parentNode===bh}}if(bk){a0.filter(bh,bm,true)}}},"":function(bj,bh,bl){var bi=ba++,bg=be;if(typeof bh==="string"&&!/\W/.test(bh)){var bk=bh=bh.toLowerCase();bg=aY}bg("parentNode",bh,bi,bj,bk,bl)},"~":function(bj,bh,bl){var bi=ba++,bg=be;if(typeof bh==="string"&&!/\W/.test(bh)){var bk=bh=bh.toLowerCase();bg=aY}bg("previousSibling",bh,bi,bj,bk,bl)}},find:{ID:function(bh,bi,bj){if(typeof bi.getElementById!=="undefined"&&!bj){var bg=bi.getElementById(bh[1]);return bg?[bg]:[]}},NAME:function(bi,bl){if(typeof bl.getElementsByName!=="undefined"){var bh=[],bk=bl.getElementsByName(bi[1]);for(var bj=0,bg=bk.length;bj<bg;bj++){if(bk[bj].getAttribute("name")===bi[1]){bh.push(bk[bj])}}return bh.length===0?null:bh}},TAG:function(bg,bh){return bh.getElementsByTagName(bg[1])}},preFilter:{CLASS:function(bj,bh,bi,bg,bm,bn){bj=" "+bj[1].replace(/\\/g,"")+" ";if(bn){return bj}for(var bk=0,bl;(bl=bh[bk])!=null;bk++){if(bl){if(bm^(bl.className&&(" "+bl.className+" ").replace(/[\t\n]/g," ").indexOf(bj)>=0)){if(!bi){bg.push(bl)}}else{if(bi){bh[bk]=false}}}}return false},ID:function(bg){return bg[1].replace(/\\/g,"")},TAG:function(bh,bg){return bh[1].toLowerCase()},CHILD:function(bg){if(bg[1]==="nth"){var bh=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(bg[2]==="even"&&"2n"||bg[2]==="odd"&&"2n+1"||!/\D/.test(bg[2])&&"0n+"+bg[2]||bg[2]);bg[2]=(bh[1]+(bh[2]||1))-0;bg[3]=bh[3]-0}bg[0]=ba++;return bg},ATTR:function(bk,bh,bi,bg,bl,bm){var bj=bk[1].replace(/\\/g,"");if(!bm&&a6.attrMap[bj]){bk[1]=a6.attrMap[bj]}if(bk[2]==="~="){bk[4]=" "+bk[4]+" "}return bk},PSEUDO:function(bk,bh,bi,bg,bl){if(bk[1]==="not"){if((a9.exec(bk[3])||"").length>1||/^\w/.test(bk[3])){bk[3]=a0(bk[3],null,null,bh)}else{var bj=a0.filter(bk[3],bh,bi,true^bl);if(!bi){bg.push.apply(bg,bj)}return false}}else{if(a6.match.POS.test(bk[0])||a6.match.CHILD.test(bk[0])){return true}}return bk},POS:function(bg){bg.unshift(true);return bg}},filters:{enabled:function(bg){return bg.disabled===false&&bg.type!=="hidden"},disabled:function(bg){return bg.disabled===true},checked:function(bg){return bg.checked===true},selected:function(bg){bg.parentNode.selectedIndex;return bg.selected===true},parent:function(bg){return !!bg.firstChild},empty:function(bg){return !bg.firstChild},has:function(bi,bh,bg){return !!a0(bg[3],bi).length},header:function(bg){return/h\d/i.test(bg.nodeName)},text:function(bg){return"text"===bg.type},radio:function(bg){return"radio"===bg.type},checkbox:function(bg){return"checkbox"===bg.type},file:function(bg){return"file"===bg.type},password:function(bg){return"password"===bg.type},submit:function(bg){return"submit"===bg.type},image:function(bg){return"image"===bg.type},reset:function(bg){return"reset"===bg.type},button:function(bg){return"button"===bg.type||bg.nodeName.toLowerCase()==="button"},input:function(bg){return/input|select|textarea|button/i.test(bg.nodeName)}},setFilters:{first:function(bh,bg){return bg===0},last:function(bi,bh,bg,bj){return bh===bj.length-1},even:function(bh,bg){return bg%2===0},odd:function(bh,bg){return bg%2===1},lt:function(bi,bh,bg){return bh<bg[3]-0},gt:function(bi,bh,bg){return bh>bg[3]-0},nth:function(bi,bh,bg){return bg[3]-0===bh},eq:function(bi,bh,bg){return bg[3]-0===bh}},filter:{PSEUDO:function(bm,bi,bj,bn){var bh=bi[1],bk=a6.filters[bh];if(bk){return bk(bm,bj,bi,bn)}else{if(bh==="contains"){return(bm.textContent||bm.innerText||aZ([bm])||"").indexOf(bi[3])>=0}else{if(bh==="not"){var bl=bi[3];for(var bj=0,bg=bl.length;bj<bg;bj++){if(bl[bj]===bm){return false}}return true}else{a0.error("Syntax error, unrecognized expression: "+bh)}}}},CHILD:function(bg,bj){var bm=bj[1],bh=bg;switch(bm){case"only":case"first":while((bh=bh.previousSibling)){if(bh.nodeType===1){return false}}if(bm==="first"){return true}bh=bg;case"last":while((bh=bh.nextSibling)){if(bh.nodeType===1){return false}}return true;case"nth":var bi=bj[2],bp=bj[3];if(bi===1&&bp===0){return true}var bl=bj[0],bo=bg.parentNode;if(bo&&(bo.sizcache!==bl||!bg.nodeIndex)){var bk=0;for(bh=bo.firstChild;bh;bh=bh.nextSibling){if(bh.nodeType===1){bh.nodeIndex=++bk}}bo.sizcache=bl}var bn=bg.nodeIndex-bp;if(bi===0){return bn===0}else{return(bn%bi===0&&bn/bi>=0)}}},ID:function(bh,bg){return bh.nodeType===1&&bh.getAttribute("id")===bg},TAG:function(bh,bg){return(bg==="*"&&bh.nodeType===1)||bh.nodeName.toLowerCase()===bg},CLASS:function(bh,bg){return(" "+(bh.className||bh.getAttribute("class"))+" ").indexOf(bg)>-1},ATTR:function(bl,bj){var bi=bj[1],bg=a6.attrHandle[bi]?a6.attrHandle[bi](bl):bl[bi]!=null?bl[bi]:bl.getAttribute(bi),bm=bg+"",bk=bj[2],bh=bj[4];return bg==null?bk==="!=":bk==="="?bm===bh:bk==="*="?bm.indexOf(bh)>=0:bk==="~="?(" "+bm+" ").indexOf(bh)>=0:!bh?bm&&bg!==false:bk==="!="?bm!==bh:bk==="^="?bm.indexOf(bh)===0:bk==="$="?bm.substr(bm.length-bh.length)===bh:bk==="|="?bm===bh||bm.substr(0,bh.length+1)===bh+"-":false},POS:function(bk,bh,bi,bl){var bg=bh[2],bj=a6.setFilters[bg];if(bj){return bj(bk,bi,bh,bl)}}}};var a5=a6.match.POS;for(var a2 in a6.match){a6.match[a2]=new RegExp(a6.match[a2].source+/(?![^\[]*\])(?![^\(]*\))/.source);a6.leftMatch[a2]=new RegExp(/(^(?:.|\r|\n)*?)/.source+a6.match[a2].source.replace(/\\(\d+)/g,function(bh,bg){return"\\"+(bg-0+1)}))}var a8=function(bh,bg){bh=Array.prototype.slice.call(bh,0);if(bg){bg.push.apply(bg,bh);return bg}return bh};try{Array.prototype.slice.call(ab.documentElement.childNodes,0)[0].nodeType}catch(bf){a8=function(bk,bj){var bh=bj||[];if(bc.call(bk)==="[object Array]"){Array.prototype.push.apply(bh,bk)}else{if(typeof bk.length==="number"){for(var bi=0,bg=bk.length;bi<bg;bi++){bh.push(bk[bi])}}else{for(var bi=0;bk[bi];bi++){bh.push(bk[bi])}}}return bh}}var bb;if(ab.documentElement.compareDocumentPosition){bb=function(bh,bg){if(!bh.compareDocumentPosition||!bg.compareDocumentPosition){if(bh==bg){a4=true}return bh.compareDocumentPosition?-1:1}var bi=bh.compareDocumentPosition(bg)&4?-1:bh===bg?0:1;if(bi===0){a4=true}return bi}}else{if("sourceIndex" in ab.documentElement){bb=function(bh,bg){if(!bh.sourceIndex||!bg.sourceIndex){if(bh==bg){a4=true}return bh.sourceIndex?-1:1}var bi=bh.sourceIndex-bg.sourceIndex;if(bi===0){a4=true}return bi}}else{if(ab.createRange){bb=function(bj,bh){if(!bj.ownerDocument||!bh.ownerDocument){if(bj==bh){a4=true}return bj.ownerDocument?-1:1}var bi=bj.ownerDocument.createRange(),bg=bh.ownerDocument.createRange();bi.setStart(bj,0);bi.setEnd(bj,0);bg.setStart(bh,0);bg.setEnd(bh,0);var bk=bi.compareBoundaryPoints(Range.START_TO_END,bg);if(bk===0){a4=true}return bk}}}}function aZ(bg){var bh="",bj;for(var bi=0;bg[bi];bi++){bj=bg[bi];if(bj.nodeType===3||bj.nodeType===4){bh+=bj.nodeValue}else{if(bj.nodeType!==8){bh+=aZ(bj.childNodes)}}}return bh}(function(){var bh=ab.createElement("div"),bi="script"+(new Date).getTime();bh.innerHTML="<a name='"+bi+"'/>";var bg=ab.documentElement;bg.insertBefore(bh,bg.firstChild);if(ab.getElementById(bi)){a6.find.ID=function(bk,bl,bm){if(typeof bl.getElementById!=="undefined"&&!bm){var bj=bl.getElementById(bk[1]);return bj?bj.id===bk[1]||typeof bj.getAttributeNode!=="undefined"&&bj.getAttributeNode("id").nodeValue===bk[1]?[bj]:C:[]}};a6.filter.ID=function(bl,bj){var bk=typeof bl.getAttributeNode!=="undefined"&&bl.getAttributeNode("id");return bl.nodeType===1&&bk&&bk.nodeValue===bj}}bg.removeChild(bh);bg=bh=null})();(function(){var bg=ab.createElement("div");bg.appendChild(ab.createComment(""));if(bg.getElementsByTagName("*").length>0){a6.find.TAG=function(bh,bl){var bk=bl.getElementsByTagName(bh[1]);if(bh[1]==="*"){var bj=[];for(var bi=0;bk[bi];bi++){if(bk[bi].nodeType===1){bj.push(bk[bi])}}bk=bj}return bk}}bg.innerHTML="<a href='#'></a>";if(bg.firstChild&&typeof bg.firstChild.getAttribute!=="undefined"&&bg.firstChild.getAttribute("href")!=="#"){a6.attrHandle.href=function(bh){return bh.getAttribute("href",2)}}bg=null})();if(ab.querySelectorAll){(function(){var bg=a0,bi=ab.createElement("div");bi.innerHTML="<p class='TEST'></p>";if(bi.querySelectorAll&&bi.querySelectorAll(".TEST").length===0){return}a0=function(bm,bl,bj,bk){bl=bl||ab;if(!bk&&bl.nodeType===9&&!a1(bl)){try{return a8(bl.querySelectorAll(bm),bj)}catch(bn){}}return bg(bm,bl,bj,bk)};for(var bh in bg){a0[bh]=bg[bh]}bi=null})()}(function(){var bg=ab.createElement("div");bg.innerHTML="<div class='test e'></div><div class='test'></div>";if(!bg.getElementsByClassName||bg.getElementsByClassName("e").length===0){return}bg.lastChild.className="e";if(bg.getElementsByClassName("e").length===1){return}a6.order.splice(1,0,"CLASS");a6.find.CLASS=function(bh,bi,bj){if(typeof bi.getElementsByClassName!=="undefined"&&!bj){return bi.getElementsByClassName(bh[1])}};bg=null})();function aY(bh,bm,bl,bp,bn,bo){for(var bj=0,bi=bp.length;bj<bi;bj++){var bg=bp[bj];if(bg){bg=bg[bh];var bk=false;while(bg){if(bg.sizcache===bl){bk=bp[bg.sizset];break}if(bg.nodeType===1&&!bo){bg.sizcache=bl;bg.sizset=bj}if(bg.nodeName.toLowerCase()===bm){bk=bg;break}bg=bg[bh]}bp[bj]=bk}}}function be(bh,bm,bl,bp,bn,bo){for(var bj=0,bi=bp.length;bj<bi;bj++){var bg=bp[bj];if(bg){bg=bg[bh];var bk=false;while(bg){if(bg.sizcache===bl){bk=bp[bg.sizset];break}if(bg.nodeType===1){if(!bo){bg.sizcache=bl;bg.sizset=bj}if(typeof bm!=="string"){if(bg===bm){bk=true;break}}else{if(a0.filter(bm,[bg]).length>0){bk=bg;break}}}bg=bg[bh]}bp[bj]=bk}}}var a7=ab.compareDocumentPosition?function(bh,bg){return !!(bh.compareDocumentPosition(bg)&16)}:function(bh,bg){return bh!==bg&&(bh.contains?bh.contains(bg):true)};var a1=function(bg){var bh=(bg?bg.ownerDocument||bg:0).documentElement;return bh?bh.nodeName!=="HTML":false};var bd=function(bg,bn){var bj=[],bk="",bl,bi=bn.nodeType?[bn]:bn;while((bl=a6.match.PSEUDO.exec(bg))){bk+=bl[0];bg=bg.replace(a6.match.PSEUDO,"")}bg=a6.relative[bg]?bg+"*":bg;for(var bm=0,bh=bi.length;bm<bh;bm++){a0(bg,bi[bm],bj)}return a0.filter(bk,bj)};a.find=a0;a.expr=a0.selectors;a.expr[":"]=a.expr.filters;a.unique=a0.uniqueSort;a.text=aZ;a.isXMLDoc=a1;a.contains=a7;return;aM.Sizzle=a0})();var N=/Until$/,Y=/^(?:parents|prevUntil|prevAll)/,aL=/,/,F=Array.prototype.slice;var ai=function(a1,a0,aY){if(a.isFunction(a0)){return a.grep(a1,function(a3,a2){return !!a0.call(a3,a2,a3)===aY})}else{if(a0.nodeType){return a.grep(a1,function(a3,a2){return(a3===a0)===aY})}else{if(typeof a0==="string"){var aZ=a.grep(a1,function(a2){return a2.nodeType===1});if(aW.test(a0)){return a.filter(a0,aZ,!aY)}else{a0=a.filter(a0,aZ)}}}}return a.grep(a1,function(a3,a2){return(a.inArray(a3,a0)>=0)===aY})};a.fn.extend({find:function(aY){var a0=this.pushStack("","find",aY),a3=0;for(var a1=0,aZ=this.length;a1<aZ;a1++){a3=a0.length;a.find(aY,this[a1],a0);if(a1>0){for(var a4=a3;a4<a0.length;a4++){for(var a2=0;a2<a3;a2++){if(a0[a2]===a0[a4]){a0.splice(a4--,1);break}}}}}return a0},has:function(aZ){var aY=a(aZ);return this.filter(function(){for(var a1=0,a0=aY.length;a1<a0;a1++){if(a.contains(this,aY[a1])){return true}}})},not:function(aY){return this.pushStack(ai(this,aY,false),"not",aY)},filter:function(aY){return this.pushStack(ai(this,aY,true),"filter",aY)},is:function(aY){return !!aY&&a.filter(aY,this).length>0},closest:function(a7,aY){if(a.isArray(a7)){var a4=[],a6=this[0],a3,a2={},a0;if(a6&&a7.length){for(var a1=0,aZ=a7.length;a1<aZ;a1++){a0=a7[a1];if(!a2[a0]){a2[a0]=a.expr.match.POS.test(a0)?a(a0,aY||this.context):a0}}while(a6&&a6.ownerDocument&&a6!==aY){for(a0 in a2){a3=a2[a0];if(a3.jquery?a3.index(a6)>-1:a(a6).is(a3)){a4.push({selector:a0,elem:a6});delete a2[a0]}}a6=a6.parentNode}}return a4}var a5=a.expr.match.POS.test(a7)?a(a7,aY||this.context):null;return this.map(function(a8,a9){while(a9&&a9.ownerDocument&&a9!==aY){if(a5?a5.index(a9)>-1:a(a9).is(a7)){return a9}a9=a9.parentNode}return null})},index:function(aY){if(!aY||typeof aY==="string"){return a.inArray(this[0],aY?a(aY):this.parent().children())}return a.inArray(aY.jquery?aY[0]:aY,this)},add:function(aY,aZ){var a1=typeof aY==="string"?a(aY,aZ||this.context):a.makeArray(aY),a0=a.merge(this.get(),a1);return this.pushStack(y(a1[0])||y(a0[0])?a0:a.unique(a0))},andSelf:function(){return this.add(this.prevObject)}});function y(aY){return !aY||!aY.parentNode||aY.parentNode.nodeType===11}a.each({parent:function(aZ){var aY=aZ.parentNode;return aY&&aY.nodeType!==11?aY:null},parents:function(aY){return a.dir(aY,"parentNode")},parentsUntil:function(aZ,aY,a0){return a.dir(aZ,"parentNode",a0)},next:function(aY){return a.nth(aY,2,"nextSibling")},prev:function(aY){return a.nth(aY,2,"previousSibling")},nextAll:function(aY){return a.dir(aY,"nextSibling")},prevAll:function(aY){return a.dir(aY,"previousSibling")},nextUntil:function(aZ,aY,a0){return a.dir(aZ,"nextSibling",a0)},prevUntil:function(aZ,aY,a0){return a.dir(aZ,"previousSibling",a0)},siblings:function(aY){return a.sibling(aY.parentNode.firstChild,aY)},children:function(aY){return a.sibling(aY.firstChild)},contents:function(aY){return a.nodeName(aY,"iframe")?aY.contentDocument||aY.contentWindow.document:a.makeArray(aY.childNodes)}},function(aY,aZ){a.fn[aY]=function(a2,a0){var a1=a.map(this,aZ,a2);if(!N.test(aY)){a0=a2}if(a0&&typeof a0==="string"){a1=a.filter(a0,a1)}a1=this.length>1?a.unique(a1):a1;if((this.length>1||aL.test(a0))&&Y.test(aY)){a1=a1.reverse()}return this.pushStack(a1,aY,F.call(arguments).join(","))}});a.extend({filter:function(a0,aY,aZ){if(aZ){a0=":not("+a0+")"}return a.find.matches(a0,aY)},dir:function(a0,aZ,a2){var aY=[],a1=a0[aZ];while(a1&&a1.nodeType!==9&&(a2===C||a1.nodeType!==1||!a(a1).is(a2))){if(a1.nodeType===1){aY.push(a1)}a1=a1[aZ]}return aY},nth:function(a2,aY,a0,a1){aY=aY||1;var aZ=0;for(;a2;a2=a2[a0]){if(a2.nodeType===1&&++aZ===aY){break}}return a2},sibling:function(a0,aZ){var aY=[];for(;a0;a0=a0.nextSibling){if(a0.nodeType===1&&a0!==aZ){aY.push(a0)}}return aY}});var T=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,H=/(<([\w:]+)[^>]*?)\/>/g,al=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,c=/<([\w:]+)/,t=/<tbody/i,L=/<|&#?\w+;/,E=/<script|<object|<embed|<option|<style/i,l=/checked\s*(?:[^=]|=\s*.checked.)/i,p=function(aZ,a0,aY){return al.test(aY)?aZ:a0+"></"+aY+">"},ac={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};ac.optgroup=ac.option;ac.tbody=ac.tfoot=ac.colgroup=ac.caption=ac.thead;ac.th=ac.td;if(!a.support.htmlSerialize){ac._default=[1,"div<div>","</div>"]}a.fn.extend({text:function(aY){if(a.isFunction(aY)){return this.each(function(a0){var aZ=a(this);aZ.text(aY.call(this,a0,aZ.text()))})}if(typeof aY!=="object"&&aY!==C){return this.empty().append((this[0]&&this[0].ownerDocument||ab).createTextNode(aY))}return a.text(this)},wrapAll:function(aY){if(a.isFunction(aY)){return this.each(function(a0){a(this).wrapAll(aY.call(this,a0))})}if(this[0]){var aZ=a(aY,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){aZ.insertBefore(this[0])}aZ.map(function(){var a0=this;while(a0.firstChild&&a0.firstChild.nodeType===1){a0=a0.firstChild}return a0}).append(this)}return this},wrapInner:function(aY){if(a.isFunction(aY)){return this.each(function(aZ){a(this).wrapInner(aY.call(this,aZ))})}return this.each(function(){var aZ=a(this),a0=aZ.contents();if(a0.length){a0.wrapAll(aY)}else{aZ.append(aY)}})},wrap:function(aY){return this.each(function(){a(this).wrapAll(aY)})},unwrap:function(){return this.parent().each(function(){if(!a.nodeName(this,"body")){a(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(aY){if(this.nodeType===1){this.appendChild(aY)}})},prepend:function(){return this.domManip(arguments,true,function(aY){if(this.nodeType===1){this.insertBefore(aY,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aZ){this.parentNode.insertBefore(aZ,this)})}else{if(arguments.length){var aY=a(arguments[0]);aY.push.apply(aY,this.toArray());return this.pushStack(aY,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aZ){this.parentNode.insertBefore(aZ,this.nextSibling)})}else{if(arguments.length){var aY=this.pushStack(this,"after",arguments);aY.push.apply(aY,a(arguments[0]).toArray());return aY}}},remove:function(aY,a1){for(var aZ=0,a0;(a0=this[aZ])!=null;aZ++){if(!aY||a.filter(aY,[a0]).length){if(!a1&&a0.nodeType===1){a.cleanData(a0.getElementsByTagName("*"));a.cleanData([a0])}if(a0.parentNode){a0.parentNode.removeChild(a0)}}}return this},empty:function(){for(var aY=0,aZ;(aZ=this[aY])!=null;aY++){if(aZ.nodeType===1){a.cleanData(aZ.getElementsByTagName("*"))}while(aZ.firstChild){aZ.removeChild(aZ.firstChild)}}return this},clone:function(aZ){var aY=this.map(function(){if(!a.support.noCloneEvent&&!a.isXMLDoc(this)){var a1=this.outerHTML,a0=this.ownerDocument;if(!a1){var a2=a0.createElement("div");a2.appendChild(this.cloneNode(true));a1=a2.innerHTML}return a.clean([a1.replace(T,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Z,"")],a0)[0]}else{return this.cloneNode(true)}});if(aZ===true){q(this,aY);q(this.find("*"),aY.find("*"))}return aY},html:function(a0){if(a0===C){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(T,""):null}else{if(typeof a0==="string"&&!E.test(a0)&&(a.support.leadingWhitespace||!Z.test(a0))&&!ac[(c.exec(a0)||["",""])[1].toLowerCase()]){a0=a0.replace(H,p);try{for(var aZ=0,aY=this.length;aZ<aY;aZ++){if(this[aZ].nodeType===1){a.cleanData(this[aZ].getElementsByTagName("*"));this[aZ].innerHTML=a0}}}catch(a1){this.empty().append(a0)}}else{if(a.isFunction(a0)){this.each(function(a4){var a3=a(this),a2=a3.html();a3.empty().append(function(){return a0.call(this,a4,a2)})})}else{this.empty().append(a0)}}}return this},replaceWith:function(aY){if(this[0]&&this[0].parentNode){if(a.isFunction(aY)){return this.each(function(a1){var a0=a(this),aZ=a0.html();a0.replaceWith(aY.call(this,a1,aZ))})}if(typeof aY!=="string"){aY=a(aY).detach()}return this.each(function(){var a0=this.nextSibling,aZ=this.parentNode;a(this).remove();if(a0){a(a0).before(aY)}else{a(aZ).append(aY)}})}else{return this.pushStack(a(a.isFunction(aY)?aY():aY),"replaceWith",aY)}},detach:function(aY){return this.remove(aY,true)},domManip:function(a4,a9,a8){var a1,a2,a7=a4[0],aZ=[],a3,a6;if(!a.support.checkClone&&arguments.length===3&&typeof a7==="string"&&l.test(a7)){return this.each(function(){a(this).domManip(a4,a9,a8,true)})}if(a.isFunction(a7)){return this.each(function(bb){var ba=a(this);a4[0]=a7.call(this,bb,a9?ba.html():C);ba.domManip(a4,a9,a8)})}if(this[0]){a6=a7&&a7.parentNode;if(a.support.parentNode&&a6&&a6.nodeType===11&&a6.childNodes.length===this.length){a1={fragment:a6}}else{a1=J(a4,this,aZ)}a3=a1.fragment;if(a3.childNodes.length===1){a2=a3=a3.firstChild}else{a2=a3.firstChild}if(a2){a9=a9&&a.nodeName(a2,"tr");for(var a0=0,aY=this.length;a0<aY;a0++){a8.call(a9?a5(this[a0],a2):this[a0],a0>0||a1.cacheable||this.length>1?a3.cloneNode(true):a3)}}if(aZ.length){a.each(aZ,aV)}}return this;function a5(ba,bb){return a.nodeName(ba,"table")?(ba.getElementsByTagName("tbody")[0]||ba.appendChild(ba.ownerDocument.createElement("tbody"))):ba}}});function q(a0,aY){var aZ=0;aY.each(function(){if(this.nodeName!==(a0[aZ]&&a0[aZ].nodeName)){return}var a5=a.data(a0[aZ++]),a4=a.data(this,a5),a1=a5&&a5.events;if(a1){delete a4.handle;a4.events={};for(var a3 in a1){for(var a2 in a1[a3]){a.event.add(this,a3,a1[a3][a2],a1[a3][a2].data)}}}})}function J(a3,a1,aZ){var a2,aY,a0,a4=(a1&&a1[0]?a1[0].ownerDocument||a1[0]:ab);if(a3.length===1&&typeof a3[0]==="string"&&a3[0].length<512&&a4===ab&&!E.test(a3[0])&&(a.support.checkClone||!l.test(a3[0]))){aY=true;a0=a.fragments[a3[0]];if(a0){if(a0!==1){a2=a0}}}if(!a2){a2=a4.createDocumentFragment();a.clean(a3,a4,a2,aZ)}if(aY){a.fragments[a3[0]]=a0?a2:1}return{fragment:a2,cacheable:aY}}a.fragments={};a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(aY,aZ){a.fn[aY]=function(a0){var a3=[],a6=a(a0),a5=this.length===1&&this[0].parentNode;if(a5&&a5.nodeType===11&&a5.childNodes.length===1&&a6.length===1){a6[aZ](this[0]);return this}else{for(var a4=0,a1=a6.length;a4<a1;a4++){var a2=(a4>0?this.clone(true):this).get();a.fn[aZ].apply(a(a6[a4]),a2);a3=a3.concat(a2)}return this.pushStack(a3,aY,a6.selector)}}});a.extend({clean:function(a0,a2,a9,a4){a2=a2||ab;if(typeof a2.createElement==="undefined"){a2=a2.ownerDocument||a2[0]&&a2[0].ownerDocument||ab}var ba=[];for(var a8=0,a3;(a3=a0[a8])!=null;a8++){if(typeof a3==="number"){a3+=""}if(!a3){continue}if(typeof a3==="string"&&!L.test(a3)){a3=a2.createTextNode(a3)}else{if(typeof a3==="string"){a3=a3.replace(H,p);var bb=(c.exec(a3)||["",""])[1].toLowerCase(),a1=ac[bb]||ac._default,a7=a1[0],aZ=a2.createElement("div");aZ.innerHTML=a1[1]+a3+a1[2];while(a7--){aZ=aZ.lastChild}if(!a.support.tbody){var aY=t.test(a3),a6=bb==="table"&&!aY?aZ.firstChild&&aZ.firstChild.childNodes:a1[1]==="<table>"&&!aY?aZ.childNodes:[];for(var a5=a6.length-1;a5>=0;--a5){if(a.nodeName(a6[a5],"tbody")&&!a6[a5].childNodes.length){a6[a5].parentNode.removeChild(a6[a5])}}}if(!a.support.leadingWhitespace&&Z.test(a3)){aZ.insertBefore(a2.createTextNode(Z.exec(a3)[0]),aZ.firstChild)}a3=aZ.childNodes}}if(a3.nodeType){ba.push(a3)}else{ba=a.merge(ba,a3)}}if(a9){for(var a8=0;ba[a8];a8++){if(a4&&a.nodeName(ba[a8],"script")&&(!ba[a8].type||ba[a8].type.toLowerCase()==="text/javascript")){a4.push(ba[a8].parentNode?ba[a8].parentNode.removeChild(ba[a8]):ba[a8])}else{if(ba[a8].nodeType===1){ba.splice.apply(ba,[a8+1,0].concat(a.makeArray(ba[a8].getElementsByTagName("script"))))}a9.appendChild(ba[a8])}}}return ba},cleanData:function(aZ){var a2,a0,aY=a.cache,a5=a.event.special,a4=a.support.deleteExpando;for(var a3=0,a1;(a1=aZ[a3])!=null;a3++){a0=a1[a.expando];if(a0){a2=aY[a0];if(a2.events){for(var a6 in a2.events){if(a5[a6]){a.event.remove(a1,a6)}else{ag(a1,a6,a2.handle)}}}if(a4){delete a1[a.expando]}else{if(a1.removeAttribute){a1.removeAttribute(a.expando)}}delete aY[a0]}}}});var ar=/z-?index|font-?weight|opacity|zoom|line-?height/i,U=/alpha\([^)]*\)/,aa=/opacity=([^)]*)/,ah=/float/i,az=/-([a-z])/ig,v=/([A-Z])/g,aO=/^-?\d+(?:px)?$/i,aU=/^-?\d/,aK={position:"absolute",visibility:"hidden",display:"block"},W=["Left","Right"],aE=["Top","Bottom"],ak=ab.defaultView&&ab.defaultView.getComputedStyle,aN=a.support.cssFloat?"cssFloat":"styleFloat",k=function(aY,aZ){return aZ.toUpperCase()};a.fn.css=function(aY,aZ){return an(this,aY,aZ,true,function(a1,a0,a2){if(a2===C){return a.curCSS(a1,a0)}if(typeof a2==="number"&&!ar.test(a0)){a2+="px"}a.style(a1,a0,a2)})};a.extend({style:function(a2,aZ,a3){if(!a2||a2.nodeType===3||a2.nodeType===8){return C}if((aZ==="width"||aZ==="height")&&parseFloat(a3)<0){a3=C}var a1=a2.style||a2,a4=a3!==C;if(!a.support.opacity&&aZ==="opacity"){if(a4){a1.zoom=1;var aY=parseInt(a3,10)+""==="NaN"?"":"alpha(opacity="+a3*100+")";var a0=a1.filter||a.curCSS(a2,"filter")||"";a1.filter=U.test(a0)?a0.replace(U,aY):aY}return a1.filter&&a1.filter.indexOf("opacity=")>=0?(parseFloat(aa.exec(a1.filter)[1])/100)+"":""}if(ah.test(aZ)){aZ=aN}aZ=aZ.replace(az,k);if(a4){a1[aZ]=a3}return a1[aZ]},css:function(a1,aZ,a3,aY){if(aZ==="width"||aZ==="height"){var a5,a0=aK,a4=aZ==="width"?W:aE;function a2(){a5=aZ==="width"?a1.offsetWidth:a1.offsetHeight;if(aY==="border"){return}a.each(a4,function(){if(!aY){a5-=parseFloat(a.curCSS(a1,"padding"+this,true))||0}if(aY==="margin"){a5+=parseFloat(a.curCSS(a1,"margin"+this,true))||0}else{a5-=parseFloat(a.curCSS(a1,"border"+this+"Width",true))||0}})}if(a1.offsetWidth!==0){a2()}else{a.swap(a1,a0,a2)}return Math.max(0,Math.round(a5))}return a.curCSS(a1,aZ,a3)},curCSS:function(a4,aZ,a0){var a7,aY=a4.style,a1;if(!a.support.opacity&&aZ==="opacity"&&a4.currentStyle){a7=aa.test(a4.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return a7===""?"1":a7}if(ah.test(aZ)){aZ=aN}if(!a0&&aY&&aY[aZ]){a7=aY[aZ]}else{if(ak){if(ah.test(aZ)){aZ="float"}aZ=aZ.replace(v,"-$1").toLowerCase();var a6=a4.ownerDocument.defaultView;if(!a6){return null}var a8=a6.getComputedStyle(a4,null);if(a8){a7=a8.getPropertyValue(aZ)}if(aZ==="opacity"&&a7===""){a7="1"}}else{if(a4.currentStyle){var a3=aZ.replace(az,k);a7=a4.currentStyle[aZ]||a4.currentStyle[a3];if(!aO.test(a7)&&aU.test(a7)){var a2=aY.left,a5=a4.runtimeStyle.left;a4.runtimeStyle.left=a4.currentStyle.left;aY.left=a3==="fontSize"?"1em":(a7||0);a7=aY.pixelLeft+"px";aY.left=a2;a4.runtimeStyle.left=a5}}}}return a7},swap:function(a1,a0,a2){var aY={};for(var aZ in a0){aY[aZ]=a1.style[aZ];a1.style[aZ]=a0[aZ]}a2.call(a1);for(var aZ in a0){a1.style[aZ]=aY[aZ]}}});if(a.expr&&a.expr.filters){a.expr.filters.hidden=function(a1){var aZ=a1.offsetWidth,aY=a1.offsetHeight,a0=a1.nodeName.toLowerCase()==="tr";return aZ===0&&aY===0&&!a0?true:aZ>0&&aY>0&&!a0?false:a.curCSS(a1,"display")==="none"};a.expr.filters.visible=function(aY){return !a.expr.filters.hidden(aY)}}var af=aP(),aJ=/<script(.|\s)*?\/script>/gi,o=/select|textarea/i,aB=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,r=/=\?(&|$)/,D=/\?/,aX=/(\?|&)_=.*?(&|$)/,B=/^(\w+:)?\/\/([^\/?#]+)/,h=/%20/g,w=a.fn.load;a.fn.extend({load:function(a0,a3,a4){if(typeof a0!=="string"){return w.call(this,a0)}else{if(!this.length){return this}}var a2=a0.indexOf(" ");if(a2>=0){var aY=a0.slice(a2,a0.length);a0=a0.slice(0,a2)}var a1="GET";if(a3){if(a.isFunction(a3)){a4=a3;a3=null}else{if(typeof a3==="object"){a3=a.param(a3,a.ajaxSettings.traditional);a1="POST"}}}var aZ=this;a.ajax({url:a0,type:a1,dataType:"html",data:a3,complete:function(a6,a5){if(a5==="success"||a5==="notmodified"){aZ.html(aY?a("<div />").append(a6.responseText.replace(aJ,"")).find(aY):a6.responseText)}if(a4){aZ.each(a4,[a6.responseText,a5,a6])}}});return this},serialize:function(){return a.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?a.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||o.test(this.nodeName)||aB.test(this.type))}).map(function(aY,aZ){var a0=a(this).val();return a0==null?null:a.isArray(a0)?a.map(a0,function(a2,a1){return{name:aZ.name,value:a2}}):{name:aZ.name,value:a0}}).get()}});a.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(aY,aZ){a.fn[aZ]=function(a0){return this.bind(aZ,a0)}});a.extend({get:function(aY,a0,a1,aZ){if(a.isFunction(a0)){aZ=aZ||a1;a1=a0;a0=null}return a.ajax({type:"GET",url:aY,data:a0,success:a1,dataType:aZ})},getScript:function(aY,aZ){return a.get(aY,null,aZ,"script")},getJSON:function(aY,aZ,a0){return a.get(aY,aZ,a0,"json")},post:function(aY,a0,a1,aZ){if(a.isFunction(a0)){aZ=aZ||a1;a1=a0;a0={}}return a.ajax({type:"POST",url:aY,data:a0,success:a1,dataType:aZ})},ajaxSetup:function(aY){a.extend(a.ajaxSettings,aY)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aM.XMLHttpRequest&&(aM.location.protocol!=="file:"||!aM.ActiveXObject)?function(){return new aM.XMLHttpRequest()}:function(){try{return new aM.ActiveXObject("Microsoft.XMLHTTP")}catch(aY){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(bd){var a8=a.extend(true,{},a.ajaxSettings,bd);var bi,bc,bh,bj=bd&&bd.context||a8,a0=a8.type.toUpperCase();if(a8.data&&a8.processData&&typeof a8.data!=="string"){a8.data=a.param(a8.data,a8.traditional)}if(a8.dataType==="jsonp"){if(a0==="GET"){if(!r.test(a8.url)){a8.url+=(D.test(a8.url)?"&":"?")+(a8.jsonp||"callback")+"=?"}}else{if(!a8.data||!r.test(a8.data)){a8.data=(a8.data?a8.data+"&":"")+(a8.jsonp||"callback")+"=?"}}a8.dataType="json"}if(a8.dataType==="json"&&(a8.data&&r.test(a8.data)||r.test(a8.url))){bi=a8.jsonpCallback||("jsonp"+af++);if(a8.data){a8.data=(a8.data+"").replace(r,"="+bi+"$1")}a8.url=a8.url.replace(r,"="+bi+"$1");a8.dataType="script";aM[bi]=aM[bi]||function(bk){bh=bk;a3();a6();aM[bi]=C;try{delete aM[bi]}catch(bl){}if(a1){a1.removeChild(bf)}}}if(a8.dataType==="script"&&a8.cache===null){a8.cache=false}if(a8.cache===false&&a0==="GET"){var aY=aP();var bg=a8.url.replace(aX,"$1_="+aY+"$2");a8.url=bg+((bg===a8.url)?(D.test(a8.url)?"&":"?")+"_="+aY:"")}if(a8.data&&a0==="GET"){a8.url+=(D.test(a8.url)?"&":"?")+a8.data}if(a8.global&&!a.active++){a.event.trigger("ajaxStart")}var bb=B.exec(a8.url),a2=bb&&(bb[1]&&bb[1]!==location.protocol||bb[2]!==location.host);if(a8.dataType==="script"&&a0==="GET"&&a2){var a1=ab.getElementsByTagName("head")[0]||ab.documentElement;var bf=ab.createElement("script");bf.src=a8.url;if(a8.scriptCharset){bf.charset=a8.scriptCharset}if(!bi){var ba=false;bf.onload=bf.onreadystatechange=function(){if(!ba&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){ba=true;a3();a6();bf.onload=bf.onreadystatechange=null;if(a1&&bf.parentNode){a1.removeChild(bf)}}}}a1.insertBefore(bf,a1.firstChild);return C}var a5=false;var a4=a8.xhr();if(!a4){return}if(a8.username){a4.open(a0,a8.url,a8.async,a8.username,a8.password)}else{a4.open(a0,a8.url,a8.async)}try{if(a8.data||bd&&bd.contentType){a4.setRequestHeader("Content-Type",a8.contentType)}if(a8.ifModified){if(a.lastModified[a8.url]){a4.setRequestHeader("If-Modified-Since",a.lastModified[a8.url])}if(a.etag[a8.url]){a4.setRequestHeader("If-None-Match",a.etag[a8.url])}}if(!a2){a4.setRequestHeader("X-Requested-With","XMLHttpRequest")}a4.setRequestHeader("Accept",a8.dataType&&a8.accepts[a8.dataType]?a8.accepts[a8.dataType]+", */*":a8.accepts._default)}catch(be){}if(a8.beforeSend&&a8.beforeSend.call(bj,a4,a8)===false){if(a8.global&&!--a.active){a.event.trigger("ajaxStop")}a4.abort();return false}if(a8.global){a9("ajaxSend",[a4,a8])}var a7=a4.onreadystatechange=function(bk){if(!a4||a4.readyState===0||bk==="abort"){if(!a5){a6()}a5=true;if(a4){a4.onreadystatechange=a.noop}}else{if(!a5&&a4&&(a4.readyState===4||bk==="timeout")){a5=true;a4.onreadystatechange=a.noop;bc=bk==="timeout"?"timeout":!a.httpSuccess(a4)?"error":a8.ifModified&&a.httpNotModified(a4,a8.url)?"notmodified":"success";var bm;if(bc==="success"){try{bh=a.httpData(a4,a8.dataType,a8)}catch(bl){bc="parsererror";bm=bl}}if(bc==="success"||bc==="notmodified"){if(!bi){a3()}}else{a.handleError(a8,a4,bc,bm)}a6();if(bk==="timeout"){a4.abort()}if(a8.async){a4=null}}}};try{var aZ=a4.abort;a4.abort=function(){if(a4){aZ.call(a4)}a7("abort")}}catch(be){}if(a8.async&&a8.timeout>0){setTimeout(function(){if(a4&&!a5){a7("timeout")}},a8.timeout)}try{a4.send(a0==="POST"||a0==="PUT"||a0==="DELETE"?a8.data:null)}catch(be){a.handleError(a8,a4,null,be);a6()}if(!a8.async){a7()}function a3(){if(a8.success){a8.success.call(bj,bh,bc,a4)}if(a8.global){a9("ajaxSuccess",[a4,a8])}}function a6(){if(a8.complete){a8.complete.call(bj,a4,bc)}if(a8.global){a9("ajaxComplete",[a4,a8])}if(a8.global&&!--a.active){a.event.trigger("ajaxStop")}}function a9(bl,bk){(a8.context?a(a8.context):a.event).trigger(bl,bk)}return a4},handleError:function(aZ,a1,aY,a0){if(aZ.error){aZ.error.call(aZ.context||aZ,a1,aY,a0)}if(aZ.global){(aZ.context?a(aZ.context):a.event).trigger("ajaxError",[a1,aZ,a0])}},active:0,httpSuccess:function(aZ){try{return !aZ.status&&location.protocol==="file:"||(aZ.status>=200&&aZ.status<300)||aZ.status===304||aZ.status===1223||aZ.status===0}catch(aY){}return false},httpNotModified:function(a1,aY){var a0=a1.getResponseHeader("Last-Modified"),aZ=a1.getResponseHeader("Etag");if(a0){a.lastModified[aY]=a0}if(aZ){a.etag[aY]=aZ}return a1.status===304||a1.status===0},httpData:function(a3,a1,a0){var aZ=a3.getResponseHeader("content-type")||"",aY=a1==="xml"||!a1&&aZ.indexOf("xml")>=0,a2=aY?a3.responseXML:a3.responseText;if(aY&&a2.documentElement.nodeName==="parsererror"){a.error("parsererror")}if(a0&&a0.dataFilter){a2=a0.dataFilter(a2,a1)}if(typeof a2==="string"){if(a1==="json"||!a1&&aZ.indexOf("json")>=0){a2=a.parseJSON(a2)}else{if(a1==="script"||!a1&&aZ.indexOf("javascript")>=0){a.globalEval(a2)}}}return a2},param:function(aY,a1){var aZ=[];if(a1===C){a1=a.ajaxSettings.traditional}if(a.isArray(aY)||aY.jquery){a.each(aY,function(){a3(this.name,this.value)})}else{for(var a2 in aY){a0(a2,aY[a2])}}return aZ.join("&").replace(h,"+");function a0(a4,a5){if(a.isArray(a5)){a.each(a5,function(a7,a6){if(a1||/\[\]$/.test(a4)){a3(a4,a6)}else{a0(a4+"["+(typeof a6==="object"||a.isArray(a6)?a7:"")+"]",a6)}})}else{if(!a1&&a5!=null&&typeof a5==="object"){a.each(a5,function(a7,a6){a0(a4+"["+a7+"]",a6)})}else{a3(a4,a5)}}}function a3(a4,a5){a5=a.isFunction(a5)?a5():a5;aZ[aZ.length]=encodeURIComponent(a4)+"="+encodeURIComponent(a5)}}});var G={},ae=/toggle|show|hide/,au=/^([+-]=)?([\d+-.]+)(.*)$/,aF,aj=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.fn.extend({show:function(aZ,a7){if(aZ||aZ===0){return this.animate(aD("show",3),aZ,a7)}else{for(var a4=0,a1=this.length;a4<a1;a4++){var aY=a.data(this[a4],"olddisplay");this[a4].style.display=aY||"";if(a.css(this[a4],"display")==="none"){var a6=this[a4].nodeName,a5;if(G[a6]){a5=G[a6]}else{var a0=a("<"+a6+" />").appendTo("body");a5=a0.css("display");if(a5==="none"){a5="block"}a0.remove();G[a6]=a5}a.data(this[a4],"olddisplay",a5)}}for(var a3=0,a2=this.length;a3<a2;a3++){this[a3].style.display=a.data(this[a3],"olddisplay")||""}return this}},hide:function(a3,a4){if(a3||a3===0){return this.animate(aD("hide",3),a3,a4)}else{for(var a2=0,aZ=this.length;a2<aZ;a2++){var aY=a.data(this[a2],"olddisplay");if(!aY&&aY!=="none"){a.data(this[a2],"olddisplay",a.css(this[a2],"display"))}}for(var a1=0,a0=this.length;a1<a0;a1++){this[a1].style.display="none"}return this}},_toggle:a.fn.toggle,toggle:function(a0,aZ){var aY=typeof a0==="boolean";if(a.isFunction(a0)&&a.isFunction(aZ)){this._toggle.apply(this,arguments)}else{if(a0==null||aY){this.each(function(){var a1=aY?a0:a(this).is(":hidden");a(this)[a1?"show":"hide"]()})}else{this.animate(aD("toggle",3),a0,aZ)}}return this},fadeTo:function(aY,a0,aZ){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:a0},aY,aZ)},animate:function(a2,aZ,a1,a0){var aY=a.speed(aZ,a1,a0);if(a.isEmptyObject(a2)){return this.each(aY.complete)}return this[aY.queue===false?"each":"queue"](function(){var a5=a.extend({},aY),a7,a6=this.nodeType===1&&a(this).is(":hidden"),a3=this;for(a7 in a2){var a4=a7.replace(az,k);if(a7!==a4){a2[a4]=a2[a7];delete a2[a7];a7=a4}if(a2[a7]==="hide"&&a6||a2[a7]==="show"&&!a6){return a5.complete.call(this)}if((a7==="height"||a7==="width")&&this.style){a5.display=a.css(this,"display");a5.overflow=this.style.overflow}if(a.isArray(a2[a7])){(a5.specialEasing=a5.specialEasing||{})[a7]=a2[a7][1];a2[a7]=a2[a7][0]}}if(a5.overflow!=null){this.style.overflow="hidden"}a5.curAnim=a.extend({},a2);a.each(a2,function(a9,bd){var bc=new a.fx(a3,a5,a9);if(ae.test(bd)){bc[bd==="toggle"?a6?"show":"hide":bd](a2)}else{var bb=au.exec(bd),be=bc.cur(true)||0;if(bb){var a8=parseFloat(bb[2]),ba=bb[3]||"px";if(ba!=="px"){a3.style[a9]=(a8||1)+ba;be=((a8||1)/bc.cur(true))*be;a3.style[a9]=be+ba}if(bb[1]){a8=((bb[1]==="-="?-1:1)*a8)+be}bc.custom(be,a8,ba)}else{bc.custom(be,bd,"")}}});return true})},stop:function(aZ,aY){var a0=a.timers;if(aZ){this.queue([])}this.each(function(){for(var a1=a0.length-1;a1>=0;a1--){if(a0[a1].elem===this){if(aY){a0[a1](true)}a0.splice(a1,1)}}});if(!aY){this.dequeue()}return this}});a.each({slideDown:aD("show",1),slideUp:aD("hide",1),slideToggle:aD("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(aY,aZ){a.fn[aY]=function(a0,a1){return this.animate(aZ,a0,a1)}});a.extend({speed:function(a0,a1,aZ){var aY=a0&&typeof a0==="object"?a0:{complete:aZ||!aZ&&a1||a.isFunction(a0)&&a0,duration:a0,easing:aZ&&a1||a1&&!a.isFunction(a1)&&a1};aY.duration=a.fx.off?0:typeof aY.duration==="number"?aY.duration:a.fx.speeds[aY.duration]||a.fx.speeds._default;aY.old=aY.complete;aY.complete=function(){if(aY.queue!==false){a(this).dequeue()}if(a.isFunction(aY.old)){aY.old.call(this)}};return aY},easing:{linear:function(a0,a1,aY,aZ){return aY+aZ*a0},swing:function(a0,a1,aY,aZ){return((-Math.cos(a0*Math.PI)/2)+0.5)*aZ+aY}},timers:[],fx:function(aZ,aY,a0){this.options=aY;this.elem=aZ;this.prop=a0;if(!aY.orig){aY.orig={}}}});a.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(a.fx.step[this.prop]||a.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(aZ){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var aY=parseFloat(a.css(this.elem,this.prop,aZ));return aY&&aY>-10000?aY:parseFloat(a.curCSS(this.elem,this.prop))||0},custom:function(a2,a1,a0){this.startTime=aP();this.start=a2;this.end=a1;this.unit=a0||this.unit||"px";this.now=this.start;this.pos=this.state=0;var aY=this;function aZ(a3){return aY.step(a3)}aZ.elem=this.elem;if(aZ()&&a.timers.push(aZ)&&!aF){aF=setInterval(a.fx.tick,13)}},show:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());a(this.elem).show()},hide:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a1){var a6=aP(),a2=true;if(a1||a6>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var a3 in this.options.curAnim){if(this.options.curAnim[a3]!==true){a2=false}}if(a2){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var a0=a.data(this.elem,"olddisplay");this.elem.style.display=a0?a0:this.options.display;if(a.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){a(this.elem).hide()}if(this.options.hide||this.options.show){for(var aY in this.options.curAnim){a.style(this.elem,aY,this.options.orig[aY])}}this.options.complete.call(this.elem)}return false}else{var aZ=a6-this.startTime;this.state=aZ/this.options.duration;var a4=this.options.specialEasing&&this.options.specialEasing[this.prop];var a5=this.options.easing||(a.easing.swing?"swing":"linear");this.pos=a.easing[a4||a5](this.state,aZ,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};a.extend(a.fx,{tick:function(){var aZ=a.timers;for(var aY=0;aY<aZ.length;aY++){if(!aZ[aY]()){aZ.splice(aY--,1)}}if(!aZ.length){a.fx.stop()}},stop:function(){clearInterval(aF);aF=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(aY){a.style(aY.elem,"opacity",aY.now)},_default:function(aY){if(aY.elem.style&&aY.elem.style[aY.prop]!=null){aY.elem.style[aY.prop]=(aY.prop==="width"||aY.prop==="height"?Math.max(0,aY.now):aY.now)+aY.unit}else{aY.elem[aY.prop]=aY.now}}}});if(a.expr&&a.expr.filters){a.expr.filters.animated=function(aY){return a.grep(a.timers,function(aZ){return aY===aZ.elem}).length}}function aD(aZ,aY){var a0={};a.each(aj.concat.apply([],aj.slice(0,aY)),function(){a0[this]=aZ});return a0}if("getBoundingClientRect" in ab.documentElement){a.fn.offset=function(a7){var a0=this[0];if(a7){return this.each(function(a8){a.offset.setOffset(this,a7,a8)})}if(!a0||!a0.ownerDocument){return null}if(a0===a0.ownerDocument.body){return a.offset.bodyOffset(a0)}var a2=a0.getBoundingClientRect(),a6=a0.ownerDocument,a3=a6.body,aY=a6.documentElement,a1=aY.clientTop||a3.clientTop||0,a4=aY.clientLeft||a3.clientLeft||0,a5=a2.top+(self.pageYOffset||a.support.boxModel&&aY.scrollTop||a3.scrollTop)-a1,aZ=a2.left+(self.pageXOffset||a.support.boxModel&&aY.scrollLeft||a3.scrollLeft)-a4;return{top:a5,left:aZ}}}else{a.fn.offset=function(a9){var a3=this[0];if(a9){return this.each(function(ba){a.offset.setOffset(this,a9,ba)})}if(!a3||!a3.ownerDocument){return null}if(a3===a3.ownerDocument.body){return a.offset.bodyOffset(a3)}a.offset.initialize();var a0=a3.offsetParent,aZ=a3,a8=a3.ownerDocument,a6,a1=a8.documentElement,a4=a8.body,a5=a8.defaultView,aY=a5?a5.getComputedStyle(a3,null):a3.currentStyle,a7=a3.offsetTop,a2=a3.offsetLeft;while((a3=a3.parentNode)&&a3!==a4&&a3!==a1){if(a.offset.supportsFixedPosition&&aY.position==="fixed"){break}a6=a5?a5.getComputedStyle(a3,null):a3.currentStyle;a7-=a3.scrollTop;a2-=a3.scrollLeft;if(a3===a0){a7+=a3.offsetTop;a2+=a3.offsetLeft;if(a.offset.doesNotAddBorder&&!(a.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a3.nodeName))){a7+=parseFloat(a6.borderTopWidth)||0;a2+=parseFloat(a6.borderLeftWidth)||0}aZ=a0,a0=a3.offsetParent}if(a.offset.subtractsBorderForOverflowNotVisible&&a6.overflow!=="visible"){a7+=parseFloat(a6.borderTopWidth)||0;a2+=parseFloat(a6.borderLeftWidth)||0}aY=a6}if(aY.position==="relative"||aY.position==="static"){a7+=a4.offsetTop;a2+=a4.offsetLeft}if(a.offset.supportsFixedPosition&&aY.position==="fixed"){a7+=Math.max(a1.scrollTop,a4.scrollTop);a2+=Math.max(a1.scrollLeft,a4.scrollLeft)}return{top:a7,left:a2}}}a.offset={initialize:function(){var aY=ab.body,aZ=ab.createElement("div"),a2,a4,a3,a5,a0=parseFloat(a.curCSS(aY,"marginTop",true))||0,a1="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.extend(aZ.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});aZ.innerHTML=a1;aY.insertBefore(aZ,aY.firstChild);a2=aZ.firstChild;a4=a2.firstChild;a5=a2.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(a4.offsetTop!==5);this.doesAddBorderForTableAndCells=(a5.offsetTop===5);a4.style.position="fixed",a4.style.top="20px";this.supportsFixedPosition=(a4.offsetTop===20||a4.offsetTop===15);a4.style.position=a4.style.top="";a2.style.overflow="hidden",a2.style.position="relative";this.subtractsBorderForOverflowNotVisible=(a4.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(aY.offsetTop!==a0);aY.removeChild(aZ);aY=aZ=a2=a4=a3=a5=null;a.offset.initialize=a.noop},bodyOffset:function(aY){var a0=aY.offsetTop,aZ=aY.offsetLeft;a.offset.initialize();if(a.offset.doesNotIncludeMarginInBodyOffset){a0+=parseFloat(a.curCSS(aY,"marginTop",true))||0;aZ+=parseFloat(a.curCSS(aY,"marginLeft",true))||0}return{top:a0,left:aZ}},setOffset:function(a3,aZ,a0){if(/static/.test(a.curCSS(a3,"position"))){a3.style.position="relative"}var a2=a(a3),a5=a2.offset(),aY=parseInt(a.curCSS(a3,"top",true),10)||0,a4=parseInt(a.curCSS(a3,"left",true),10)||0;if(a.isFunction(aZ)){aZ=aZ.call(a3,a0,a5)}var a1={top:(aZ.top-a5.top)+aY,left:(aZ.left-a5.left)+a4};if("using" in aZ){aZ.using.call(a3,a1)}else{a2.css(a1)}}};a.fn.extend({position:function(){if(!this[0]){return null}var a0=this[0],aZ=this.offsetParent(),a1=this.offset(),aY=/^body|html$/i.test(aZ[0].nodeName)?{top:0,left:0}:aZ.offset();a1.top-=parseFloat(a.curCSS(a0,"marginTop",true))||0;a1.left-=parseFloat(a.curCSS(a0,"marginLeft",true))||0;aY.top+=parseFloat(a.curCSS(aZ[0],"borderTopWidth",true))||0;aY.left+=parseFloat(a.curCSS(aZ[0],"borderLeftWidth",true))||0;return{top:a1.top-aY.top,left:a1.left-aY.left}},offsetParent:function(){return this.map(function(){var aY=this.offsetParent||ab.body;while(aY&&(!/^body|html$/i.test(aY.nodeName)&&a.css(aY,"position")==="static")){aY=aY.offsetParent}return aY})}});a.each(["Left","Top"],function(aZ,aY){var a0="scroll"+aY;a.fn[a0]=function(a3){var a1=this[0],a2;if(!a1){return null}if(a3!==C){return this.each(function(){a2=am(this);if(a2){a2.scrollTo(!aZ?a3:a(a2).scrollLeft(),aZ?a3:a(a2).scrollTop())}else{this[a0]=a3}})}else{a2=am(a1);return a2?("pageXOffset" in a2)?a2[aZ?"pageYOffset":"pageXOffset"]:a.support.boxModel&&a2.document.documentElement[a0]||a2.document.body[a0]:a1[a0]}}});function am(aY){return("scrollTo" in aY&&aY.document)?aY:aY.nodeType===9?aY.defaultView||aY.parentWindow:false}a.each(["Height","Width"],function(aZ,aY){var a0=aY.toLowerCase();a.fn["inner"+aY]=function(){return this[0]?a.css(this[0],a0,false,"padding"):null};a.fn["outer"+aY]=function(a1){return this[0]?a.css(this[0],a0,false,a1?"margin":"border"):null};a.fn[a0]=function(a1){var a2=this[0];if(!a2){return a1==null?null:this}if(a.isFunction(a1)){return this.each(function(a4){var a3=a(this);a3[a0](a1.call(this,a4,a3[a0]()))})}return("scrollTo" in a2&&a2.document)?a2.document.compatMode==="CSS1Compat"&&a2.document.documentElement["client"+aY]||a2.document.body["client"+aY]:(a2.nodeType===9)?Math.max(a2.documentElement["client"+aY],a2.body["scroll"+aY],a2.documentElement["scroll"+aY],a2.body["offset"+aY],a2.documentElement["offset"+aY]):a1===C?a.css(a2,a0):this.css(a0,typeof a1==="string"?a1:a1+"px")}});aM.jQuery=aM.$=a})(window);(function(bU,r,bi){var b8=bU.jQuery.noConflict(true);if(typeof r.getAttribute==q){r.getAttribute=function(){}}var am=function(cV){return ci(cV)?cV.toLowerCase():cV};var bI=function(cV){return ci(cV)?cV.toUpperCase():cV};var aE=function(cV){return ci(cV)?cV.replace(/[A-Z]/g,function(cW){return G(cW.charCodeAt(0)|32)}):cV};var ce=function(cV){return ci(cV)?cV.replace(/[a-z]/g,function(cW){return G(cW.charCodeAt(0)&~32)}):cV};if("i"!=="I".toLowerCase()){am=aE;bI=ce}function G(cV){return String.fromCharCode(cV)}var cS=undefined,a6=null,by="$element",ac="$update",bR="$scope",bf="$validate",R="angular",a3="array",b9="boolean",bA="console",bc="date",aL="display",cC="element",bz="function",ai="length",Y="name",b="none",cE="noop",v="null",ch="number",aP="object",P="string",ay="value",aA="selected",q="undefined",a="ng-exception",k="ng-validation-error",o="noop",bp=-99999,an=-1000,cg=99999,aM={FIRST:bp,LAST:cg,WATCH:an},cK=bU.Error,cx=bU.jQuery||bU["$"],ca=bU._,at=parseInt((/msie (\d+)/.exec(am(navigator.userAgent))||[])[1],10),ck=cx||cL,ad=Array.prototype.slice,C=Array.prototype.push,cG=bU[bA]?bF(bU[bA],bU[bA]["error"]||j):j,aB=bU[R]||(bU[R]={}),ag=bo(aB,"markup"),s=bo(aB,"attrMarkup"),Z=bo(aB,"directive"),B=bo(aB,"widget",am),aK=bo(aB,"validator"),cu=bo(aB,"filter"),l=bo(aB,"formatter"),bs=bo(aB,"service"),bg=bo(aB,"callbacks"),au,ab=/^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/;function aS(cY,cX,cW){var cV;if(cY){if(E(cY)){for(cV in cY){if(cV!="prototype"&&cV!=ai&&cV!=Y&&cY.hasOwnProperty(cV)){cX.call(cW,cY[cV],cV)}}}else{if(cY.forEach){cY.forEach(cX,cW)}else{if(cR(cY)&&aU(cY.length)){for(cV=0;cV<cY.length;cV++){cX.call(cW,cY[cV],cV)}}else{for(cV in cY){cX.call(cW,cY[cV],cV)}}}}}return cY}function ar(c0,cY,cX){var cZ=[];for(var cW in c0){cZ.push(cW)}cZ.sort();for(var cV=0;cV<cZ.length;cV++){cY.call(cX,c0[cZ[cV]],cZ[cV])}return cZ}function bb(cV){if(cV instanceof cK){if(cV.stack){cV=cV.stack}else{if(cV.sourceURL){cV=cV.message+"\n"+cV.sourceURL+":"+cV.line}}}return cV}function b7(cV){aS(arguments,function(cW){if(cW!==cV){aS(cW,function(cY,cX){cV[cX]=cY})}});return cV}function b5(cW,cV){return b7(new (b7(function(){},{prototype:cW}))(),cV)}function j(){}function aG(cV){return cV}function cr(cV){return function(){return cV}}function bo(cX,cW,cV){var cY;return cX[cW]||(cY=cX[cW]=function(cZ,c0,c1){cZ=(cV||aG)(cZ);if(cv(c0)){if(cv(cY[cZ])){aS(cY[cZ],function(c3,c2){if(c2.charAt(0)=="$"&&bB(c0[c2])){c0[c2]=c3}})}cY[cZ]=b7(c0,c1||{})}return cY[cZ]})}function cL(cV){if(cV){if(ci(cV)){var cW=r.createElement("div");cW.innerHTML=cV;cV=new bu(cW.childNodes)}else{if(!(cV instanceof bu)&&bJ(cV)){cV=new bu(cV)}}}return cV}function bB(cV){return typeof cV==q}function cv(cV){return typeof cV!=q}function cR(cV){return cV!=a6&&typeof cV==aP}function ci(cV){return typeof cV==P}function aU(cV){return typeof cV==ch}function ax(cV){return cV instanceof Date}function a9(cV){return cV instanceof Array}function E(cV){return typeof cV==bz}function be(cV){return typeof cV==b9}function t(cV){return au(cV)=="#text"}function av(cV){return ci(cV)?cV.replace(/^\s*/,"").replace(/\s*$/,""):cV}function bJ(cV){return cV&&(cV.nodeName||cV instanceof bu||(cx&&cV instanceof cx))}function aW(cW,cX){this.html=cW;this.get=am(cX)=="unsafe"?cr(cW):function cV(){var cY=[];aQ(cW,a5(cY));return cY.join("")}}if(at){au=function(cV){cV=cV.nodeName?cV:cV[0];return(cV.scopeName&&cV.scopeName!="HTML")?bI(cV.scopeName+":"+cV.nodeName):cV.nodeName}}else{au=function(cV){return cV.nodeName?cV.nodeName:cV[0].nodeName}}function A(cV){return ck(cV[0].cloneNode(true))}function aR(cW){var cY=cW[0].getBoundingClientRect(),cX=(cY.width||(cY.right||0-cY.left||0)),cV=(cY.height||(cY.bottom||0-cY.top||0));return cX>0&&cV>0}function aI(cY,cX,cW){var cV=[];aS(cY,function(c1,cZ,c0){cV.push(cX.call(cW,c1,cZ,c0))});return cV}function aw(cW){var cV=0;if(cW){if(aU(cW.length)){return cW.length}else{if(cR(cW)){for(key in cW){cV++}}}}return cV}function u(cX,cW){for(var cV=0;cV<cX.length;cV++){if(cW===cX[cV]){return true}}return false}function cO(cX,cW){for(var cV=0;cV<cX.length;cV++){if(cW===cX[cV]){return cV}}return -1}function b4(cV){if(cV){switch(cV.nodeName){case"OPTION":case"PRE":case"TITLE":return true}}return false}function bv(cY,cV){if(!cV){cV=cY;if(cY){if(a9(cY)){cV=bv(cY,[])}else{if(ax(cY)){cV=new Date(cY.getTime())}else{if(cR(cY)){cV=bv(cY,{})}}}}}else{if(a9(cY)){while(cV.length){cV.pop()}for(var cX=0;cX<cY.length;cX++){cV.push(bv(cY[cX]))}}else{aS(cV,function(c0,cZ){delete cV[cZ]});for(var cW in cY){cV[cW]=bv(cY[cW])}}}return cV}function p(c1,c0){if(c1==c0){return true}var cZ=typeof c1,cX=typeof c0,cY,cW,cV;if(cZ==cX&&cZ=="object"){if(c1 instanceof Array){if((cY=c1.length)==c0.length){for(cW=0;cW<cY;cW++){if(!p(c1[cW],c0[cW])){return false}}return true}}else{cV={};for(cW in c1){if(cW.charAt(0)!=="$"&&!E(c1[cW])&&!p(c1[cW],c0[cW])){return false}cV[cW]=true}for(cW in c0){if(!cV[cW]&&cW.charAt(0)!=="$"&&!E(c0[cW])){return false}}return true}}return false}function U(cW,cV){if(b4(cW)){if(at){cW.innerText=cV}else{cW.textContent=cV}}else{cW.innerHTML=cV}}function bM(cW){var cV=cW&&cW[0]&&cW[0].nodeName;return cV&&cV.charAt(0)!="#"&&!u(["TR","COL","COLGROUP","TBODY","THEAD","TFOOT"],cV)}function b0(cW,cX,cV){while(!bM(cW)){cW=cW.parent()||ck(r.body)}if(cW[0]["$NG_ERROR"]!==cV){cW[0]["$NG_ERROR"]=cV;if(cV){cW.addClass(cX);cW.attr(cX,cV)}else{cW.removeClass(cX);cW.removeAttr(cX)}}}function bd(cX,cW,cV){return cX.concat(ad.call(cW,cV,cW.length))}function bF(cW,cX){var cV=arguments.length>2?ad.call(arguments,2,arguments.length):[];if(typeof cX==bz){return cV.length?function(){return arguments.length?cX.apply(cW,cV.concat(ad.call(arguments,0,arguments.length))):cX.apply(cW,cV)}:function(){return arguments.length?cX.apply(cW,arguments):cX.call(cW)}}else{return cX}}function cp(cW){if(cW&&cW.length!==0){var cV=am(""+cW);cW=!(cV=="f"||cV=="0"||cV=="false"||cV=="no"||cV=="n"||cV=="[]")}else{cW=false}return cW}function bm(cY,cZ){for(var cV in cY){var cX=cZ[cV];var cW=typeof cX;if(cW==q){cZ[cV]=Q(cm(cY[cV]))}else{if(cW=="object"&&cX.constructor!=F&&cV.substring(0,1)!="$"){bm(cY[cV],cX)}}}}function a2(cW,cY){var cX=new ba(ag,s,Z,B),cV=ck(cW);return cX.compile(cV)(cV,cY)}function ah(cY){var cX={},cV,cW;aS((cY||"").split("&"),function(cZ){if(cZ){cV=cZ.split("=");cW=unescape(cV[0]);cX[cW]=cv(cV[1])?unescape(cV[1]):true}});return cX}function N(cW){var cV=[];aS(cW,function(cY,cX){cV.push(escape(cX)+(cY===true?"":"="+escape(cY)))});return cV.length?cV.join("&"):""}function bw(cW){if(cW.autobind){var cX=a2(bU.document,a6,{"$config":cW}),cV=cX.$inject("$browser");if(cW.css){cV.addCss(cW.base_url+cW.css)}else{if(at<8){cV.addJs(cW.base_url+cW.ie_compat,cW.ie_compat_id)}}cX.$init()}}function bH(cW,cZ){var cV=cW.getElementsByTagName("script"),cY;cZ=b7({ie_compat_id:"ng-ie-compat"},cZ);for(var cX=0;cX<cV.length;cX++){cY=(cV[cX].src||"").match(ab);if(cY){cZ.base_url=cY[1];cZ.ie_compat=cY[1]+"angular-ie-compat"+(cY[2]||"")+".js";b7(cZ,ah(cY[6]));a4(ck(cV[cX]),function(c1,c0){if(/^ng:/.exec(c0)){c0=c0.substring(3).replace(/-/g,"_");if(c0=="autobind"){c1=true}cZ[c0]=c1}})}}return cZ}var F=[].constructor;function cm(cX,cW){var cV=[];bS(cV,cX,cW?"\n ":a6,[]);return cV.join("")}function Q(cV){if(!cV){return cV}try{var cX=S(cV,true);var cY=cX.primary();cX.assertAllConsumed();return cY()}catch(cW){cG("fromJson error: ",cV,cW);throw cW}}aB.toJson=cm;aB.fromJson=Q;function bS(cW,cY,c1,c2){if(cR(cY)){if(cY===bU){cW.push("WINDOW");return}if(cY===r){cW.push("DOCUMENT");return}if(u(c2,cY)){cW.push("RECURSION");return}c2.push(cY)}if(cY===a6){cW.push(v)}else{if(cY instanceof RegExp){cW.push(aB.String["quoteUnicode"](cY.toString()))}else{if(E(cY)){return}else{if(be(cY)){cW.push(""+cY)}else{if(aU(cY)){if(isNaN(cY)){cW.push(v)}else{cW.push(""+cY)}}else{if(ci(cY)){return cW.push(aB.String["quoteUnicode"](cY))}else{if(cR(cY)){if(a9(cY)){cW.push("[");var c0=cY.length;var c9=false;for(var cZ=0;cZ<c0;cZ++){var c6=cY[cZ];if(c9){cW.push(",")}if(!(c6 instanceof RegExp)&&(E(c6)||bB(c6))){cW.push(v)}else{bS(cW,c6,c1,c2)}c9=true}cW.push("]")}else{if(ax(cY)){cW.push(aB.String["quoteUnicode"](aB.Date["toString"](cY)))}else{cW.push("{");if(c1){cW.push(c1)}var c8=false;var c7=c1?c1+" ":false;var c5=[];for(var cX in cY){if(cY[cX]===cS){continue}c5.push(cX)}c5.sort();for(var cV=0;cV<c5.length;cV++){var c4=c5[cV];var c3=cY[c4];if(typeof c3!=bz){if(c8){cW.push(",");if(c1){cW.push(c1)}}cW.push(aB.String["quote"](c4));cW.push(":");bS(cW,c3,c7,c2);c8=true}}cW.push("}")}}}}}}}}}if(cR(cY)){c2.pop()}}function cw(cV){this.paths=[];this.children=[];this.inits=[];this.priority=cV;this.newScope=false}cw.prototype={init:function(cV,cW){var cX={};this.collectInits(cV,cX,cW);ar(cX,function(cY){aS(cY,function(cZ){cZ()})})},collectInits:function(cX,c0,c3){var cZ=c0[this.priority],c1=c3;if(!cZ){c0[this.priority]=cZ=[]}cX=ck(cX);if(this.newScope){c1=bV(c3);c3.$onEval(c1.$eval);cX.data(bR,c1)}aS(this.inits,function(c5){cZ.push(function(){c1.$tryEval(function(){return c1.$inject(c5,c1,cX)},cX)})});var cY,c2=cX[0].childNodes,cW=this.children,c4=this.paths,cV=c4.length;for(cY=0;cY<cV;cY++){cW[cY].collectInits(c2[c4[cY]],c0,c1)}},addInit:function(cV){if(cV){this.inits.push(cV)}},addChild:function(cV,cW){if(cW){this.paths.push(cV);this.children.push(cW)}},empty:function(){return this.inits.length===0&&this.paths.length===0}};function ae(cV){var cW;while(cV&&!(cW=cV.data(bR))){cV=cV.parent()}return cW}function ba(cV,cW,cY,cX){this.markup=cV;this.attrMarkup=cW;this.directives=cY;this.widgets=cX}ba.prototype={compile:function(cZ){cZ=ck(cZ);var cV=0,cY,cX=cZ.parent();if(cX&&cX[0]){cX=cX[0];for(var cW=0;cW<cX.childNodes.length;cW++){if(cX.childNodes[cW]==cZ[0]){cV=cW}}}cY=this.templatize(cZ,cV,0)||new cw();return function(c0,c2){c0=ck(c0);var c1=c2&&c2.$eval?c2:bV(c2);c0.data(bR,c1);return b7(c1,{$element:c0,$init:function(){cY.init(c0,c1);c1.$eval();delete c1.$init;return c1}})}},templatize:function(c0,cW,c5){var c9=this,c1,c4,cX=c9.directives,c3=true,cY=true,da=au(c0),c8,c7={compile:bF(c9,c9.compile),comment:function(db){return ck(r.createComment(db))},element:function(db){return ck(r.createElement(db))},text:function(db){return ck(r.createTextNode(db))},descend:function(db){if(cv(db)){c3=db}return c3},directives:function(db){if(cv(db)){cY=db}return cY},scope:function(db){if(cv(db)){c8.newScope=c8.newScope||db}return c8.newScope}};try{c5=c0.attr("ng:eval-order")||c5||0}catch(c2){c5=c5||0}if(ci(c5)){c5=aM[bI(c5)]||parseInt(c5,10)}c8=new cw(c5);a4(c0,function(dc,db){if(!c1){if(c1=c9.widgets("@"+db)){c0.addClass("ng-attr-widget");c1=bF(c7,c1,dc,c0)}}});if(!c1){if(c1=c9.widgets(da)){if(da.indexOf(":")>0){c0.addClass("ng-widget")}c1=bF(c7,c1,c0)}}if(c1){c3=false;cY=false;var c6=c0.parent();c8.addInit(c1.call(c7,c0));if(c6&&c6[0]){c0=ck(c6[0].childNodes[cW])}}if(c3){for(var cZ=0,cV=c0[0].childNodes;cZ<cV.length;cZ++){if(t(cV[cZ])){aS(c9.markup,function(db){if(cZ<cV.length){var dc=ck(cV[cZ]);db.call(c7,dc.text(),dc,c0)}})}}}if(cY){a4(c0,function(dc,db){aS(c9.attrMarkup,function(dd){dd.call(c7,dc,db,c0)})});a4(c0,function(dc,db){c4=cX[db];if(c4){c0.addClass("ng-directive");c8.addInit((cX[db]).call(c7,dc,c0))}})}if(c3){aX(c0,function(dc,db){c8.addChild(db,c9.templatize(dc,db,c5))})}return c8.empty()?a6:c8}};function aX(cW,cX){var cV,cZ=cW[0].childNodes||[],cY;for(cV=0;cV<cZ.length;cV++){if(!t(cY=cZ[cV])){cX(ck(cY),cV)}}}function a4(cW,c0){var cX,c3=cW[0].attributes||[],c2,cZ,cV,c1,cY={};for(cX=0;cX<c3.length;cX++){cZ=c3[cX];cV=cZ.name;c1=cZ.value;if(at&&cV=="href"){c1=decodeURIComponent(cW[0].getAttribute(cV,2))}cY[cV]=c1}ar(cY,c0)}function bQ(c3,c4,c1){if(!c4){return c3}var cW=c4.split(".");var c2;var cV=c3;var cY=cW.length;for(var cX=0;cX<cY;cX++){c2=cW[cX];if(!c2.match(/^[\$\w][\$\w\d]*$/)){throw"Expression '"+c4+"' is not a valid expression for accesing variables."}if(c3){cV=c3;c3=c3[c2]}if(bB(c3)&&c2.charAt(0)=="$"){var cZ=aB.Global["typeOf"](cV);cZ=aB[cZ.charAt(0).toUpperCase()+cZ.substring(1)];var c0=cZ?cZ[[c2.substring(1)]]:cS;if(c0){c3=bF(cV,c0,cV);return c3}}}if(!c1&&E(c3)){return bF(cV,c3)}return c3}function cd(cV,c1,c0){var cZ=c1.split(".");for(var cY=0;cZ.length>1;cY++){var cX=cZ.shift();var cW=cV[cX];if(!cW){cW={};cV[cX]=cW}cV=cW}cV[cZ.shift()]=c0;return c0}var az=0,cD={},aN={},cN={};aS(("abstract,boolean,break,byte,case,catch,char,class,const,continue,debugger,default,delete,do,double,else,enum,export,extends,false,final,finally,float,for,function,goto,if,implements,import,ininstanceof,intinterface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,typeof,var,volatile,void,undefined,while,with").split(/,/),function(cV){cN[cV]=true});function co(cX){var cV=cD[cX];if(cV){return cV}var cW="var l, fn, t;\n";aS(cX.split("."),function(cZ){cZ=(cN[cZ])?'["'+cZ+'"]':"."+cZ;cW+="if(!s) return s;\nl=s;\ns=s"+cZ+';\nif(typeof s=="function" && !(s instanceof RegExp)) s = function(){ return l'+cZ+".apply(l, arguments); };\n";if(cZ.charAt(1)=="$"){var cY=cZ.substr(2);cW+='if(!s) {\n t = angular.Global.typeOf(l);\n fn = (angular[t.charAt(0).toUpperCase() + t.substring(1)]||{})["'+cY+'"];\n if (fn) s = function(){ return fn.apply(l, [l].concat(Array.prototype.slice.call(arguments, 0, arguments.length))); };\n}\n'}});cW+="return s;";cV=Function("s",cW);cV.toString=function(){return cW};return cD[cX]=cV}function bt(cY){if(typeof cY===bz){return cY}var cV=aN[cY];if(!cV){var cW=S(cY);var cX=cW.statements();cW.assertAllConsumed();cV=aN[cY]=b7(function(){return cX(this)},{fnSelf:cX})}return cV}function ao(cW,cV){b0(cW,a,cv(cV)?bb(cV):cV)}function bV(cY,c0,cW){function cX(){}cY=cX.prototype=(cY||{});var cV=new cX();var cZ={sorted:[]};b7(cV,{"this":cV,$id:(az++),$parent:cY,$bind:bF(cV,bF,cV),$get:bF(cV,bQ,cV),$set:bF(cV,cd,cV),$eval:function(c7){var c6=typeof c7;var c4,c3;var c2,c8;var c1;var c5;if(c6==q){for(c4=0,c3=cZ.sorted.length;c4<c3;c4++){for(c1=cZ.sorted[c4],c8=c1.length,c2=0;c2<c8;c2++){cV.$tryEval(c1[c2].fn,c1[c2].handler)}}}else{if(c6===bz){return c7.call(cV)}else{if(c6==="string"){return bt(c7).call(cV)}}}},$tryEval:function(c4,c1){var c2=typeof c4;try{if(c2==bz){return c4.call(cV)}else{if(c2=="string"){return bt(c4).call(cV)}}}catch(c3){(cV.$log||{error:cG}).error(c3);if(E(c1)){c1(c3)}else{if(c1){ao(c1,c3)}else{if(E(cV.$exceptionHandler)){cV.$exceptionHandler(c3)}}}}},$watch:function(c6,c5,c2,c1){var c7=bt(c6),c4=c7.call(cV);c5=bt(c5);function c3(da){var c9=c7.call(cV),c8=c4;if(da||c8!==c9){c4=c9;cV.$tryEval(function(){return c5.call(cV,c9,c8)},c2)}}cV.$onEval(an,c3);if(bB(c1)){c1=true}if(c1){c3(true)}},$onEval:function(c2,c4,c1){if(!aU(c2)){c1=c4;c4=c2;c2=0}var c3=cZ[c2];if(!c3){c3=cZ[c2]=[];c3.priority=c2;cZ.sorted.push(c3);cZ.sorted.sort(function(c6,c5){return c6.priority-c5.priority})}c3.push({fn:bt(c4),handler:c1})},$become:function(c1){if(E(c1)){cV.constructor=c1;aS(c1.prototype,function(c3,c2){cV[c2]=bF(cV,c3)});cV.$inject.apply(cV,bd([c1,cV],arguments,1));if(E(c1.prototype.init)){cV.init()}}},$new:function(c1){var c2=bV(cV);c2.$become.apply(cV,bd([c1],arguments,1));cV.$onEval(c2.$eval);return c2}});if(!cY.$root){cV.$root=cV;cV.$parent=cV;(cV.$inject=bY(cV,c0,cW))()}return cV}function bY(cW,cY,cV){cY=cY||bs;cV=cV||{};cW=cW||{};return function cX(c3,c2,c0){var c1,c4,cZ;if(ci(c3)){if(!cV.hasOwnProperty(c3)){c4=cY[c3];if(!c4){throw"Unknown provider for '"+c3+"'."}cV[c3]=cX(c4,cW)}c1=cV[c3]}else{if(a9(c3)){c1=[];aS(c3,function(c5){c1.push(cX(c5))})}else{if(E(c3)){c1=cX(c3.$inject||[]);c1=c3.apply(c2,bd(c1,arguments,2))}else{if(cR(c3)){aS(cY,function(c6,c5){cZ=c6.$creation;if(cZ=="eager"){cX(c5)}if(cZ=="eager-published"){cd(c3,c5,cX(c5))}})}else{c1=cX(cW)}}}}return c1}}var J={"null":function(cV){return a6},"true":function(cV){return true},"false":function(cV){return false},$undefined:j,"+":function(cX,cW,cV){return(cv(cW)?cW:0)+(cv(cV)?cV:0)},"-":function(cX,cW,cV){return(cv(cW)?cW:0)-(cv(cV)?cV:0)},"*":function(cX,cW,cV){return cW*cV},"/":function(cX,cW,cV){return cW/cV},"%":function(cX,cW,cV){return cW%cV},"^":function(cX,cW,cV){return cW^cV},"=":j,"==":function(cX,cW,cV){return cW==cV},"!=":function(cX,cW,cV){return cW!=cV},"<":function(cX,cW,cV){return cW<cV},">":function(cX,cW,cV){return cW>cV},"<=":function(cX,cW,cV){return cW<=cV},">=":function(cX,cW,cV){return cW>=cV},"&&":function(cX,cW,cV){return cW&&cV},"||":function(cX,cW,cV){return cW||cV},"&":function(cX,cW,cV){return cW&cV},"|":function(cX,cW,cV){return cV(cX,cW)},"!":function(cW,cV){return !cV}};var T={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'};function bq(c8,cY){var dd=cY?24:-1,da=[],c2,c1=0,df=[],c6,dh=":";while(c1<c8.length){c6=c8.charAt(c1);if(c0("\"'")){cW(c6)}else{if(c9(c6)||c0(".")&&c9(dc())){cX()}else{if(db(c6)){c7();if(c5("{,")&&df[0]=="{"&&(c2=da[da.length-1])){c2.json=c2.text.indexOf(".")==-1}}else{if(c0("(){}[].,;:")){da.push({index:c1,text:c6,json:c0("{}[]:,")});if(c0("{[")){df.unshift(c6)}if(c0("}]")){df.shift()}c1++}else{if(cZ(c6)){c1++;continue}else{var cV=c6+dc(),c3=J[c6],de=J[cV];if(de){da.push({index:c1,text:cV,fn:de});c1+=2}else{if(c3){da.push({index:c1,text:c6,fn:c3,json:c5("[,:")&&c0("+-")});c1+=1}else{dg("Unexpected next character ",c1,c1+1)}}}}}}}dh=c6}return da;function c0(di){return di.indexOf(c6)!=-1}function c5(di){return di.indexOf(dh)!=-1}function dc(){return c1+1<c8.length?c8.charAt(c1+1):false}function c9(di){return"0"<=di&&di<="9"}function cZ(di){return di==" "||di=="\r"||di=="\t"||di=="\n"||di=="\v"||di=="\u00A0"}function db(di){return"a"<=di&&di<="z"||"A"<=di&&di<="Z"||"_"==di||di=="$"}function dg(dj,dk,di){di=di||c1;throw cK("Lexer Error: "+dj+" at column"+(cv(dk)?"s "+dk+"-"+c1+" ["+c8.substring(dk,di)+"]":" "+di)+" in expression ["+c8+"].")}function c4(dm,di,dl){var dj=c8.substr(c1).match(dm);var dk={index:c1};var dn=c1;if(!dj){dg(dl)}c1+=dj[0].length;di(dk,dk.text=dj[0],dn);da.push(dk)}function cX(){c4(/^(\d+)?(\.\d+)?([eE][+-]?\d+)?/,function(di,dj){di.text=dj=1*dj;di.json=true;di.fn=cr(dj)},"Not a valid number")}function c7(){c4(/^[\w_\$][\w_\$\d]*(\.[\w_\$][\w_\$\d]*)*/,function(di,dj){c3=J[dj];if(!c3){c3=co(dj);c3.isAssignable=dj}di.fn=J[dj]||b7(co(dj),{assign:function(dk,dl){return cd(dk,dj,dl)}});di.json=J[dj]})}function cW(di){c4(/^(('(\\'|[^'])*')|("(\\"|[^"])*"))/,function(dm,dl,dn){var dj;var dk=dm.string=dl.substr(1,dl.length-2).replace(/(\\u(.?.?.?.?))|(\\(.))/g,function(dq,dt,dp,dr,ds){if(dp&&!dp.match(/[\da-fA-F]{4}/)){dj=dj||bF(null,dg,"Invalid unicode escape [\\u"+dp+"]",dn)}return dp?String.fromCharCode(parseInt(dp,16)):T[ds]||ds});(dj||j)();dm.json=true;dm.fn=function(){return(dk.length==dd)?aB.String["toDate"](dk):dk}},"Unterminated string")}}function S(dj,ds){var c9=cr(0),dm=bq(dj,ds);return{assertAllConsumed:de,primary:dc,statements:c0,validator:dt,filter:dn,watch:dd};function c7(dx,dw){throw cK("Parse Error: Token '"+dw.text+"' "+dx+" at column "+(dw.index+1)+" of expression ["+dj+"] starting at ["+dj.substring(dw.index)+"].")}function c1(){if(dm.length===0){throw cK("Unexpected end of expression: "+dj)}return dm[0]}function c3(dB,dA,dz,dy){if(dm.length>0){var dx=dm[0];var dw=dx.text;if(dw==dB||dw==dA||dw==dz||dw==dy||(!dB&&!dA&&!dz&&!dy)){return dx}}return false}function cX(dA,dz,dy,dx){var dw=c3(dA,dz,dy,dx);if(dw){if(ds&&!dw.json){index=dw.index;c7("is not valid json",dw)}dm.shift();this.currentToken=dw;return dw}return false}function dg(dw){if(!cX(dw)){c7("is unexpected, expecting ["+dw+"]",c3())}}function c8(dx,dw){return function(dy){return dx(dy,dw(dy))}}function du(dy,dx,dw){return function(dz){return dx(dz,dy(dz),dw(dz))}}function c6(){return dm.length>0}function de(){if(dm.length!==0){c7("is extra token not part of expression",dm[0])}}function c0(){var dw=[];while(true){if(dm.length>0&&!c3("}",")",";","]")){dw.push(c4())}if(!cX(";")){return function(dx){var dA;for(var dy=0;dy<dw.length;dy++){var dz=dw[dy];if(dz){dA=dz(dx)}}return dA}}}}function c4(){var dx=di();var dw;while(true){if((dw=cX("|"))){dx=du(dx,dw.fn,dn())}else{return dx}}}function dn(){return cV(cu)}function dt(){return cV(aK)}function cV(dy){var dz=cY(dy);var dw=[];var dx;while(true){if((dx=cX(":"))){dw.push(di())}else{var dA=function(dC,dB){var dD=[dB];for(var dE=0;dE<dw.length;dE++){dD.push(dw[dE](dC))}return dz.apply(dC,dD)};return function(){return dA}}}}function di(){return da()}function da(){var dy=dq();var dx;var dw;if(dw=cX("=")){if(!dy.assign){c7("implies assignment but ["+dj.substring(0,dw.index)+"] can not be assigned to",dw)}dx=dq();return function(dz){return dy.assign(dz,dx(dz))}}else{return dy}}function dq(){var dx=c5();var dw;while(true){if((dw=cX("||"))){dx=du(dx,dw.fn,c5())}else{return dx}}}function c5(){var dx=cZ();var dw;if((dw=cX("&&"))){dx=du(dx,dw.fn,c5())}return dx}function cZ(){var dx=dk();var dw;if((dw=cX("==","!="))){dx=du(dx,dw.fn,cZ())}return dx}function dk(){var dx=dl();var dw;if(dw=cX("<",">","<=",">=")){dx=du(dx,dw.fn,dk())}return dx}function dl(){var dx=cW();var dw;while(dw=cX("+","-")){dx=du(dx,dw.fn,cW())}return dx}function cW(){var dx=df();var dw;while(dw=cX("*","/","%")){dx=du(dx,dw.fn,df())}return dx}function df(){var dw;if(cX("+")){return dc()}else{if(dw=cX("-")){return du(c9,dw.fn,df())}else{if(dw=cX("!")){return c8(dw.fn,df())}else{return dc()}}}}function cY(dB){var dA=cX();var dz=dA.text.split(".");var dw=dB;var dy;for(var dx=0;dx<dz.length;dx++){dy=dz[dx];if(dw){dw=dw[dy]}}if(typeof dw!=bz){c7("should be a function",dA)}return dw}function dc(){var dy;if(cX("(")){var dz=c4();dg(")");dy=dz}else{if(cX("[")){dy=c2()}else{if(cX("{")){dy=dr()}else{var dw=cX();dy=dw.fn;if(!dy){c7("not a primary expression",dw)}}}}var dx;while(dx=cX("(","[",".")){if(dx.text==="("){dy=dh(dy)}else{if(dx.text==="["){dy=db(dy)}else{if(dx.text==="."){dy=dp(dy)}else{c7("IMPOSSIBLE")}}}}return dy}function dp(dx){var dy=cX().text;var dw=co(dy);return b7(function(dz){return dw(dx(dz))},{assign:function(dz,dA){return cd(dx(dz),dy,dA)}})}function db(dx){var dw=di();dg("]");return b7(function(dy){var dA=dx(dy);var dz=dw(dy);return(dA)?dA[dz]:cS},{assign:function(dy,dz){return dx(dy)[dw(dy)]=dz}})}function dh(dx){var dw=[];if(c1().text!=")"){do{dw.push(di())}while(cX(","))}dg(")");return function(dz){var dA=[];for(var dB=0;dB<dw.length;dB++){dA.push(dw[dB](dz))}var dy=dx(dz)||j;return dy.apply?dy.apply(dz,dA):dy(dA[0],dA[1],dA[2],dA[3],dA[4])}}function c2(){var dw=[];if(c1().text!="]"){do{dw.push(di())}while(cX(","))}dg("]");return function(dx){var dz=[];for(var dy=0;dy<dw.length;dy++){dz.push(dw[dy](dx))}return dz}}function dr(){var dw=[];if(c1().text!="}"){do{var dy=cX(),dx=dy.string||dy.text;dg(":");var dz=di();dw.push({key:dx,value:dz})}while(cX(","))}dg("}");return function(dA){var dB={};for(var dC=0;dC<dw.length;dC++){var dE=dw[dC];var dD=dE.value(dA);dB[dE.key]=dD}return dB}}function dd(){var dw=[];while(c6()){dw.push(dv());if(!cX(";")){de()}}de();return function(dx){for(var dy=0;dy<dw.length;dy++){var dz=dw[dy](dx);dx.addListener(dz.name,dz.fn)}}}function dv(){var dw=cX().text;dg(":");var dx;if(c1().text=="{"){dg("{");dx=c0();dg("}")}else{dx=di()}return function(dy){return{name:dw,fn:dx}}}}function bX(cW,cX){this.template=cW=cW+"#";this.defaults=cX||{};var cV=this.urlParams={};aS(cW.split(/\W/),function(cY){if(cY&&cW.match(new RegExp(":"+cY+"\\W"))){cV[cY]=true}})}bX.prototype={url:function(cZ){var cY=[];var cV=this;var cW=this.template;cZ=cZ||{};aS(this.urlParams,function(c1,c0){var c2=cZ[c0]||cV.defaults[c0]||"";cW=cW.replace(new RegExp(":"+c0+"(\\W)"),c2+"$1")});cW=cW.replace(/\/?#$/,"");var cX=[];ar(cZ,function(c1,c0){if(!cV.urlParams[c0]){cX.push(encodeURI(c0)+"="+encodeURI(c1))}});cW=cW.replace(/\/*$/,"");return cW+(cX.length?"?"+cX.join("&"):"")}};function bO(cV){this.xhr=cV}bO.DEFAULT_ACTIONS={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:true},remove:{method:"DELETE"},"delete":{method:"DELETE"}};bO.prototype={route:function(cY,cZ,c1){var cW=this;var cV=new bX(cY);c1=b7({},bO.DEFAULT_ACTIONS,c1);function cX(c3){var c2={};aS(cZ||{},function(c5,c4){c2[c4]=c5.charAt&&c5.charAt(0)=="@"?bQ(c3,c5.substr(1)):c5});return c2}function c0(c2){bv(c2||{},this)}aS(c1,function(c4,c3){var c2=c4.method=="POST"||c4.method=="PUT";c0[c3]=function(c6,c5,db){var c9={};var c8;var da=j;switch(arguments.length){case 3:da=db;case 2:if(E(c5)){da=c5}else{c9=c6;c8=c5;break}case 1:if(E(c6)){da=c6}else{if(c2){c8=c6}else{c9=c6}}break;case 0:break;default:throw"Expected between 0-3 arguments [params, data, callback], got "+arguments.length+" arguments."}var c7=this instanceof c0?this:(c4.isArray?[]:new c0(c8));cW.xhr(c4.method,cV.url(b7({},c4.params||{},cX(c8),c9)),c8,function(dd,de,dc){if(dd==200){if(c4.isArray){c7.length=0;aS(de,function(df){c7.push(new c0(df))})}else{bv(de,c7)}(da||j)(c7)}else{throw {status:dd,response:de,message:dd+": "+de}}},c4.verifyCache);return c7};c0.bind=function(c5){return cW.route(cY,b7({},cZ,c5),c1)};c0.prototype["$"+c3]=function(c6,c5){var c8=cX(this);var c9=j;switch(arguments.length){case 2:c8=c6;c9=c5;case 1:if(typeof c6==bz){c9=c6}else{c8=c6}case 0:break;default:throw"Expected between 1-2 arguments [params, callback], got "+arguments.length+" arguments."}var c7=c2?this:cS;c0[c3].call(this,c8,c7,c9)}});return c0}};var L=bU.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(cX){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(cW){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(cV){}throw new cK("This browser does not support XMLHttpRequest.")};function aO(c7,c5,c6,c3,da,c2){var c8=this;c8.isMock=false;var cZ=0;var c1=0;var c9=[];function c4(db){try{db.apply(null,ad.call(arguments,1))}finally{c1--;if(c1===0){while(c9.length){try{c9.pop()()}catch(dc){da.error(dc)}}}}}c8.xhr=function(dh,dc,dd,dg){if(E(dd)){dg=dd;dd=a6}if(am(dh)=="json"){var de="angular_"+Math.random()+"_"+(cZ++);de=de.replace(/\d\./,"");var db=c5[0].createElement("script");db.type="text/javascript";db.src=dc.replace("JSON_CALLBACK",de);bU[de]=function(di){bU[de]=cS;dg(200,di)};c6.append(db)}else{var df=new c3();df.open(dh,dc,true);df.setRequestHeader("Content-Type","application/x-www-form-urlencoded");df.setRequestHeader("Accept","application/json, text/plain, */*");df.setRequestHeader("X-Requested-With","XMLHttpRequest");c1++;df.onreadystatechange=function(){if(df.readyState==4){c4(dg,df.status||200,df.responseText)}};df.send(dd||"")}};c8.notifyWhenNoOutstandingRequests=function(db){if(c1===0){db()}else{c9.push(db)}};var cY=[];c8.poll=function(){aS(cY,function(db){db()})};c8.addPollFn=function(db){cY.push(db);return db};c8.startPoller=function(dc,dd){(function db(){c8.poll();dd(db,dc)})()};c8.setUrl=function(dc){var db=c7.href;if(!db.match(/#/)){db+="#"}if(!dc.match(/#/)){dc+="#"}c7.href=dc};c8.getUrl=function(){return c7.href};var cV=c5[0];var cX={};var cW="";c8.cookies=function(dc,de){var dg,db,dd,df;if(dc){if(de===cS){cV.cookie=escape(dc)+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}else{if(ci(de)){cV.cookie=escape(dc)+"="+escape(de);dg=dc.length+de.length+1;if(dg>4096){da.warn("Cookie '"+dc+"' possibly not set or overflowed because it was too large ("+dg+" > 4096 bytes)!")}if(cX.length>20){da.warn("Cookie '"+dc+"' possibly not set or overflowed because too many cookies were already set ("+cX.length+" > 20 )")}}}}else{if(cV.cookie!==cW){cW=cV.cookie;db=cW.split("; ");cX={};for(dd=0;dd<db.length;dd++){df=db[dd].split("=");if(df.length===2){cX[unescape(df[0])]=unescape(df[1])}}}return cX}};c8.defer=function(db){c1++;c2(function(){c4(db)},0)};var c0=j;c8.hover=function(db){c0=db};c8.bind=function(){c5.bind("mouseover",function(db){c0(ck(at?db.srcElement:db.target),true);return true});c5.bind("mouseleave mouseout click dblclick keypress keyup",function(db){c0(ck(db.target),false);return true})};c8.addCss=function(db){var dc=ck(cV.createElement("link"));dc.attr("rel","stylesheet");dc.attr("type","text/css");dc.attr("href",db);c6.append(dc)};c8.addJs=function(dd,dc){var db=ck(cV.createElement("script"));db.attr("type","text/javascript");db.attr("src",dd);if(dc){db.attr("id",dc)}c6.append(db)}}var b6=/^<\s*([\w:]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,n=/^<\s*\/\s*([\w:]+)[^>]*>/,cs=/(\w+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,cy=/^</,g=/^<\s*\//,aD=/<!--(.*?)-->/g,bW=/<!\[CDATA\[(.*?)]]>/g,bC=/^((ftp|https?):\/\/|mailto:|#)/,bh=/([^\#-~| |!])/g;var aV=cF("area,br,col,hr,img");var b2=cF("address,blockquote,center,dd,del,dir,div,dl,dt,hr,ins,li,map,menu,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");var al=cF("a,abbr,acronym,b,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var");var K=cF("colgroup,dd,dt,li,p,td,tfoot,th,thead,tr");var bP=cF("script,style");var bx=b7({},aV,b2,al,K);var a1=cF("compact,ismap,nohref,nowrap");var cJ=cF("background,href,longdesc,src,usemap");var a8=b7({},a1,cJ,cF("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,coords,dir,face,headers,height,hreflang,hspace,lang,language,rel,rev,rows,rowspan,rules,scope,scrolling,shape,span,start,summary,target,title,type,valign,value,vspace,width"));function aQ(cW,c4){var cZ,c0,cX,c1=[],c2=cW;c1.last=function(){return c1[c1.length-1]};while(cW){c0=true;if(!c1.last()||!bP[c1.last()]){if(cW.indexOf("<!--")===0){cZ=cW.indexOf("-->");if(cZ>=0){if(c4.comment){c4.comment(cW.substring(4,cZ))}cW=cW.substring(cZ+3);c0=false}}else{if(g.test(cW)){cX=cW.match(n);if(cX){cW=cW.substring(cX[0].length);cX[0].replace(n,cY);c0=false}}else{if(cy.test(cW)){cX=cW.match(b6);if(cX){cW=cW.substring(cX[0].length);cX[0].replace(b6,cV);c0=false}}}}if(c0){cZ=cW.indexOf("<");var c3=cZ<0?cW:cW.substring(0,cZ);cW=cZ<0?"":cW.substring(cZ);c4.chars(aa(c3))}}else{cW=cW.replace(new RegExp("(.*)<\\s*\\/\\s*"+c1.last()+"[^>]*>","i"),function(c5,c6){c6=c6.replace(aD,"$1").replace(bW,"$1");c4.chars(aa(c6));return""});cY("",c1.last())}if(cW==c2){throw"Parse Error: "+cW}c2=cW}cY();function cV(c5,c8,c9,c6){c8=am(c8);if(b2[c8]){while(c1.last()&&al[c1.last()]){cY("",c1.last())}}if(K[c8]&&c1.last()==c8){cY("",c8)}c6=aV[c8]||!!c6;if(!c6){c1.push(c8)}var c7={};c9.replace(cs,function(db,da){var dc=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:a1[da]?da:"";c7[da]=aa(dc)});c4.start(c8,c7,c6)}function cY(c5,c7){var c8=0,c6;c7=am(c7);if(c7){for(c8=c1.length-1;c8>=0;c8--){if(c1[c8]==c7){break}}}if(c8>=0){for(c6=c1.length-1;c6>=c8;c6--){c4.end(c1[c6])}c1.length=c8}}}function cF(cY){var cX={},cV=cY.split(","),cW;for(cW=0;cW<cV.length;cW++){cX[cV[cW]]=true}return cX}var y=r.createElement("pre");function aa(cV){y.innerHTML=cV.replace(/</g,"&lt;");return y.innerText||y.textContent}function aF(cV){return cV.replace(/&/g,"&amp;").replace(bh,function(cW){return"&#"+cW.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a5(cW){var cX=false;var cV=bF(cW,cW.push);return{start:function(cY,c0,cZ){cY=am(cY);if(!cX&&bP[cY]){cX=cY}if(!cX&&bx[cY]==true){cV("<");cV(cY);aS(c0,function(c2,c1){var c3=am(c1);if(a8[c3]==true&&(cJ[c3]!==true||c2.match(bC))){cV(" ");cV(c1);cV('="');cV(aF(c2));cV('"')}});cV(cZ?"/>":">")}},end:function(cY){cY=am(cY);if(!cX&&bx[cY]==true){cV("</");cV(cY);cV(">")}if(cY==cX){cX=false}},chars:function(cY){if(!cX){cV(aF(cY))}}}}var cc={},cB="ng-"+new Date().getTime(),aj=1,aC=(bU.document.attachEvent?function(cV,cX,cW){cV.attachEvent("on"+cX,cW)}:function(cV,cX,cW){cV.addEventListener(cX,cW,false)}),e=(bU.document.detachEvent?function(cV,cX,cW){cV.detachEvent("on"+cX,cW)}:function(cV,cX,cW){cV.removeEventListener(cX,cW,false)});function cf(){return(aj++)}function cU(cW){var cX=cW[cB],cV=cc[cX];if(cV){aS(cV.bind||{},function(cZ,cY){e(cW,cY,cZ)});delete cc[cX];if(at){cW[cB]=""}else{delete cW[cB]}}}function cb(cX){var c0={},cY=cX[0].style,cZ,cV,cW;if(typeof cY.length=="number"){for(cW=0;cW<cY.length;cW++){cV=cY[cW];c0[cV]=cY[cV]}}else{for(cV in cY){cZ=cY[cV];if(1*cV!=cV&&cV!="cssText"&&cZ&&typeof cZ=="string"&&cZ!="false"){c0[cV]=cZ}}}return c0}function bu(cW){if(bJ(cW)){this[0]=cW;this.length=1}else{if(cv(cW.length)&&cW.item){for(var cV=0;cV<cW.length;cV++){this[cV]=cW[cV]}this.length=cW.length}}}bu.prototype={data:function(cX,cY){var cW=this[0],cZ=cW[cB],cV=cc[cZ||-1];if(cv(cY)){if(!cV){cW[cB]=cZ=cf();cV=cc[cZ]={}}cV[cX]=cY}else{return cV?cV[cX]:a6}},removeData:function(){cU(this[0])},dealoc:function(){(function cV(cY){cU(cY);for(var cX=0,cW=cY.childNodes;cX<cW.length;cX++){cV(cW[cX])}})(this[0])},bind:function(cZ,cY){var cV=this,cX=cV[0],c0=cV.data("bind"),cW;if(!c0){this.data("bind",c0={})}aS(cZ.split(" "),function(c1){cW=c0[c1];if(!cW){c0[c1]=cW=function(c2){if(!c2.preventDefault){c2.preventDefault=function(){c2.returnValue=false}}if(!c2.stopPropagation){c2.stopPropagation=function(){c2.cancelBubble=true}}aS(cW.fns,function(c3){c3.call(cV,c2)})};cW.fns=[];aC(cX,c1,cW)}cW.fns.push(cY)})},replaceWith:function(cV){this[0].parentNode.replaceChild(ck(cV)[0],this[0])},children:function(){return new bu(this[0].childNodes)},append:function(cW){var cV=this[0];cW=ck(cW);aS(cW,function(cX){cV.appendChild(cX)})},remove:function(){this.dealoc();var cV=this[0].parentNode;if(cV){cV.removeChild(this[0])}},removeAttr:function(cV){this[0].removeAttribute(cV)},after:function(cV){this[0].parentNode.insertBefore(ck(cV)[0],this[0].nextSibling)},hasClass:function(cV){var cW=" "+cV+" ";if((" "+this[0].className+" ").replace(/[\n\t]/g," ").indexOf(cW)>-1){return true}return false},removeClass:function(cV){this[0].className=av((" "+this[0].className+" ").replace(/[\n\t]/g," ").replace(" "+cV+" ",""))},toggleClass:function(cV,cX){var cW=this;(cX?cW.addClass:cW.removeClass).call(cW,cV)},addClass:function(cV){if(!this.hasClass(cV)){this[0].className=av(this[0].className+" "+cV)}},css:function(cV,cX){var cW=this[0].style;if(ci(cV)){if(cv(cX)){cW[cV]=cX}else{return cW[cV]}}else{b7(cW,cV)}},attr:function(cV,cW){var cX=this[0];if(cR(cV)){aS(cV,function(cZ,cY){cX.setAttribute(cY,cZ)})}else{if(cv(cW)){cX.setAttribute(cV,cW)}else{return cX.getAttribute(cV,2)}}},text:function(cV){if(cv(cV)){this[0].textContent=cV}return this[0].textContent},val:function(cV){if(cv(cV)){this[0].value=cV}return this[0].value},html:function(cW){if(cv(cW)){var cV=0,cX=this[0].childNodes;for(;cV<cX.length;cV++){ck(cX[cV]).dealoc()}this[0].innerHTML=cW}return this[0].innerHTML},parent:function(){return ck(this[0].parentNode)},clone:function(){return ck(this[0].cloneNode(true))}};if(at){b7(bu.prototype,{text:function(cV){var cW=this[0];if(cW.nodeType==3){if(cv(cV)){cW.nodeValue=cV}return cW.nodeValue}else{if(cv(cV)){cW.innerText=cV}return cW.innerText}}})}var aY={typeOf:function(cW){if(cW===a6){return v}var cV=typeof cW;if(cV==aP){if(cW instanceof Array){return a3}if(ax(cW)){return bc}if(cW.nodeType==1){return cC}}return cV}};var cQ={copy:bv,size:aw,equals:p};var bk={extend:b7};var M={indexOf:cO,sum:function(c0,cZ){var cX=aB.Function["compile"](cZ);var cW=0;for(var cV=0;cV<c0.length;cV++){var cY=1*cX(c0[cV]);if(!isNaN(cY)){cW+=cY}}return cW},remove:function(cX,cW){var cV=cO(cX,cW);if(cV>=0){cX.splice(cV,1)}return cW},filter:function(c2,c1){var cX=[];cX.check=function(c4){for(var c3=0;c3<cX.length;c3++){if(!cX[c3](c4)){return false}}return true};var cZ=function(c5,c6){if(c6.charAt(0)==="!"){return !cZ(c5,c6.substr(1))}switch(typeof c5){case"boolean":case"number":case"string":return(""+c5).toLowerCase().indexOf(c6)>-1;case"object":for(var c4 in c5){if(c4.charAt(0)!=="$"&&cZ(c5[c4],c6)){return true}}return false;case"array":for(var c3=0;c3<c5.length;c3++){if(cZ(c5[c3],c6)){return true}}return false;default:return false}};switch(typeof c1){case"boolean":case"number":case"string":c1={$:c1};case"object":for(var cY in c1){if(cY=="$"){(function(){var c3=(""+c1[cY]).toLowerCase();if(!c3){return}cX.push(function(c4){return cZ(c4,c3)})})()}else{(function(){var c3=cY;var c4=(""+c1[cY]).toLowerCase();if(!c4){return}cX.push(function(c5){return cZ(bQ(c5,c3),c4)})})()}}break;case bz:cX.push(c1);break;default:return c2}var cW=[];for(var cV=0;cV<c2.length;cV++){var c0=c2[cV];if(cX.check(c0)){cW.push(c0)}}return cW},add:function(cW,cV){cW.push(bB(cV)?{}:cV);return cW},count:function(cY,cX){if(!cX){return cY.length}var cV=aB.Function["compile"](cX),cW=0;aS(cY,function(cZ){if(cV(cZ)){cW++}});return cW},orderBy:function(c2,c1,cZ){c1=a9(c1)?c1:[c1];c1=aI(c1,function(c4){var c5=false,c3=c4||aG;if(ci(c4)){if((c4.charAt(0)=="+"||c4.charAt(0)=="-")){c5=c4.charAt(0)=="-";c4=c4.substring(1)}c3=bt(c4).fnSelf}return cW(function(c7,c6){return c0(c3(c7),c3(c6))},c5)});var cY=[];for(var cX=0;cX<c2.length;cX++){cY.push(c2[cX])}return cY.sort(cW(cV,cZ));function cV(c6,c5){for(var c4=0;c4<c1.length;c4++){var c3=c1[c4](c6,c5);if(c3!==0){return c3}}return 0}function cW(c3,c4){return cp(c4)?function(c6,c5){return c3(c5,c6)}:c3}function c0(c6,c5){var c4=typeof c6;var c3=typeof c5;if(c4==c3){if(c4=="string"){c6=c6.toLowerCase()}if(c4=="string"){c5=c5.toLowerCase()}if(c6===c5){return 0}return c6<c5?-1:1}else{return c4<c3?-1:1}}},limitTo:function(cZ,cV){cV=parseInt(cV,10);var cW=[],cX,cY;if(cV>0){cX=0;cY=cV}else{cX=cZ.length+cV;cY=cZ.length}for(;cX<cY;cX++){cW.push(cZ[cX])}return cW}};var a7=/^(\d{4})-(\d\d)-(\d\d)(?:T(\d\d)(?:\:(\d\d)(?:\:(\d\d)(?:\.(\d{3}))?)?)?Z)?$/;var aq={quote:function(cV){return'"'+cV.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v")+'"'},quoteUnicode:function(cV){var c0=aB.String["quote"](cV);var cZ=[];for(var cW=0;cW<c0.length;cW++){var cX=c0.charCodeAt(cW);if(cX<128){cZ.push(c0.charAt(cW))}else{var cY="000"+cX.toString(16);cZ.push("\\u"+cY.substring(cY.length-4))}}return cZ.join("")},toDate:function(cX){var cW;if(ci(cX)&&(cW=cX.match(a7))){var cV=new Date(0);cV.setUTCFullYear(cW[1],cW[2]-1,cW[3]);cV.setUTCHours(cW[4]||0,cW[5]||0,cW[6]||0,cW[7]||0);return cV}return cX}};var af={toString:function(cV){return !cV?cV:cV.toISOString?cV.toISOString():cn(cV.getUTCFullYear(),4)+"-"+cn(cV.getUTCMonth()+1,2)+"-"+cn(cV.getUTCDate(),2)+"T"+cn(cV.getUTCHours(),2)+":"+cn(cV.getUTCMinutes(),2)+":"+cn(cV.getUTCSeconds(),2)+"."+cn(cV.getUTCMilliseconds(),3)+"Z"}};var w={compile:function(cV){if(E(cV)){return cV}else{if(cV){return bt(cV).fnSelf}else{return aG}}}};function I(cW,cV){aB[cW]=aB[cW]||{};aS(cV,function(cX){b7(aB[cW],cX)})}I("Global",[aY]);I("Collection",[aY,cQ]);I("Array",[aY,cQ,M]);I("Object",[aY,cQ,bk]);I("String",[aY,aq]);I("Date",[aY,af]);aB.Date["toString"]=af.toString;I("Function",[aY,cQ,w]);cu.currency=function(cV){this.$element.toggleClass("ng-format-negative",cV<0);return"$"+cu.number.apply(this,[cV,2])};cu.number=function(cY,cV){if(isNaN(cY)||!isFinite(cY)){return""}cV=typeof cV==q?2:cV;var cW=cY<0;cY=Math.abs(cY);var c1=Math.pow(10,cV);var c3=""+Math.round(cY*c1);var c2=c3.substring(0,c3.length-cV);c2=c2||"0";var cX=c3.substring(c3.length-cV);c3=cW?"-":"";for(var c0=0;c0<c2.length;c0++){if((c2.length-c0)%3===0&&c0!==0){c3+=","}c3+=c2.charAt(c0)}if(cV>0){for(var cZ=cX.length;cZ<cV;cZ++){cX+="0"}c3+="."+cX.substring(0,cV)}return c3};function cn(cW,cX,cV){var cY="";if(cW<0){cY="-";cW=-cW}cW=""+cW;while(cW.length<cX){cW="0"+cW}if(cV){cW=cW.substr(cW.length-cX)}return cY+cW}function br(cW,cX,cY,cV){return function(cZ){var c0=cZ["get"+cW]();if(cY>0||c0>-cY){c0+=cY}if(c0===0&&cY==-12){c0=12}return cn(c0,cX,cV)}}var bG={yyyy:br("FullYear",4),yy:br("FullYear",2,0,true),MM:br("Month",2,1),M:br("Month",1,1),dd:br("Date",2),d:br("Date",1),HH:br("Hours",2),H:br("Hours",1),hh:br("Hours",2,-12),h:br("Hours",1,-12),mm:br("Minutes",2),m:br("Minutes",1),ss:br("Seconds",2),s:br("Seconds",1),a:function(cV){return cV.getHours()<12?"am":"pm"},Z:function(cV){var cW=cV.getTimezoneOffset();return cn(cW/60,2)+cn(Math.abs(cW%60),2)}};var ap=/([^yMdHhmsaZ]*)(y+|M+|d+|H+|h+|m+|s+|a|Z)(.*)/;var cq=/^\d+$/;cu.date=function(cV,cY){if(ci(cV)){if(cq.test(cV)){cV=parseInt(cV,10)}else{cV=aq.toDate(cV)}}if(aU(cV)){cV=new Date(cV)}if(!ax(cV)){return cV}var cZ=cV.toLocaleDateString(),cW;if(cY&&ci(cY)){cZ="";var cX=[];while(cY){cX=bd(cX,ap.exec(cY),1);cY=cX.pop()}aS(cX,function(c0){cW=bG[c0];cZ+=cW?cW(cV):c0})}return cZ};cu.json=function(cV){this.$element.addClass("ng-monospace");return cm(cV,true)};cu.lowercase=am;cu.uppercase=bI;cu.html=function(cV,cW){return new aW(cV,cW)};cu.linky=function(c2){if(!c2){return c2}var cV=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/;var cY;var cX=c2;var c0=[];var c1=a5(c0);var cW;var cZ;while(cY=cX.match(cV)){cW=cY[0];if(cY[2]==cY[3]){cW="mailto:"+cW}cZ=cY.index;c1.chars(cX.substr(0,cZ));c1.start("a",{href:cW});c1.chars(cY[0].replace(/^mailto:/,""));c1.end("a");cX=cX.substring(cZ+cY[0].length)}c1.chars(cX);return new aW(c0.join(""))};function a0(cV,cW){return{format:cV,parse:cW||cV}}function D(cV){return(cv(cV)&&cV!==a6)?""+cV:cV}var aT=/^\s*[-+]?\d*(\.\d*)?\s*$/;l.noop=a0(aG,aG);l.json=a0(cm,Q);l["boolean"]=a0(D,cp);l.number=a0(D,function(cV){if(cV==a6||aT.exec(cV)){return cV===a6||cV===""?a6:1*cV}else{throw"Not a number"}});l.list=a0(function(cV){return cV?cV.join(", "):cV},function(cW){var cV=[];aS((cW||"").split(","),function(cX){cX=av(cX);if(cX){cV.push(cX)}});return cV});l.trim=a0(function(cV){return cV?av(""+cV):""});b7(aK,{noop:function(){return a6},regexp:function(cW,cV,cX){if(!cW.match(cV)){return cX||"Value does not match expected format "+cV+"."}else{return a6}},number:function(cY,cX,cV){var cW=1*cY;if(cW==cY){if(typeof cX!=q&&cW<cX){return"Value can not be less than "+cX+"."}if(typeof cX!=q&&cW>cV){return"Value can not be greater than "+cV+"."}return a6}else{return"Not a number"}},integer:function(cY,cW,cV){var cX=aK.number(cY,cW,cV);if(cX){return cX}if(!(""+cY).match(/^\s*[\d+]*\s*$/)||cY!=Math.round(cY)){return"Not a whole number"}return a6},date:function(cX){var cV=/^(\d\d?)\/(\d\d?)\/(\d\d\d\d)$/.exec(cX);var cW=cV?new Date(cV[3],cV[1]-1,cV[2]):0;return(cW&&cW.getFullYear()==cV[3]&&cW.getMonth()==cV[1]-1&&cW.getDate()==cV[2])?a6:"Value is not a date. (Expecting format: 12/31/2009)."},email:function(cV){if(cV.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/)){return a6}return"Email needs to be in username@host.com format."},phone:function(cV){if(cV.match(/^1\(\d\d\d\)\d\d\d-\d\d\d\d$/)){return a6}if(cV.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/)){return a6}return"Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly."},url:function(cV){if(cV.match(/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/)){return a6}return"URL needs to be in http://server[:port]/path format."},json:function(cV){try{Q(cV);return a6}catch(cW){return cW.toString()}},asynchronous:function(cY,c1,cW){if(!cY){return}var c0=this;var cZ=c0.$element;var cX=cZ.data("$asyncValidator");if(!cX){cZ.data("$asyncValidator",cX={inputs:{}})}cX.current=cY;var cV=cX.inputs[cY];if(!cV){cX.inputs[cY]=cV={inFlight:true};c0.$invalidWidgets.markInvalid(c0.$element);cZ.addClass("ng-input-indicator-wait");c1(cY,function(c2,c3){cV.response=c3;cV.error=c2;cV.inFlight=false;if(cX.current==cY){cZ.removeClass("ng-input-indicator-wait");c0.$invalidWidgets.markValid(cZ)}cZ.data(bf)();c0.$root.$eval()})}else{if(cV.inFlight){c0.$invalidWidgets.markInvalid(c0.$element)}else{(cW||j)(cV.response)}}return cV.error}});var H=/^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,z=/^([^\?]*)?(\?([^\?]*))?$/,cA={http:80,https:443,ftp:21},bT="eager",bK=bT+"-published";function cl(cW,cY,cX,cV){bs(cW,cY,{$inject:cX,$creation:cV})}cl("$window",bF(bU,aG,bU),[],bK);cl("$document",function(cV){return ck(cV.document)},["$window"],bK);cl("$location",function(c2){var da=this,c6={toString:cW,update:c1,updateHash:c5},c0=c2.getUrl(),cY,c3;c2.addPollFn(function(){if(c0!=c2.getUrl()){c1(c0=c2.getUrl());c9();da.$eval()}});this.$onEval(bp,c4);this.$onEval(cg,c4);c1(c0);c9();return c6;function c1(db){if(ci(db)){b7(c6,c8(db))}else{if(cv(db.hash)){b7(db,cZ(db.hash))}b7(c6,db);if(cv(db.hashPath||db.hashSearch)){c6.hash=cX(c6)}c6.href=c7(c6)}}function c5(dd,db){var dc={};if(ci(dd)){dc.hashPath=dd;if(cv(db)){dc.hashSearch=db}}else{dc.hashSearch=dd}c1(dc)}function cW(){cV();return c6.href}function cV(){if(c6.href==cY){if(c6.hash==c3){c6.hash=cX(c6)}c6.href=c7(c6)}c1(c6.href)}function c9(){cY=c6.href;c3=c6.hash}function c4(){cV();if(c6.href!=cY){c2.setUrl(c0=c6.href);c9()}}function c7(dd){var dc=N(dd.search);var db=(dd.port==cA[dd.protocol]?a6:dd.port);return dd.protocol+"://"+dd.host+(db?":"+db:"")+dd.path+(dc?"?"+dc:"")+(dd.hash?"#"+dd.hash:"")}function cX(dc){var db=N(dc.hashSearch);return escape(dc.hashPath).replace(/%21/gi,"!").replace(/%3A/gi,":").replace(/%24/gi,"$")+(db?"?"+db:"")}function c8(db){var dd={};var dc=H.exec(db);if(dc){dd.href=db.replace(/#$/,"");dd.protocol=dc[1];dd.host=dc[3]||"";dd.port=dc[5]||cA[dd.protocol]||a6;dd.path=dc[6]||"";dd.search=ah(dc[8]);dd.hash=dc[10]||"";b7(dd,cZ(dd.hash))}return dd}function cZ(dd){var dc={};var db=z.exec(dd);if(db){dc.hash=dd;dc.hashPath=unescape(db[1]||"");dc.hashSearch=ah(db[3])}return dc}},["$browser"],bK);cl("$log",function(cW){return{log:cV("log"),warn:cV("warn"),info:cV("info"),error:cV("error")};function cV(cY){var cX=cW.console||{};var cZ=cX[cY]||cX.log||j;if(cZ.apply){return function(){var c0=[];aS(arguments,function(c1){c0.push(bb(c1))});return cZ.apply(cX,c0)}}else{return cZ}}},["$window"],bK);cl("$exceptionHandler",function(cV){return function(cW){cV.error(cW)}},["$log"],bK);cl("$hover",function(c0,cW){var c2,cY=this,cZ,c1=300,cX=10,cV=ck(cW[0].body);c0.hover(function(c6,c4){if(c4&&(cZ=c6.attr(a)||c6.attr(k))){if(!c2){c2={callout:ck('<div id="ng-callout"></div>'),arrow:ck("<div></div>"),title:ck('<div class="ng-title"></div>'),content:ck('<div class="ng-content"></div>')};c2.callout.append(c2.arrow);c2.callout.append(c2.title);c2.callout.append(c2.content);cV.append(c2.callout)}var c3=cV[0].getBoundingClientRect(),c5=c6[0].getBoundingClientRect(),c7=c3.right-c5.right-cX;c2.title.text(c6.hasClass("ng-exception")?"EXCEPTION:":"Validation error...");c2.content.text(cZ);if(c7<c1){c2.arrow.addClass("ng-arrow-right");c2.arrow.css({left:(c1+1)+"px"});c2.callout.css({position:"fixed",left:(c5.left-cX-c1-4)+"px",top:(c5.top-3)+"px",width:c1+"px"})}else{c2.arrow.addClass("ng-arrow-left");c2.callout.css({position:"fixed",left:(c5.right+cX)+"px",top:(c5.top-3)+"px",width:c1+"px"})}}else{if(c2){c2.callout.remove();c2=a6}}})},["$browser","$document"],bT);cl("$invalidWidgets",function(){var cW=[];cW.markValid=function(cY){var cX=cO(cW,cY);if(cX!=-1){cW.splice(cX,1)}};cW.markInvalid=function(cY){var cX=cO(cW,cY);if(cX===-1){cW.push(cY)}};cW.visible=function(){var cX=0;aS(cW,function(cY){cX=cX+(aR(cY)?1:0)});return cX};this.$onEval(cg,function(){for(var cX=0;cX<cW.length;){var cY=cW[cX];if(cV(cY[0])){cW.splice(cX,1);if(cY.dealoc){cY.dealoc()}}else{cX++}}});function cV(cY){if(cY==bU.document){return false}var cX=cY.parentNode;return !cX||cV(cX)}return cW},[],bK);function bj(cW,cV,cZ){var cY="^"+cV.replace(/[\.\\\(\)\^\$]/g,"$1")+"$",c0=[],c1={};aS(cV.split(/\W/),function(c3){if(c3){var c2=new RegExp(":"+c3+"([\\W])");if(cY.match(c2)){cY=cY.replace(c2,"([^/]*)$1");c0.push(c3)}}});var cX=cW.match(new RegExp(cY));if(cX){aS(c0,function(c3,c2){c1[c3]=cX[c2+1]});if(cZ){this.$set(cZ,c1)}}return cX?c1:a6}cl("$route",function(cW){var cV={},cX=[],c1=bj,cZ=this,cY=0,c2={routes:cV,onChange:bF(cX,cX.push),when:function(c4,c5){if(aB.isUndefined(c4)){return cV}var c3=cV[c4];if(!c3){c3=cV[c4]={}}if(c5){aB.extend(c3,c5)}cY++;return c3}};function c0(){var c3;c2.current=a6;aB.foreach(cV,function(c4,c5){if(!c3){var c6=c1(cW.hashPath,c5);if(c6){c3=aB.scope(cZ);c2.current=aB.extend({},c4,{scope:c3,params:aB.extend({},cW.hashSearch,c6)})}}});aB.foreach(cX,cZ.$tryEval);if(c3){c3.$become(c2.current.controller)}}this.$watch(function(){return cY+cW.hash},c0);return c2},["$location"],bK);cl("$xhr",function(cW,cV,cY){var cX=this;return function(c2,cZ,c0,c1){if(E(c0)){c1=c0;c0=a6}if(c0&&cR(c0)){c0=cm(c0)}cW.xhr(c2,cZ,c0,function(c4,c3){try{if(ci(c3)&&/^\s*[\[\{]/.exec(c3)&&/[\}\]]\s*$/.exec(c3)){c3=Q(c3)}if(c4==200){c1(c4,c3)}else{cV({method:c2,url:cZ,data:c0,callback:c1},{status:c4,body:c3})}}catch(c5){cY.error(c5)}finally{cX.$eval()}})}},["$browser","$xhr.error","$log"]);cl("$xhr.error",function(cV){return function(cX,cW){cV.error("ERROR: XHR: "+cX.url,cX,cW)}},["$log"]);cl("$xhr.bulk",function(cW,cV,cZ){var c0=[],cY=this;function cX(c5,c1,c2,c4){if(E(c2)){c4=c2;c2=a6}var c3;aS(cX.urls,function(c6){if(E(c6.match)?c6.match(c1):c6.match.exec(c1)){c3=c6}});if(c3){if(!c3.requests){c3.requests=[]}c3.requests.push({method:c5,url:c1,data:c2,callback:c4})}else{cW(c5,c1,c2,c4)}}cX.urls={};cX.flush=function(c1){aS(cX.urls,function(c2,c3){var c4=c2.requests;if(c4&&c4.length){c2.requests=[];c2.callbacks=[];cW("POST",c3,{requests:c4},function(c6,c5){aS(c5,function(c7,c8){try{if(c7.status==200){(c4[c8].callback||j)(c7.status,c7.response)}else{cV(c4[c8],c7)}}catch(c9){cZ.error(c9)}});(c1||j)()});cY.$eval()}})};this.$onEval(cg,cX.flush);return cX},["$xhr","$xhr.error","$log"]);cl("$defer",function(cV,cW){var cX=this;return function(cY){cV.defer(function(){try{cY()}catch(cZ){cW(cZ)}finally{cX.$eval()}})}},["$browser","$exceptionHandler"]);cl("$xhr.cache",function(cV,cY){var cZ={},cX=this;function cW(c6,c0,c1,c5,c4){if(E(c1)){c5=c1;c1=a6}if(c6=="GET"){var c3,c2;if(c2=cW.data[c0]){cY(function(){c5(200,bv(c2.value))});if(!c4){return}}if(c3=cZ[c0]){c3.callbacks.push(c5)}else{cZ[c0]={callbacks:[c5]};cW.delegate(c6,c0,c1,function(c7,c8){if(c7==200){cW.data[c0]={value:c8}}var c9=cZ[c0].callbacks;delete cZ[c0];aS(c9,function(db){try{(db||j)(c7,bv(c8))}catch(da){cX.$log.error(da)}})})}}else{cW.data={};cW.delegate(c6,c0,c1,c5)}}cW.data={};cW.delegate=cV;return cW},["$xhr.bulk","$defer"]);cl("$resource",function(cV){var cW=new bO(cV);return bF(cW,cW.route)},["$xhr.cache"]);cl("$cookies",function(cW){var cZ=this,c0={},cX={},cV;cW.addPollFn(function(){var c1=cW.cookies();if(cV!=c1){cV=c1;bv(c1,cX);bv(c1,c0);cZ.$eval()}})();this.$onEval(cg,cY);return c0;function cY(){var c2,c3,c1;for(c2 in cX){if(bB(c0[c2])){cW.cookies(c2,cS)}}for(c2 in c0){if(c0[c2]!==cX[c2]){cW.cookies(c2,c0[c2]);c1=true}}if(c1){c1=!c1;c3=cW.cookies();for(c2 in c0){if(c0[c2]!==c3[c2]){if(bB(c3[c2])){delete c0[c2]}else{c0[c2]=c3[c2]}c1=true}}if(c1){cZ.$eval()}}}},["$browser"],bK);cl("$cookieStore",function(cV){return{get:function(cW){return Q(cV[cW])},put:function(cW,cX){cV[cW]=cm(cX)},remove:function(cW){delete cV[cW]}}},["$cookies"]);Z("ng:init",function(cV){return function(cW){this.$tryEval(cV,cW)}});Z("ng:controller",function(cV){this.scope(true);return function(cX){var cW=bQ(bU,cV,true)||bQ(this,cV,true);if(!cW){throw"Can not find '"+cV+"' controller."}if(!E(cW)){throw"Reference '"+cV+"' is not a class."}this.$become(cW)}});Z("ng:eval",function(cV){return function(cW){this.$onEval(cV,cW)}});Z("ng:bind",function(cW,cV){cV.addClass("ng-binding");return function(cY){var cX=j,cZ=j;this.$onEval(function(){var c1,c5,c2,c3,c4,c0=this.hasOwnProperty(by)?this.$element:cS;this.$element=cY;c5=this.$tryEval(cW,function(c6){c1=bb(c6)});this.$element=c0;if(c3=(c5 instanceof aW)){c5=(c2=c5).html}if(cX===c5&&cZ==c1){return}c4=bJ(c5);if(!c3&&!c4&&cR(c5)){c5=cm(c5)}if(c5!=cX||c1!=cZ){cX=c5;cZ=c1;b0(cY,a,c1);if(c1){c5=c1}if(c3){cY.html(c2.get())}else{if(c4){cY.html("");cY.append(c5)}else{cY.text(c5===cS?"":c5)}}}},cY)}});var bD={};function cT(cW){var cV=bD[cW];if(!cV){var cX=[];aS(aZ(cW),function(cZ){var cY=cI(cZ);cX.push(cY?function(c1){var c0,c2=this.$tryEval(cY,function(c3){c0=cm(c3)});b0(c1,a,c0);return c0?c0:c2}:function(){return cZ})});bD[cW]=cV=function(c1){var c3=[],cY=this,cZ=this.hasOwnProperty(by)?cY.$element:cS;cY.$element=c1;for(var c0=0;c0<cX.length;c0++){var c2=cX[c0].call(cY,c1);if(bJ(c2)){c2=""}else{if(cR(c2)){c2=cm(c2,true)}}c3.push(c2)}cY.$element=cZ;return c3.join("")}}return cV}Z("ng:bind-template",function(cW,cV){cV.addClass("ng-binding");var cX=cT(cW);return function(cZ){var cY;this.$onEval(function(){var c0=cX.call(this,cZ);if(c0!=cY){cZ.text(c0);cY=c0}},cZ)}});var f={disabled:"disabled",readonly:"readOnly",checked:"checked",selected:"selected"};Z("ng:bind-attr",function(cV){return function(cY){var cX={};var cW=cY.data(ac)||j;this.$onEval(function(){var cZ=this.$eval(cV),c1=j;for(var c0 in cZ){var c3=cT(cZ[c0]).call(this,cY),c2=f[am(c0)];if(cX[c0]!==c3){cX[c0]=c3;if(c2){if(cp(c3)){cY.attr(c2,c2);cY.attr("ng-"+c2,c3)}else{cY.removeAttr(c2);cY.removeAttr("ng-"+c2)}(cY.data(bf)||j)()}else{cY.attr(c0,c3)}c1=cW}}c1()},cY)}});Z("ng:click",function(cW,cV){return function(cY){var cX=this;cY.bind("click",function(cZ){cX.$tryEval(cW,cY);cX.$root.$eval();cZ.stopPropagation()})}});Z("ng:submit",function(cW,cV){return function(cY){var cX=this;cY.bind("submit",function(cZ){cX.$tryEval(cW,cY);cX.$root.$eval();cZ.preventDefault()})}});Z("ng:watch",function(cW,cV){return function(cY){var cX=this;S(cW).watch()({addListener:function(cZ,c0){cX.$watch(cZ,function(){return c0(cX)},cY)}})}});function bE(cV){return function(cY,cW){var cX=cW[0].className+" ";return function(cZ){this.$onEval(function(){if(cV(this.$index)){var c0=this.$eval(cY);if(a9(c0)){c0=c0.join(" ")}cZ[0].className=av(cX+c0)}},cZ)}}}Z("ng:class",bE(function(){return true}));Z("ng:class-odd",bE(function(cV){return cV%2===0}));Z("ng:class-even",bE(function(cV){return cV%2===1}));Z("ng:show",function(cW,cV){return function(cX){this.$onEval(function(){cX.css(aL,cp(this.$eval(cW))?"":b)},cX)}});Z("ng:hide",function(cW,cV){return function(cX){this.$onEval(function(){cX.css(aL,cp(this.$eval(cW))?b:"")},cX)}});Z("ng:style",function(cW,cV){return function(cX){var cY=cb(cX);this.$onEval(function(){var c0=this.$eval(cW)||{},cZ,c1={};for(cZ in c0){if(cY[cZ]===cS){cY[cZ]=""}c1[cZ]=c0[cZ]}for(cZ in cY){c1[cZ]=c1[cZ]||cY[cZ]}cX.css(c1)},cX)}});function aZ(cW){var cX=[];var cY=0;var cV;while((cV=cW.indexOf("{{",cY))>-1){if(cY<cV){cX.push(cW.substr(cY,cV-cY))}cY=cV;cV=cW.indexOf("}}",cV);cV=cV<0?cW.length:cV+2;cX.push(cW.substr(cY,cV-cY));cY=cV}if(cY!=cW.length){cX.push(cW.substr(cY,cW.length-cY))}return cX.length===0?[cW]:cX}function cI(cV){var cW=cV.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/);return cW?cW[1]:a6}function cH(cV){return cV.length>1||cI(cV[0])!==a6}ag("{{}}",function(cZ,cY,cV){var c1=aZ(cZ),cW=this;if(cH(c1)){if(b4(cV[0])){cV.attr("ng:bind-template",cZ)}else{var cX=cY,c0;aS(aZ(cZ),function(c4){var c3=cI(c4);if(c3){c0=cW.element("span");c0.attr("ng:bind",c3)}else{c0=cW.text(c4)}if(at&&c4.charAt(0)==" "){c0=ck("<span>&nbsp;</span>");var c2=c0.html();c0.text(c4.substr(1));c0.html(c2+c0.html())}cX.after(c0);cX=c0});cY.remove()}}});ag("OPTION",function(cY,cX,cW){if(au(cW)=="OPTION"){var cV=r.createElement("select");cV.insertBefore(cW[0].cloneNode(true),a6);if(!cV.innerHTML.match(/<option(\s.*\s|\s)value\s*=\s*.*>.*<\/\s*option\s*>/gi)){cW.attr("value",cY)}}});var bL="ng:bind-attr";var aH={"ng:src":"src","ng:href":"href"};s("{{}}",function(cY,cW,cX){if(Z(cW)||Z("@"+cW)){return}if(at&&cW=="src"){cY=decodeURI(cY)}var cZ=aZ(cY),cV;if(cH(cZ)){cX.removeAttr(cW);cV=Q(cX.attr(bL)||"{}");cV[aH[cW]||cW]=cY;cX.attr(bL,cm(cV))}});function bN(cW,cV){var cX=cV.attr("name");if(!cX){throw"Required field 'name' not found."}return{get:function(){return cW.$eval(cX)},set:function(cY){if(cY!==cS){return cW.$tryEval(cX+"="+cm(cY),cV)}}}}function bn(cY,cX){var cV=bN(cY,cX),cZ=cX.attr("ng:format")||o,cW=l(cZ);if(!cW){throw"Formatter named '"+cZ+"' not found."}return{get:function(){return cW.format(cV.get())},set:function(c0){return cV.set(cW.parse(c0))}}}function d(cV){return S(cV).validator()()}function b1(c6,cZ){var cX=cZ.attr("ng:validate")||o,cW=d(cX),cV=cZ.attr("ng:required"),c7=cZ.attr("ng:format")||o,c5=l(c7),c4,cY,c1,c0,c3=c6.$invalidWidgets||{markValid:j,markInvalid:j};if(!cW){throw"Validator named '"+cX+"' not found."}if(!c5){throw"Formatter named '"+c7+"' not found."}c4=c5.format;cY=c5.parse;if(cV){c6.$watch(cV,function(c8){c0=c8;c2()})}else{c0=cV===""}cZ.data(bf,c2);return{get:function(){if(c1){b0(cZ,k,a6)}try{var c8=cY(cZ.val());c2();return c8}catch(c9){c1=c9;b0(cZ,k,c9)}},set:function(c9){var c8=cZ.val(),da=c4(c9);if(c8!=da){cZ.val(da||"")}c2()}};function c2(){var da=av(cZ.val());if(cZ[0].disabled||cZ[0].readOnly){b0(cZ,k,a6);c3.markValid(cZ)}else{var c9,c8=b5(c6,{$element:cZ});c9=c0&&!da?"Required":(da?cW(c8,da):a6);b0(cZ,k,c9);c1=c9;if(c9){c3.markInvalid(cZ)}else{c3.markValid(cZ)}}}}function aJ(cW,cV){var cY=cV[0],cX=cY.value;return{get:function(){return !!cY.checked},set:function(cZ){cY.checked=cp(cZ)}}}function cP(cW,cV){var cX=cV[0];return{get:function(){return cX.checked?cX.value:a6},set:function(cY){cX.checked=cY==cX.value}}}function cz(cX,cW){var cV=cW[0].options;return{get:function(){var cY=[];aS(cV,function(cZ){if(cZ.selected){cY.push(cZ.value)}});return cY},set:function(cY){var cZ={};aS(cY,function(c0){cZ[c0]=true});aS(cV,function(c0){c0.selected=cZ[c0.value]})}}}function O(){return{get:j,set:j}}var bl=bZ("keyup change",bN,b1,h()),b3=bZ("click",O,O,j),cM={text:bl,textarea:bl,hidden:bl,password:bl,button:b3,submit:b3,reset:b3,image:b3,checkbox:bZ("click",bn,aJ,h(false)),radio:bZ("click",bn,cP,ct),"select-one":bZ("change",bn,b1,h(a6)),"select-multiple":bZ("change",bn,cz,h([]))};function h(cV){return function(cX,cW){var cY=cW.get();if(!cY&&cv(cV)){cY=bv(cV)}if(bB(cX.get())&&cv(cY)){cX.set(cY)}}}function ct(cY,cV,cZ){var cX=cY.get(),c0=cV.get(),cW=cZ[0];cW.checked=false;cW.name=this.$id+"@"+cW.name;if(bB(cX)){cY.set(cX=a6)}if(cX==a6&&c0!==a6){cY.set(c0)}cV.set(cX)}function bZ(cX,cW,cV,cY){return function(c2){var c3=this,c1=cW(c3,c2),cZ=cV(c3,c2),c4=c2.attr("ng:change")||"",c0;cY.call(c3,c1,cZ,c2);this.$eval(c2.attr("ng:init")||"");if(c4||cW!==O){c2.bind(cX,function(){c1.set(cZ.get());c0=c1.get();c3.$tryEval(c4,c2);c3.$root.$eval()})}c3.$watch(c1.get,function(c5){if(c0!==c5){cZ.set(c0=c5)}})}}function X(cV){this.directives(true);return cM[am(cV[0].type)]||j}B("input",X);B("textarea",X);B("button",X);B("select",function(cV){this.descend(true);return X.call(this,cV)});B("option",function(){this.descend(true);this.directives(true);return function(cZ){var cV=cZ.parent();var c1=ae(cV);var cY=bn(c1,cV);var cW=b1(c1,cV);var c0=cZ;var cX=c0.attr(ay);var c2=c0.attr("ng-"+aA);cZ.data(ac,function(){var c5=c0.attr(ay);var c4=c0.attr("ng-"+aA);var c3=cY.get();if(c2!=c4||cX!=c5){c2=c4;cX=c5;if(c4||c3==a6||c3==cS){cY.set(c5)}if(c5==c3){cW.set(cX)}}})}});B("ng:include",function(cX){var cY=this,cW=cX.attr("src"),cZ=cX.attr("scope")||"",cV=cX[0].getAttribute("onload")||"";if(cX[0]["ng:compiled"]){this.descend(true);this.directives(true)}else{cX[0]["ng:compiled"]=true;return b7(function(c5,c2){var c4=this,c0;var c6=0;var c3=false;function c1(){c6++}this.$watch(cW,c1);this.$watch(cZ,c1);c4.$onEval(function(){if(c0&&!c3){c3=true;try{c0.$eval()}finally{c3=false}}});this.$watch(function(){return c6},function(){var c8=this.$eval(cW),c7=this.$eval(cZ);if(c8){c5("GET",c8,function(da,c9){c2.html(c9);c0=c7||bV(c4);cY.compile(c2)(c2,c0);c0.$init();c4.$eval(cV)})}else{c0=null;c2.html("")}})},{$inject:["$xhr.cache"]})}});var m=B("ng:switch",function(cZ){var c0=this,cY=cZ.attr("on"),c2=(cZ.attr("using")||"equals"),cV=c2.split(":"),cW=m[cV.shift()],cX=cZ.attr("change")||"",c1=[];if(!cW){throw"Using expression '"+c2+"' unknown."}if(!cY){throw"Missing 'on' attribute."}aX(cZ,function(c5){var c3=c5.attr("ng:switch-when");var c4={change:cX,element:c5,template:c0.compile(c5)};if(ci(c3)){c4.when=function(c7,c8){var c6=[c8,c3];aS(cV,function(c9){c6.push(c9)});return cW.apply(c7,c6)};c1.unshift(c4)}else{if(ci(c5.attr("ng:switch-default"))){c4.when=cr(true);c1.push(c4)}}});aS(c1,function(c3){c3.element.remove()});cZ.html("");return function(c4){var c5=this,c3;this.$watch(cY,function(c7){var c6=false;c4.html("");c3=bV(c5);aS(c1,function(c8){if(!c6&&c8.when(c3,c7)){c6=true;var c9=A(c8.element);c4.append(c9);c3.$tryEval(c8.change,c4);c8.template(c9,c3);c3.$init()}})});c5.$onEval(function(){if(c3){c3.$eval()}})}},{equals:function(cW,cV){return""+cW==cV},route:bj});B("a",function(){this.descend(true);this.directives(true);return function(cV){if(cV.attr("href")===""){cV.bind("click",function(cW){cW.preventDefault()})}}});B("@ng:repeat",function(cX,cV){cV.removeAttr("ng:repeat");cV.replaceWith(this.comment("ng:repeat: "+cX));var cW=this.compile(cV);return function(cY){var c2=cX.match(/^\s*(.+)\s+in\s+(.*)\s*$/),cZ,c5,c0,c4;if(!c2){throw cK("Expected ng:repeat in form of 'item in collection' but got '"+cX+"'.")}cZ=c2[1];c5=c2[2];c2=cZ.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!c2){throw cK("'item' in 'item in collection' should be identifier or (key, value) but got '"+keyValue+"'.")}c0=c2[3]||c2[1];c4=c2[2];var c3=[],c1=this;this.$onEval(function(){var c8=0,c7=c3.length,dd=cY,dc=this.$tryEval(c5,cY),da=a9(dc),db=0,c6,c9;if(da){db=dc.length}else{for(c9 in dc){if(dc.hasOwnProperty(c9)){db++}}}for(c9 in dc){if(!da||dc.hasOwnProperty(c9)){if(c8<c7){c6=c3[c8];c6[c0]=dc[c9];if(c4){c6[c4]=c9}}else{c6=cW(A(cV),bV(c1));c6[c0]=dc[c9];if(c4){c6[c4]=c9}dd.after(c6.$element);c6.$index=c8;c6.$position=c8==0?"first":(c8==db-1?"last":"middle");c6.$element.attr("ng:repeat-index",c8);c6.$init();c3.push(c6)}c6.$eval();dd=c6.$element;c8++}}while(c3.length>c8){c3.pop().$element.remove()}},cY)}});B("@ng:non-bindable",j);var cj;bs("$browser",function(cV){if(!cj){cj=new aO(bU.location,ck(bU.document),ck(bU.document.getElementsByTagName("head")[0]),L,cV,bU.setTimeout);cj.startPoller(50,function(cW,cX){setTimeout(cW,cX)});cj.bind()}return cj},{inject:["$log"]});b7(aB,{element:ck,compile:a2,scope:bV,copy:bv,extend:b7,equals:p,foreach:aS,injector:bY,noop:j,bind:bF,toJson:cm,fromJson:Q,identity:aG,isUndefined:bB,isDefined:cv,isString:ci,isFunction:E,isObject:cR,isNumber:aU,isArray:a9});aB.scenario=aB.scenario||{};aB.scenario.output=aB.scenario.output||function(cV,cW){aB.scenario.output[cV]=cW};aB.scenario.dsl=aB.scenario.dsl||function(cV,cW){aB.scenario.dsl[cV]=function(){function cX(c3,c1){var cZ=c3.apply(this,c1);if(aB.isFunction(cZ)||cZ instanceof aB.scenario.Future){return cZ}var c0=this;var c2=aB.extend({},cZ);aB.foreach(c2,function(c5,c4){if(aB.isFunction(c5)){c2[c4]=function(){return cX.call(c0,c5,arguments)}}else{c2[c4]=c5}});return c2}var cY=cW.apply(this,arguments);return function(){return cX.call(this,cY,arguments)}}};aB.scenario.matcher=aB.scenario.matcher||function(cV,cW){aB.scenario.matcher[cV]=function(cY){var cZ="expect "+this.future.name+" ";if(this.inverse){cZ+="not "}var cX=this;this.addFuture(cZ+cV+" "+aB.toJson(cY),function(c0){var c1;cX.actual=cX.future.value;if((cX.inverse&&cW.call(cX,cY))||(!cX.inverse&&!cW.call(cX,cY))){c1="expected "+aB.toJson(cY)+" but was "+aB.toJson(cX.actual)}c0(c1)})}};function i(c0,cZ){var cX=bU.location.href;var cV=b8(r.body);var cW=[];if(cZ.scenario_output){cW=cZ.scenario_output.split(",")}aB.foreach(aB.scenario.output,function(c4,c2){if(!cW.length||cO(cW,c2)!=-1){var c3=cV.append("<div></div>").find("div:last");c3.attr("id",c2);c4.call({},c3,c0)}});if(!/^http/.test(cX)&&!/^https/.test(cX)){cV.append('<p id="system-error"></p>');cV.find("#system-error").text("Scenario runner must be run using http or https. The protocol "+cX.split(":")[0]+":// is not supported.");return}var c1=cV.append('<div id="application"></div>').find("#application");var cY=new aB.scenario.Application(c1);c0.on("RunnerEnd",function(){c1.css("display","none");c1.find("iframe").attr("src","about:blank")});c0.on("RunnerError",function(c2){if(bU.console){console.log(V(c2))}else{alert(c2)}});c0.run(cY)}function W(cZ,cY,cW){var cX=0;function cV(c1,c0){if(c0&&c0>cX){cX=c0}if(c1||cX>=cZ.length){cW(c1)}else{try{cY(cZ[cX++],cV)}catch(c2){cW(c2)}}}cV()}function V(cW,cX){cX=cX||5;var cY=cW.toString();if(cW.stack){var cV=cW.stack.split("\n");if(cV[0].indexOf(cY)===-1){cX++;cV.unshift(cW.message)}cY=cV.slice(0,cX).join("\n")}return cY}function x(cW){var cV=new cK();return function(){var cX=(cV.stack||"").split("\n")[cW];if(cX){if(cX.indexOf("@")!==-1){cX=cX.substring(cX.indexOf("@")+1)}else{cX=cX.substring(cX.indexOf("(")+1).replace(")","")}}return cX||""}}function c(cV,cW){if(cV&&!cV.nodeName){cV=cV[0]}if(!cV){return}if(!cW){cW={text:"change",textarea:"change",hidden:"change",password:"change",button:"click",submit:"click",reset:"click",image:"click",checkbox:"click",radio:"click","select-one":"change","select-multiple":"change"}[cV.type]||"click"}if(am(au(cV))=="option"){cV.parentNode.value=cV.value;cV=cV.parentNode;cW="change"}if(at){switch(cV.type){case"radio":case"checkbox":cV.checked=!cV.checked;break}cV.fireEvent("on"+cW);if(am(cV.type)=="submit"){while(cV){if(am(cV.nodeName)=="form"){cV.fireEvent("onsubmit");break}cV=cV.parentNode}}}else{var cX=r.createEvent("MouseEvents");cX.initMouseEvent(cW,true,true,bU,0,0,0,0,0,false,false,false,false,0,cV);cV.dispatchEvent(cX)}}(function(cW){var cV=cW.trigger;cW.trigger=function(cX){if(/(click|change|keyup)/.test(cX)){return this.each(function(cY,cZ){c(cZ,cX)})}return cV.apply(this,arguments)}})(b8.fn);b8.fn.bindings=function(cW){function cX(cZ,cY){return cY instanceof RegExp?cY.test(cZ):cZ&&cZ.indexOf(cY)>=0}var cV=[];this.find(".ng-binding:visible").each(function(){var cY=new b8(this);if(!aB.isDefined(cW)||cX(cY.attr("ng:bind"),cW)||cX(cY.attr("ng:bind-template"),cW)){if(cY.is("input, textarea")){cV.push(cY.val())}else{cV.push(cY.html())}}});return cV};aB.scenario.Application=function(cV){this.context=cV;cV.append('<h2>Current URL: <a href="about:blank">None</a></h2><div id="test-frames"></div>')};aB.scenario.Application.prototype.getFrame_=function(){return this.context.find("#test-frames iframe:last")};aB.scenario.Application.prototype.getWindow_=function(){var cV=this.getFrame_().attr("contentWindow");if(!cV){throw"Frame window is not accessible."}return cV};aB.scenario.Application.prototype.checkUrlStatus_=function(cW,cX){var cV=this;b8.ajax({url:cW,type:"HEAD",complete:function(cY){if(cY.status<200||cY.status>=300){if(!cY.status){cX.call(cV,"Sandbox Error: Cannot access "+cW)}else{cX.call(cV,cY.status+" "+cY.statusText)}}else{cX.call(cV)}}})};aB.scenario.Application.prototype.navigateTo=function(cW,cX,cZ){var cV=this;var cY=this.getFrame_();cZ=cZ||function(c0){throw c0};if(cW==="about:blank"){cZ("Sandbox Error: Navigating to about:blank is not allowed.")}else{if(cW.charAt(0)==="#"){cW=cY.attr("src").split("#")[0]+cW;cY.attr("src",cW);this.executeAction(cX)}else{cY.css("display","none").attr("src","about:blank");this.checkUrlStatus_(cW,function(c0){if(c0){return cZ(c0)}cV.context.find("#test-frames").append("<iframe>");cY=this.getFrame_();cY.load(function(){cY.unbind();try{cV.executeAction(cX)}catch(c1){cZ(c1)}}).attr("src",cW)})}}this.context.find("> h2 a").attr("href",cW).text(cW)};aB.scenario.Application.prototype.executeAction=function(cX){var cW=this;var cY=this.getWindow_();if(!cY.document){throw"Sandbox Error: Application document not accessible."}if(!cY.angular){return cX.call(this,cY,b8(cY.document))}var cV=cY.angular.service.$browser();cV.poll();cV.notifyWhenNoOutstandingRequests(function(){cX.call(cW,cY,b8(cY.document))})};aB.scenario.Describe=function(cW,cY){this.only=cY&&cY.only;this.beforeEachFns=[];this.afterEachFns=[];this.its=[];this.children=[];this.name=cW;this.parent=cY;this.id=aB.scenario.Describe.id++;var cV=this.beforeEachFns;this.setupBefore=function(){if(cY){cY.setupBefore.call(this)}aB.foreach(cV,function(cZ){cZ.call(this)},this)};var cX=this.afterEachFns;this.setupAfter=function(){aB.foreach(cX,function(cZ){cZ.call(this)},this);if(cY){cY.setupAfter.call(this)}}};aB.scenario.Describe.id=0;aB.scenario.Describe.prototype.beforeEach=function(cV){this.beforeEachFns.push(cV)};aB.scenario.Describe.prototype.afterEach=function(cV){this.afterEachFns.push(cV)};aB.scenario.Describe.prototype.describe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.ddescribe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);cX.only=true;this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.xdescribe=aB.noop;aB.scenario.Describe.prototype.it=function(cW,cV){this.its.push({definition:this,only:this.only,name:cW,before:this.setupBefore,body:cV,after:this.setupAfter})};aB.scenario.Describe.prototype.iit=function(cW,cV){this.it.apply(this,arguments);this.its[this.its.length-1].only=true};aB.scenario.Describe.prototype.xit=aB.noop;aB.scenario.Describe.prototype.getSpecs=function(){var cW=arguments[0]||[];aB.foreach(this.children,function(cX){cX.getSpecs(cW)});aB.foreach(this.its,function(cX){cW.push(cX)});var cV=[];aB.foreach(cW,function(cX){if(cX.only){cV.push(cX)}});return(cV.length&&cV)||cW};aB.scenario.Future=function(cW,cX,cV){this.name=cW;this.behavior=cX;this.fulfilled=false;this.value=undefined;this.parser=aB.identity;this.line=cV||function(){return""}};aB.scenario.Future.prototype.execute=function(cW){var cV=this;this.behavior(function(cY,cX){cV.fulfilled=true;if(cX){try{cX=cV.parser(cX)}catch(cZ){cY=cZ}}cV.value=cY||cX;cW(cY,cX)})};aB.scenario.Future.prototype.parsedWith=function(cV){this.parser=cV;return this};aB.scenario.Future.prototype.fromJson=function(){return this.parsedWith(aB.fromJson)};aB.scenario.Future.prototype.toJson=function(){return this.parsedWith(aB.toJson)};aB.scenario.ObjectModel=function(cX){var cW=this;this.specMap={};this.value={name:"",children:{}};cX.on("SpecBegin",function(cY){var cZ=cW.value;aB.foreach(cW.getDefinitionPath(cY),function(c0){if(!cZ.children[c0.name]){cZ.children[c0.name]={id:c0.id,name:c0.name,children:{},specs:{}}}cZ=cZ.children[c0.name]});cW.specMap[cY.id]=cZ.specs[cY.name]=new aB.scenario.ObjectModel.Spec(cY.id,cY.name)});cX.on("SpecError",function(cY,cZ){var c0=cW.getSpec(cY.id);c0.status="error";c0.error=cZ});cX.on("SpecEnd",function(cY){var cZ=cW.getSpec(cY.id);cV(cZ)});cX.on("StepBegin",function(cY,c0){var cZ=cW.getSpec(cY.id);cZ.steps.push(new aB.scenario.ObjectModel.Step(c0.name))});cX.on("StepEnd",function(cY,c0){var cZ=cW.getSpec(cY.id);if(cZ.getLastStep().name!==c0.name){throw"Events fired in the wrong order. Step names don' match."}cV(cZ.getLastStep())});cX.on("StepFailure",function(cY,c2,cZ){var c0=cW.getSpec(cY.id);var c1=c0.getLastStep();c1.error=cZ;if(!c0.status){c0.status=c1.status="failure"}});cX.on("StepError",function(cY,c2,cZ){var c0=cW.getSpec(cY.id);var c1=c0.getLastStep();c0.status="error";c1.status="error";c1.error=cZ});function cV(cY){cY.endTime=new Date().getTime();cY.duration=cY.endTime-cY.startTime;cY.status=cY.status||"success"}};aB.scenario.ObjectModel.prototype.getDefinitionPath=function(cV){var cX=[];var cW=cV.definition;while(cW&&cW.name){cX.unshift(cW);cW=cW.parent}return cX};aB.scenario.ObjectModel.prototype.getSpec=function(cV){return this.specMap[cV]};aB.scenario.ObjectModel.Spec=function(cW,cV){this.id=cW;this.name=cV;this.startTime=new Date().getTime();this.steps=[]};aB.scenario.ObjectModel.Spec.prototype.addStep=function(cV){var cW=new aB.scenario.ObjectModel.Step(cV);this.steps.push(cW);return cW};aB.scenario.ObjectModel.Spec.prototype.getLastStep=function(){return this.steps[this.steps.length-1]};aB.scenario.ObjectModel.Step=function(cV){this.name=cV;this.startTime=new Date().getTime()};aB.scenario.Describe=function(cW,cY){this.only=cY&&cY.only;this.beforeEachFns=[];this.afterEachFns=[];this.its=[];this.children=[];this.name=cW;this.parent=cY;this.id=aB.scenario.Describe.id++;var cV=this.beforeEachFns;this.setupBefore=function(){if(cY){cY.setupBefore.call(this)}aB.foreach(cV,function(cZ){cZ.call(this)},this)};var cX=this.afterEachFns;this.setupAfter=function(){aB.foreach(cX,function(cZ){cZ.call(this)},this);if(cY){cY.setupAfter.call(this)}}};aB.scenario.Describe.id=0;aB.scenario.Describe.prototype.beforeEach=function(cV){this.beforeEachFns.push(cV)};aB.scenario.Describe.prototype.afterEach=function(cV){this.afterEachFns.push(cV)};aB.scenario.Describe.prototype.describe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.ddescribe=function(cW,cV){var cX=new aB.scenario.Describe(cW,this);cX.only=true;this.children.push(cX);cV.call(cX)};aB.scenario.Describe.prototype.xdescribe=aB.noop;aB.scenario.Describe.prototype.it=function(cW,cV){this.its.push({definition:this,only:this.only,name:cW,before:this.setupBefore,body:cV,after:this.setupAfter})};aB.scenario.Describe.prototype.iit=function(cW,cV){this.it.apply(this,arguments);this.its[this.its.length-1].only=true};aB.scenario.Describe.prototype.xit=aB.noop;aB.scenario.Describe.prototype.getSpecs=function(){var cW=arguments[0]||[];aB.foreach(this.children,function(cX){cX.getSpecs(cW)});aB.foreach(this.its,function(cX){cW.push(cX)});var cV=[];aB.foreach(cW,function(cX){if(cX.only){cV.push(cX)}});return(cV.length&&cV)||cW};aB.scenario.Runner=function(cV){this.listeners=[];this.$window=cV;this.rootDescribe=new aB.scenario.Describe();this.currentDescribe=this.rootDescribe;this.api={it:this.it,iit:this.iit,xit:aB.noop,describe:this.describe,ddescribe:this.ddescribe,xdescribe:aB.noop,beforeEach:this.beforeEach,afterEach:this.afterEach};aB.foreach(this.api,aB.bind(this,function(cX,cW){this.$window[cW]=aB.bind(this,cX)}))};aB.scenario.Runner.prototype.emit=function(cW){var cV=this;var cX=Array.prototype.slice.call(arguments,1);cW=cW.toLowerCase();if(!this.listeners[cW]){return}aB.foreach(this.listeners[cW],function(cY){cY.apply(cV,cX)})};aB.scenario.Runner.prototype.on=function(cV,cW){cV=cV.toLowerCase();this.listeners[cV]=this.listeners[cV]||[];this.listeners[cV].push(cW)};aB.scenario.Runner.prototype.describe=function(cX,cV){var cW=this;this.currentDescribe.describe(cX,function(){var cY=cW.currentDescribe;cW.currentDescribe=this;try{cV.call(this)}finally{cW.currentDescribe=cY}})};aB.scenario.Runner.prototype.ddescribe=function(cX,cV){var cW=this;this.currentDescribe.ddescribe(cX,function(){var cY=cW.currentDescribe;cW.currentDescribe=this;try{cV.call(this)}finally{cW.currentDescribe=cY}})};aB.scenario.Runner.prototype.it=function(cW,cV){this.currentDescribe.it(cW,cV)};aB.scenario.Runner.prototype.iit=function(cW,cV){this.currentDescribe.iit(cW,cV)};aB.scenario.Runner.prototype.beforeEach=function(cV){this.currentDescribe.beforeEach(cV)};aB.scenario.Runner.prototype.afterEach=function(cV){this.currentDescribe.afterEach(cV)};aB.scenario.Runner.prototype.createSpecRunner_=function(cV){return cV.$new(aB.scenario.SpecRunner)};aB.scenario.Runner.prototype.run=function(cW){var cV=this;var cX=aB.scope(this);cX.application=cW;this.emit("RunnerBegin");W(this.rootDescribe.getSpecs(),function(cY,c1){var cZ={};var c0=cV.createSpecRunner_(cX);aB.foreach(aB.scenario.dsl,function(c3,c2){cZ[c2]=c3.call(cX)});aB.foreach(aB.scenario.dsl,function(c3,c2){cV.$window[c2]=function(){var c4=x(3);var c5=aB.scope(c0);c5.dsl={};aB.foreach(cZ,function(c7,c6){c5.dsl[c6]=function(){return cZ[c6].apply(c5,arguments)}});c5.addFuture=function(){Array.prototype.push.call(arguments,c4);return aB.scenario.SpecRunner.prototype.addFuture.apply(c5,arguments)};c5.addFutureAction=function(){Array.prototype.push.call(arguments,c4);return aB.scenario.SpecRunner.prototype.addFutureAction.apply(c5,arguments)};return c5.dsl[c2].apply(c5,arguments)}});c0.run(cY,c1)},function(cY){if(cY){cV.emit("RunnerError",cY)}cV.emit("RunnerEnd")})};aB.scenario.SpecRunner=function(){this.futures=[];this.afterIndex=0};aB.scenario.SpecRunner.prototype.run=function(cW,cY){var cV=this;this.spec=cW;this.emit("SpecBegin",cW);try{cW.before.call(this);cW.body.call(this);this.afterIndex=this.futures.length;cW.after.call(this)}catch(cX){this.emit("SpecError",cW,cX);this.emit("SpecEnd",cW);cY();return}var cZ=function(c1,c0){if(cV.error){return c0()}cV.error=true;c0(null,cV.afterIndex)};W(this.futures,function(c0,c1){cV.step=c0;cV.emit("StepBegin",cW,c0);try{c0.execute(function(c3){if(c3){cV.emit("StepFailure",cW,c0,c3);cV.emit("StepEnd",cW,c0);return cZ(c3,c1)}cV.emit("StepEnd",cW,c0);cV.$window.setTimeout(function(){c1()},0)})}catch(c2){cV.emit("StepError",cW,c0,c2);cV.emit("StepEnd",cW,c0);cZ(c2,c1)}},function(c0){if(c0){cV.emit("SpecError",cW,c0)}cV.emit("SpecEnd",cW);cV.$window.setTimeout(function(){cY()},0)})};aB.scenario.SpecRunner.prototype.addFuture=function(cX,cY,cW){var cV=new aB.scenario.Future(cX,aB.bind(this,cY),cW);this.futures.push(cV);return cV};aB.scenario.SpecRunner.prototype.addFutureAction=function(cX,cY,cV){var cW=this;return this.addFuture(cX,function(cZ){this.application.executeAction(function(c2,c1){c1.elements=function(c4){var c5=Array.prototype.slice.call(arguments,1);c4=(cW.selector||"")+" "+(c4||"");c4=b8.trim(c4)||"*";aB.foreach(c5,function(c7,c6){c4=c4.replace("$"+(c6+1),c7)});var c3=c1.find(c4);if(!c3.length){throw {type:"selector",message:"Selector "+c4+" did not match any elements."}}return c3};try{cY.call(cW,c2,c1,cZ)}catch(c0){if(c0.type&&c0.type==="selector"){cZ(c0.message)}else{throw c0}}})},cV)};aB.scenario.dsl("wait",function(){return function(){return this.addFuture("waiting for you to resume",function(cV){this.emit("InteractiveWait",this.spec,this.step);this.$window.resume=function(){cV()}})}});aB.scenario.dsl("pause",function(){return function(cV){return this.addFuture("pause for "+cV+" seconds",function(cW){this.$window.setTimeout(function(){cW(null,cV*1000)},cV*1000)})}});aB.scenario.dsl("browser",function(){var cV={};cV.navigateTo=function(cX,cY){var cW=this.application;return this.addFuture("browser navigate to '"+cX+"'",function(cZ){if(cY){cX=cY.call(this,cX)}cW.navigateTo(cX,function(){cZ(null,cX)},cZ)})};cV.reload=function(){var cW=this.application;return this.addFutureAction("browser reload",function(c0,cZ,cX){var cY=c0.location.href;cW.navigateTo(cY,function(){cX(null,cY)},cX)})};cV.location=function(){var cW={};cW.href=function(){return this.addFutureAction("browser url",function(cZ,cY,cX){cX(null,cZ.location.href)})};cW.hash=function(){return this.addFutureAction("browser url hash",function(cZ,cY,cX){cX(null,cZ.location.hash.replace("#",""))})};cW.path=function(){return this.addFutureAction("browser url path",function(cZ,cY,cX){cX(null,cZ.location.pathname)})};cW.search=function(){return this.addFutureAction("browser url search",function(cZ,cY,cX){cX(null,cZ.angular.scope().$location.search)})};cW.hashSearch=function(){return this.addFutureAction("browser url hash search",function(cZ,cY,cX){cX(null,cZ.angular.scope().$location.hashSearch)})};cW.hashPath=function(){return this.addFutureAction("browser url hash path",function(cZ,cY,cX){cX(null,cZ.angular.scope().$location.hashPath)})};return cW};return function(cW){return cV}});aB.scenario.dsl("expect",function(){var cV=aB.extend({},aB.scenario.matcher);cV.not=function(){this.inverse=true;return cV};return function(cW){this.future=cW;return cV}});aB.scenario.dsl("using",function(){return function(cV,cW){this.selector=b8.trim((this.selector||"")+" "+cV);if(aB.isString(cW)&&cW.length){this.label=cW+" ( "+this.selector+" )"}else{this.label=this.selector}return this.dsl}});aB.scenario.dsl("binding",function(){return function(cV){return this.addFutureAction("select binding '"+cV+"'",function(cZ,cY,cW){var cX=cY.elements().bindings(cV);if(!cX.length){return cW("Binding selector '"+cV+"' did not match.")}cW(null,cX[0])})}});aB.scenario.dsl("input",function(){var cV={};cV.enter=function(cW){return this.addFutureAction("input '"+this.name+"' enter '"+cW+"'",function(c0,cZ,cX){var cY=cZ.elements(':input[name="$1"]',this.name);cY.val(cW);cY.trigger("change");cX()})};cV.check=function(){return this.addFutureAction("checkbox '"+this.name+"' toggle",function(cZ,cY,cW){var cX=cY.elements(':checkbox[name="$1"]',this.name);cX.trigger("click");cW()})};cV.select=function(cW){return this.addFutureAction("radio button '"+this.name+"' toggle '"+cW+"'",function(c0,cZ,cX){var cY=cZ.elements(':radio[name$="@$1"][value="$2"]',this.name,cW);cY.trigger("click");cX()})};return function(cW){this.name=cW;return cV}});aB.scenario.dsl("repeater",function(){var cV={};cV.count=function(){return this.addFutureAction("repeater '"+this.label+"' count",function(cZ,cY,cW){try{cW(null,cY.elements().length)}catch(cX){cW(null,0)}})};cV.column=function(cW){return this.addFutureAction("repeater '"+this.label+"' column '"+cW+"'",function(cZ,cY,cX){cX(null,cY.elements().bindings(cW))})};cV.row=function(cW){return this.addFutureAction("repeater '"+this.label+"' row '"+cW+"'",function(c1,c0,cX){var cY=[];var cZ=c0.elements().slice(cW,cW+1);if(!cZ.length){return cX("row "+cW+" out of bounds")}cX(null,cZ.bindings())})};return function(cW,cX){this.dsl.using(cW,cX);return cV}});aB.scenario.dsl("select",function(){var cV={};cV.option=function(cW){return this.addFutureAction("select '"+this.name+"' option '"+cW+"'",function(c0,cZ,cY){var cX=cZ.elements('select[name="$1"]',this.name);cX.val(cW);cX.trigger("change");cY()})};cV.options=function(){var cW=arguments;return this.addFutureAction("select '"+this.name+"' options '"+cW+"'",function(c0,cZ,cY){var cX=cZ.elements('select[multiple][name="$1"]',this.name);cX.val(cW);cX.trigger("change");cY()})};return function(cW){this.name=cW;return cV}});aB.scenario.dsl("element",function(){var cV=["attr","css"];var cX=["val","text","html","height","innerHeight","outerHeight","width","innerWidth","outerWidth","position","scrollLeft","scrollTop","offset"];var cW={};cW.count=function(){return this.addFutureAction("element '"+this.label+"' count",function(c1,c0,cY){try{cY(null,c0.elements().length)}catch(cZ){cY(null,0)}})};cW.click=function(){return this.addFutureAction("element '"+this.label+"' click",function(c2,c1,cY){var c0=c1.elements();var cZ=c0.attr("href");c0.trigger("click");if(cZ&&c0[0].nodeName.toUpperCase()==="A"){this.application.navigateTo(cZ,function(){cY()},cY)}else{cY()}})};cW.query=function(cY){return this.addFutureAction("element "+this.label+" custom query",function(c1,c0,cZ){cY.call(this,c0.elements(),cZ)})};aB.foreach(cV,function(cY){cW[cY]=function(cZ,c1){var c0="element '"+this.label+"' get "+cY+" '"+cZ+"'";if(aB.isDefined(c1)){c0="element '"+this.label+"' set "+cY+" '"+cZ+"' to '"+c1+"'"}return this.addFutureAction(c0,function(c5,c4,c2){var c3=c4.elements();c2(null,c3[cY].call(c3,cZ,c1))})}});aB.foreach(cX,function(cY){cW[cY]=function(c0){var cZ="element '"+this.label+"' "+cY;if(aB.isDefined(c0)){cZ="element '"+this.label+"' set "+cY+" to '"+c0+"'"}return this.addFutureAction(cZ,function(c4,c3,c1){var c2=c3.elements();c1(null,c2[cY].call(c2,c0))})}});return function(cY,cZ){this.dsl.using(cY,cZ);return cW}});aB.scenario.matcher("toEqual",function(cV){return aB.equals(this.actual,cV)});aB.scenario.matcher("toBe",function(cV){return this.actual===cV});aB.scenario.matcher("toBeDefined",function(){return aB.isDefined(this.actual)});aB.scenario.matcher("toBeTruthy",function(){return this.actual});aB.scenario.matcher("toBeFalsy",function(){return !this.actual});aB.scenario.matcher("toMatch",function(cV){return new RegExp(cV).test(this.actual)});aB.scenario.matcher("toBeNull",function(){return this.actual===null});aB.scenario.matcher("toContain",function(cV){return u(this.actual,cV)});aB.scenario.matcher("toBeLessThan",function(cV){return this.actual<cV});aB.scenario.matcher("toBeGreaterThan",function(cV){return this.actual>cV});aB.scenario.output("html",function(cY,c0){var cX=new aB.scenario.ObjectModel(c0);cY.append('<div id="header"> <h1><span class="angular">&lt;angular/&gt;</span>: Scenario Test Runner</h1> <ul id="status-legend" class="status-display"> <li class="status-error">0 Errors</li> <li class="status-failure">0 Failures</li> <li class="status-success">0 Passed</li> </ul></div><div id="specs"> <div class="test-children"></div></div>');c0.on("InteractiveWait",function(c1,c2){var c3=cX.getSpec(c1.id).getLastStep().ui;c3.find(".test-title").html('waiting for you to <a href="javascript:resume()">resume</a>.')});c0.on("SpecBegin",function(c1){var c2=cZ(c1);c2.find("> .tests").append('<li class="status-pending test-it"></li>');c2=c2.find("> .tests li:last");c2.append('<div class="test-info"> <p class="test-title"> <span class="timer-result"></span> <span class="test-name"></span> </p></div><div class="scrollpane"> <ol class="test-actions"></ol></div>');c2.find("> .test-info .test-name").text(c1.name);c2.find("> .test-info").click(function(){var c4=c2.find("> .scrollpane");var c5=c4.find("> .test-actions");var c3=cY.find("> .test-info .test-name");if(c5.find(":visible").length){c5.hide();c3.removeClass("open").addClass("closed")}else{c5.show();c4.attr("scrollTop",c4.attr("scrollHeight"));c3.removeClass("closed").addClass("open")}});cX.getSpec(c1.id).ui=c2});c0.on("SpecError",function(c1,c2){var c3=cX.getSpec(c1.id).ui;c3.append("<pre></pre>");c3.find("> pre").text(V(c2))});c0.on("SpecEnd",function(c1){c1=cX.getSpec(c1.id);c1.ui.removeClass("status-pending");c1.ui.addClass("status-"+c1.status);c1.ui.find("> .test-info .timer-result").text(c1.duration+"ms");if(c1.status==="success"){c1.ui.find("> .test-info .test-name").addClass("closed");c1.ui.find("> .scrollpane .test-actions").hide()}cW(c1.status)});c0.on("StepBegin",function(c1,c3){c1=cX.getSpec(c1.id);c3=c1.getLastStep();c1.ui.find("> .scrollpane .test-actions").append('<li class="status-pending"></li>');c3.ui=c1.ui.find("> .scrollpane .test-actions li:last");c3.ui.append('<div class="timer-result"></div><div class="test-title"></div>');c3.ui.find("> .test-title").text(c3.name);var c2=c3.ui.parents(".scrollpane");c2.attr("scrollTop",c2.attr("scrollHeight"))});c0.on("StepFailure",function(c1,c3,c2){var c4=cX.getSpec(c1.id).getLastStep().ui;cV(c4,c3.line,c2)});c0.on("StepError",function(c1,c3,c2){var c4=cX.getSpec(c1.id).getLastStep().ui;cV(c4,c3.line,c2)});c0.on("StepEnd",function(c1,c3){c1=cX.getSpec(c1.id);c3=c1.getLastStep();c3.ui.find(".timer-result").text(c3.duration+"ms");c3.ui.removeClass("status-pending");c3.ui.addClass("status-"+c3.status);var c2=c1.ui.find("> .scrollpane");c2.attr("scrollTop",c2.attr("scrollHeight"))});function cZ(c1){var c2=cY.find("#specs");aB.foreach(cX.getDefinitionPath(c1),function(c3){var c4="describe-"+c3.id;if(!cY.find("#"+c4).length){c2.find("> .test-children").append('<div class="test-describe" id="'+c4+'"> <h2></h2> <div class="test-children"></div> <ul class="tests"></ul></div>');cY.find("#"+c4).find("> h2").text("describe: "+c3.name)}c2=cY.find("#"+c4)});return cY.find("#describe-"+c1.definition.id)}function cW(c1){var c2=cY.find("#status-legend .status-"+c1);var c4=c2.text().split(" ");var c3=(c4[0]*1)+1;c2.text(c3+" "+c4[1])}function cV(c3,c1,c2){c3.find(".test-title").append("<pre></pre>");var c4=b8.trim(c1()+"\n\n"+V(c2));c3.find(".test-title pre:last").text(c4)}});aB.scenario.output("json",function(cW,cX){var cV=new aB.scenario.ObjectModel(cX);cX.on("RunnerEnd",function(){cW.text(aB.toJson(cV.value))})});aB.scenario.output("xml",function(cW,cY){var cV=new aB.scenario.ObjectModel(cY);var cZ=function(c0){return new cW.init(c0)};cY.on("RunnerEnd",function(){var c0=cZ("<scenario></scenario>");cW.append(c0);cX(c0,cV.value)});function cX(c2,c0){aB.foreach(c0.children,function(c4){var c3=cZ("<describe></describe>");c3.attr("id",c4.id);c3.attr("name",c4.name);c2.append(c3);cX(c3,c4)});var c1=cZ("<its></its>");c2.append(c1);aB.foreach(c0.specs,function(c3){var c4=cZ("<it></it>");c4.attr("id",c3.id);c4.attr("name",c3.name);c4.attr("duration",c3.duration);c4.attr("status",c3.status);c1.append(c4);aB.foreach(c3.steps,function(c7){var c6=cZ("<step></step>");c6.attr("name",c7.name);c6.attr("duration",c7.duration);c6.attr("status",c7.status);c4.append(c6);if(c7.error){var c5=cZ("<error></error");c6.append(c5);c5.text(V(c6.error))}})})}});aB.scenario.output("object",function(cV,cW){cW.$window.$result=new aB.scenario.ObjectModel(cW).value});var ak=new aB.scenario.Runner(bU);bU.onload=function(){try{if(bi){bi()}}catch(cV){}i(ak,bH(r))}})(window,document,window.onload);document.write('<style type="text/css">@charset "UTF-8";\n\n.ng-format-negative {\n color: red;\n}\n\n.ng-exception {\n border: 2px solid #FF0000;\n font-family: "Courier New", Courier, monospace;\n font-size: smaller;\n white-space: pre;\n}\n\n.ng-validation-error {\n border: 2px solid #FF0000;\n}\n\n\n/*****************\n * TIP\n *****************/\n#ng-callout {\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n font-size: 13px;\n font-weight: normal;\n font-family: Verdana, Arial, Helvetica, sans-serif;\n vertical-align: baseline;\n background: transparent;\n text-decoration: none;\n}\n\n#ng-callout .ng-arrow-left{\n background-image: url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7");\n background-repeat: no-repeat;\n background-position: left top;\n position: absolute;\n z-index:101;\n left:-12px;\n height:23px;\n width:10px;\n top:-3px;\n}\n\n#ng-callout .ng-arrow-right{\n background-image: url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7");\n background-repeat: no-repeat;\n background-position: left top;\n position: absolute;\n z-index:101;\n height:23px;\n width:11px;\n top:-2px;\n}\n\n#ng-callout {\n position: absolute;\n z-index:100;\n border: 2px solid #CCCCCC;\n background-color: #fff;\n}\n\n#ng-callout .ng-content{\n padding:10px 10px 10px 10px;\n color:#333333;\n}\n\n#ng-callout .ng-title{\n background-color: #CCCCCC;\n text-align: left;\n padding-left: 8px;\n padding-bottom: 5px;\n padding-top: 2px;\n font-weight:bold;\n}\n\n\n/*****************\n * indicators\n *****************/\n.ng-input-indicator-wait {\n background-image: url("data:image/png;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQJCgAAACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkECQoAAAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkECQoAAAAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAkKAAAALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAkKAAAALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQJCgAAACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQJCgAAACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==");\n background-position: right;\n background-repeat: no-repeat;\n}\n</style>');document.write("<style type=\"text/css\">@charset \"UTF-8\";\n/* CSS Document */\n\n/** Structure */\nbody {\n font-family: Arial, sans-serif;\n margin: 0;\n font-size: 14px;\n}\n\n#system-error {\n font-size: 1.5em;\n text-align: center;\n}\n\n#json, #xml {\n display: none;\n}\n\n#header {\n position: fixed;\n width: 100%;\n}\n\n#specs {\n padding-top: 50px;\n}\n\n#header .angular {\n font-family: Courier New, monospace;\n font-weight: bold;\n}\n\n#header h1 {\n font-weight: normal;\n float: left;\n font-size: 30px;\n line-height: 30px;\n margin: 0;\n padding: 10px 10px;\n height: 30px;\n}\n\n#application h2,\n#specs h2 {\n margin: 0;\n padding: 0.5em;\n font-size: 1.1em;\n}\n\n#status-legend {\n margin-top: 10px;\n margin-right: 10px;\n}\n\n#header,\n#application,\n.test-info,\n.test-actions li {\n overflow: hidden;\n}\n\n#application {\n margin: 10px;\n}\n\n#application iframe {\n width: 100%;\n height: 758px;\n}\n\n#application .popout {\n float: right;\n}\n\n#application iframe {\n border: none;\n}\n\n.tests li,\n.test-actions li,\n.test-it li,\n.test-it ol,\n.status-display {\n list-style-type: none;\n}\n\n.tests,\n.test-it ol,\n.status-display {\n margin: 0;\n padding: 0;\n}\n\n.test-info {\n margin-left: 1em;\n margin-top: 0.5em;\n border-radius: 8px 0 0 8px;\n -webkit-border-radius: 8px 0 0 8px;\n -moz-border-radius: 8px 0 0 8px;\n cursor: pointer;\n}\n\n.test-info:hover .test-name {\n text-decoration: underline;\n}\n\n.test-info .closed:before {\n content: '\\25b8\\00A0';\n}\n\n.test-info .open:before {\n content: '\\25be\\00A0';\n font-weight: bold;\n}\n\n.test-it ol {\n margin-left: 2.5em;\n}\n\n.status-display,\n.status-display li {\n float: right;\n}\n\n.status-display li {\n padding: 5px 10px;\n}\n\n.timer-result,\n.test-title {\n display: inline-block;\n margin: 0;\n padding: 4px;\n}\n\n.test-actions .test-title,\n.test-actions .test-result {\n display: table-cell;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n\n.test-actions {\n display: table;\n}\n\n.test-actions li {\n display: table-row;\n}\n\n.timer-result {\n width: 4em;\n padding: 0 10px;\n text-align: right;\n font-family: monospace;\n}\n\n.test-it pre,\n.test-actions pre {\n clear: left;\n color: black;\n margin-left: 6em;\n}\n\n.test-describe {\n padding-bottom: 0.5em;\n}\n\n.test-describe .test-describe {\n margin: 5px 5px 10px 2em;\n}\n\n.test-actions .status-pending .test-title:before {\n content: '\\00bb\\00A0';\n}\n\n.scrollpane {\n max-height: 20em;\n overflow: auto;\n}\n\n/** Colors */\n\n#header {\n background-color: #F2C200;\n}\n\n#specs h2 {\n border-top: 2px solid #BABAD1;\n}\n\n#specs h2,\n#application h2 {\n background-color: #efefef;\n}\n\n#application {\n border: 1px solid #BABAD1;\n}\n\n.test-describe .test-describe {\n border-left: 1px solid #BABAD1;\n border-right: 1px solid #BABAD1;\n border-bottom: 1px solid #BABAD1;\n}\n\n.status-display {\n border: 1px solid #777;\n}\n\n.status-display .status-pending,\n.status-pending .test-info {\n background-color: #F9EEBC;\n}\n\n.status-display .status-success,\n.status-success .test-info {\n background-color: #B1D7A1;\n}\n\n.status-display .status-failure,\n.status-failure .test-info {\n background-color: #FF8286;\n}\n\n.status-display .status-error,\n.status-error .test-info {\n background-color: black;\n color: white;\n}\n\n.test-actions .status-success .test-title {\n color: #30B30A;\n}\n\n.test-actions .status-failure .test-title {\n color: #DF0000;\n}\n\n.test-actions .status-error .test-title {\n color: black;\n}\n\n.test-actions .timer-result {\n color: #888;\n}\n</style>");
ajax/libs/forerunnerdb/1.3.52/fdb-core.js
BitsyCode/cdnjs
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ var Core = _dereq_('../lib/Core'), ShimIE8 = _dereq_('../lib/Shim.IE8'); if (typeof window !== 'undefined') { window.ForerunnerDB = Core; } module.exports = Core; },{"../lib/Core":3,"../lib/Shim.IE8":24}],2:[function(_dereq_,module,exports){ "use strict"; var Shared, Db, Metrics, KeyValueStore, Path, IndexHashMap, IndexBinaryTree, Crc, Overload, ReactorIO; Shared = _dereq_('./Shared'); /** * Creates a new collection. Collections store multiple documents and * handle CRUD against those documents. * @constructor */ var Collection = function (name) { this.init.apply(this, arguments); }; Collection.prototype.init = function (name) { this._primaryKey = '_id'; this._primaryIndex = new KeyValueStore('primary'); this._primaryCrc = new KeyValueStore('primaryCrc'); this._crcLookup = new KeyValueStore('crcLookup'); this._name = name; this._data = []; this._metrics = new Metrics(); this._deferQueue = { insert: [], update: [], remove: [], upsert: [] }; this._deferThreshold = { insert: 100, update: 100, remove: 100, upsert: 100 }; this._deferTime = { insert: 1, update: 1, remove: 1, upsert: 1 }; // Set the subset to itself since it is the root collection this._subsetOf(this); }; Shared.addModule('Collection', Collection); Shared.mixin(Collection.prototype, 'Mixin.Common'); Shared.mixin(Collection.prototype, 'Mixin.Events'); Shared.mixin(Collection.prototype, 'Mixin.ChainReactor'); Shared.mixin(Collection.prototype, 'Mixin.CRUD'); Shared.mixin(Collection.prototype, 'Mixin.Constants'); Shared.mixin(Collection.prototype, 'Mixin.Triggers'); Shared.mixin(Collection.prototype, 'Mixin.Sorting'); Shared.mixin(Collection.prototype, 'Mixin.Matching'); Shared.mixin(Collection.prototype, 'Mixin.Updating'); Metrics = _dereq_('./Metrics'); KeyValueStore = _dereq_('./KeyValueStore'); Path = _dereq_('./Path'); IndexHashMap = _dereq_('./IndexHashMap'); IndexBinaryTree = _dereq_('./IndexBinaryTree'); Crc = _dereq_('./Crc'); Db = Shared.modules.Db; Overload = _dereq_('./Overload'); ReactorIO = _dereq_('./ReactorIO'); /** * Returns a checksum of a string. * @param {String} string The string to checksum. * @return {String} The checksum generated. */ Collection.prototype.crc = Crc; /** * Gets / sets the current state. * @param {String=} val The name of the state to set. * @returns {*} */ Shared.synthesize(Collection.prototype, 'state'); /** * Gets / sets the name of the collection. * @param {String=} val The name of the collection to set. * @returns {*} */ Shared.synthesize(Collection.prototype, 'name'); /** * Get the internal data array that represents the collection's data. * This data is returned by reference and should not be altered outside * of the provided CRUD functionality of the collection as doing so * may cause unstable index behaviour within the collection. * @returns {Array} */ Collection.prototype.data = function () { return this._data; }; /** * Drops a collection and all it's stored data from the database. * @returns {boolean} True on success, false on failure. */ Collection.prototype.drop = function (callback) { var key; if (this._state !== 'dropped') { if (this._db && this._db._collection && this._name) { if (this.debug()) { console.log('Dropping collection ' + this._name); } this._state = 'dropped'; this.emit('drop', this); delete this._db._collection[this._name]; // Remove any reactor IO chain links if (this._collate) { for (key in this._collate) { if (this._collate.hasOwnProperty(key)) { this.collateRemove(key); } } } delete this._primaryKey; delete this._primaryIndex; delete this._primaryCrc; delete this._crcLookup; delete this._name; delete this._data; delete this._metrics; if (callback) { callback(false, true); } return true; } } else { if (callback) { callback(false, true); } return true; } if (callback) { callback(false, true); } return false; }; /** * Gets / sets the primary key for this collection. * @param {String=} keyName The name of the primary key. * @returns {*} */ Collection.prototype.primaryKey = function (keyName) { if (keyName !== undefined) { if (this._primaryKey !== keyName) { this._primaryKey = keyName; // Set the primary key index primary key this._primaryIndex.primaryKey(keyName); // Rebuild the primary key index this.rebuildPrimaryKeyIndex(); } return this; } return this._primaryKey; }; /** * Handles insert events and routes changes to binds and views as required. * @param {Array} inserted An array of inserted documents. * @param {Array} failed An array of documents that failed to insert. * @private */ Collection.prototype._onInsert = function (inserted, failed) { this.emit('insert', inserted, failed); }; /** * Handles update events and routes changes to binds and views as required. * @param {Array} items An array of updated documents. * @private */ Collection.prototype._onUpdate = function (items) { this.emit('update', items); }; /** * Handles remove events and routes changes to binds and views as required. * @param {Array} items An array of removed documents. * @private */ Collection.prototype._onRemove = function (items) { this.emit('remove', items); }; /** * Gets / sets the db instance this class instance belongs to. * @param {Db=} db The db instance. * @returns {*} */ Shared.synthesize(Collection.prototype, 'db', function (db) { if (db) { if (this.primaryKey() === '_id') { // Set primary key to the db's key by default this.primaryKey(db.primaryKey()); } } return this.$super.apply(this, arguments); }); /** * Sets the collection's data to the array of documents passed. * @param data * @param options Optional options object. * @param callback Optional callback function. */ Collection.prototype.setData = function (data, options, callback) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } if (data) { var op = this._metrics.create('setData'); op.start(); options = this.options(options); this.preSetData(data, options, callback); if (options.$decouple) { data = this.decouple(data); } if (!(data instanceof Array)) { data = [data]; } op.time('transformIn'); data = this.transformIn(data); op.time('transformIn'); var oldData = [].concat(this._data); this._dataReplace(data); // Update the primary key index op.time('Rebuild Primary Key Index'); this.rebuildPrimaryKeyIndex(options); op.time('Rebuild Primary Key Index'); // Rebuild all other indexes op.time('Rebuild All Other Indexes'); this._rebuildIndexes(); op.time('Rebuild All Other Indexes'); op.time('Resolve chains'); this.chainSend('setData', data, {oldData: oldData}); op.time('Resolve chains'); op.stop(); this.emit('setData', this._data, oldData); } if (callback) { callback(false); } return this; }; /** * Drops and rebuilds the primary key index for all documents in the collection. * @param {Object=} options An optional options object. * @private */ Collection.prototype.rebuildPrimaryKeyIndex = function (options) { options = options || { $ensureKeys: undefined, $violationCheck: undefined }; var ensureKeys = options && options.$ensureKeys !== undefined ? options.$ensureKeys : true, violationCheck = options && options.$violationCheck !== undefined ? options.$violationCheck : true, arr, arrCount, arrItem, pIndex = this._primaryIndex, crcIndex = this._primaryCrc, crcLookup = this._crcLookup, pKey = this._primaryKey, jString; // Drop the existing primary index pIndex.truncate(); crcIndex.truncate(); crcLookup.truncate(); // Loop the data and check for a primary key in each object arr = this._data; arrCount = arr.length; while (arrCount--) { arrItem = arr[arrCount]; if (ensureKeys) { // Make sure the item has a primary key this.ensurePrimaryKey(arrItem); } if (violationCheck) { // Check for primary key violation if (!pIndex.uniqueSet(arrItem[pKey], arrItem)) { // Primary key violation throw('ForerunnerDB.Collection "' + this.name() + '": Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: ' + arrItem[this._primaryKey]); } } else { pIndex.set(arrItem[pKey], arrItem); } // Generate a CRC string jString = JSON.stringify(arrItem); crcIndex.set(arrItem[pKey], jString); crcLookup.set(jString, arrItem); } }; /** * Checks for a primary key on the document and assigns one if none * currently exists. * @param {Object} obj The object to check a primary key against. * @private */ Collection.prototype.ensurePrimaryKey = function (obj) { if (obj[this._primaryKey] === undefined) { // Assign a primary key automatically obj[this._primaryKey] = this.objectId(); } }; /** * Clears all data from the collection. * @returns {Collection} */ Collection.prototype.truncate = function () { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } this.emit('truncate', this._data); // Clear all the data from the collection this._data.length = 0; // Re-create the primary index data this._primaryIndex = new KeyValueStore('primary'); this._primaryCrc = new KeyValueStore('primaryCrc'); this._crcLookup = new KeyValueStore('crcLookup'); this.deferEmit('change', {type: 'truncate'}); return this; }; /** * Modifies an existing document or documents in a collection. This will update * all matches for 'query' with the data held in 'update'. It will not overwrite * the matched documents with the update document. * * @param {Object} obj The document object to upsert or an array containing * documents to upsert. * * If the document contains a primary key field (based on the collections's primary * key) then the database will search for an existing document with a matching id. * If a matching document is found, the document will be updated. Any keys that * match keys on the existing document will be overwritten with new data. Any keys * that do not currently exist on the document will be added to the document. * * If the document does not contain an id or the id passed does not match an existing * document, an insert is performed instead. If no id is present a new primary key * id is provided for the item. * * @param {Function=} callback Optional callback method. * @returns {Object} An object containing two keys, "op" contains either "insert" or * "update" depending on the type of operation that was performed and "result" * contains the return data from the operation used. */ Collection.prototype.upsert = function (obj, callback) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } if (obj) { var queue = this._deferQueue.upsert, deferThreshold = this._deferThreshold.upsert; var returnData = {}, query, i; // Determine if the object passed is an array or not if (obj instanceof Array) { if (obj.length > deferThreshold) { // Break up upsert into blocks this._deferQueue.upsert = queue.concat(obj); // Fire off the insert queue handler this.processQueue('upsert', callback); return {}; } else { // Loop the array and upsert each item returnData = []; for (i = 0; i < obj.length; i++) { returnData.push(this.upsert(obj[i])); } if (callback) { callback(); } return returnData; } } // Determine if the operation is an insert or an update if (obj[this._primaryKey]) { // Check if an object with this primary key already exists query = {}; query[this._primaryKey] = obj[this._primaryKey]; if (this._primaryIndex.lookup(query)[0]) { // The document already exists with this id, this operation is an update returnData.op = 'update'; } else { // No document with this id exists, this operation is an insert returnData.op = 'insert'; } } else { // The document passed does not contain an id, this operation is an insert returnData.op = 'insert'; } switch (returnData.op) { case 'insert': returnData.result = this.insert(obj); break; case 'update': returnData.result = this.update(query, obj); break; default: break; } return returnData; } else { if (callback) { callback(); } } return {}; }; /** * Executes a method against each document that matches query and returns an * array of documents that may have been modified by the method. * @param {Object} query The query object. * @param {Function} func The method that each document is passed to. If this method * returns false for a particular document it is excluded from the results. * @param {Object=} options Optional options object. * @returns {Array} */ Collection.prototype.filter = function (query, func, options) { return (this.find(query, options)).filter(func); }; /** * Executes a method against each document that matches query and then executes * an update based on the return data of the method. * @param {Object} query The query object. * @param {Function} func The method that each document is passed to. If this method * returns false for a particular document it is excluded from the update. * @param {Object=} options Optional options object passed to the initial find call. * @returns {Array} */ Collection.prototype.filterUpdate = function (query, func, options) { var items = this.find(query, options), results = [], singleItem, singleQuery, singleUpdate, pk = this.primaryKey(), i; for (i = 0; i < items.length; i++) { singleItem = items[i]; singleUpdate = func(singleItem); if (singleUpdate) { singleQuery = {}; singleQuery[pk] = singleItem[pk]; results.push(this.update(singleQuery, singleUpdate)); } } return results; }; /** * Modifies an existing document or documents in a collection. This will update * all matches for 'query' with the data held in 'update'. It will not overwrite * the matched documents with the update document. * * @param {Object} query The query that must be matched for a document to be * operated on. * @param {Object} update The object containing updated key/values. Any keys that * match keys on the existing document will be overwritten with this data. Any * keys that do not currently exist on the document will be added to the document. * @param {Object=} options An options object. * @returns {Array} The items that were updated. */ Collection.prototype.update = function (query, update, options) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } // Decouple the update data update = this.decouple(update); // Handle transform update = this.transformIn(update); if (this.debug()) { console.log('Updating some collection data for collection "' + this.name() + '"'); } var self = this, op = this._metrics.create('update'), dataSet, updated, updateCall = function (originalDoc) { var newDoc = self.decouple(originalDoc), triggerOperation, result; if (self.willTrigger(self.TYPE_UPDATE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_UPDATE, self.PHASE_AFTER)) { triggerOperation = { type: 'update', query: self.decouple(query), update: self.decouple(update), options: self.decouple(options), op: op }; // Update newDoc with the update criteria so we know what the data will look // like AFTER the update is processed result = self.updateObject(newDoc, triggerOperation.update, triggerOperation.query, triggerOperation.options, ''); if (self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_BEFORE, originalDoc, newDoc) !== false) { // No triggers complained so let's execute the replacement of the existing // object with the new one result = self.updateObject(originalDoc, newDoc, triggerOperation.query, triggerOperation.options, ''); // NOTE: If for some reason we would only like to fire this event if changes are actually going // to occur on the object from the proposed update then we can add "result &&" to the if self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_AFTER, originalDoc, newDoc); } else { // Trigger cancelled operation so tell result that it was not updated result = false; } } else { // No triggers complained so let's execute the replacement of the existing // object with the new one result = self.updateObject(originalDoc, update, query, options, ''); } return result; }; op.start(); op.time('Retrieve documents to update'); dataSet = this.find(query, {$decouple: false}); op.time('Retrieve documents to update'); if (dataSet.length) { op.time('Update documents'); updated = dataSet.filter(updateCall); op.time('Update documents'); if (updated.length) { op.time('Resolve chains'); this.chainSend('update', { query: query, update: update, dataSet: dataSet }, options); op.time('Resolve chains'); this._onUpdate(updated); this.deferEmit('change', {type: 'update', data: updated}); } } op.stop(); // TODO: Should we decouple the updated array before return by default? return updated || []; }; /** * Replaces an existing object with data from the new object without * breaking data references. * @param {Object} currentObj The object to alter. * @param {Object} newObj The new object to overwrite the existing one with. * @returns {*} Chain. * @private */ Collection.prototype._replaceObj = function (currentObj, newObj) { var i; // Check if the new document has a different primary key value from the existing one // Remove item from indexes this._removeFromIndexes(currentObj); // Remove existing keys from current object for (i in currentObj) { if (currentObj.hasOwnProperty(i)) { delete currentObj[i]; } } // Add new keys to current object for (i in newObj) { if (newObj.hasOwnProperty(i)) { currentObj[i] = newObj[i]; } } // Update the item in the primary index if (!this._insertIntoIndexes(currentObj)) { throw('ForerunnerDB.Collection "' + this.name() + '": Primary key violation in update! Key violated: ' + currentObj[this._primaryKey]); } // Update the object in the collection data //this._data.splice(this._data.indexOf(currentObj), 1, newObj); return this; }; /** * Helper method to update a document from it's id. * @param {String} id The id of the document. * @param {Object} update The object containing the key/values to update to. * @returns {Array} The items that were updated. */ Collection.prototype.updateById = function (id, update) { var searchObj = {}; searchObj[this._primaryKey] = id; return this.update(searchObj, update); }; /** * Internal method for document updating. * @param {Object} doc The document to update. * @param {Object} update The object with key/value pairs to update the document with. * @param {Object} query The query object that we need to match to perform an update. * @param {Object} options An options object. * @param {String} path The current recursive path. * @param {String} opType The type of update operation to perform, if none is specified * default is to set new data against matching fields. * @returns {Boolean} True if the document was updated with new / changed data or * false if it was not updated because the data was the same. * @private */ Collection.prototype.updateObject = function (doc, update, query, options, path, opType) { // TODO: This method is long, try to break it into smaller pieces update = this.decouple(update); // Clear leading dots from path path = path || ''; if (path.substr(0, 1) === '.') { path = path.substr(1, path.length -1); } //var oldDoc = this.decouple(doc), var updated = false, recurseUpdated = false, operation, tmpArray, tmpIndex, tmpCount, tempIndex, pathInstance, sourceIsArray, updateIsArray, i; // Loop each key in the update object for (i in update) { if (update.hasOwnProperty(i)) { // Reset operation flag operation = false; // Check if the property starts with a dollar (function) if (i.substr(0, 1) === '$') { // Check for commands switch (i) { case '$key': case '$index': case '$data': // Ignore some operators operation = true; break; case '$each': operation = true; // Loop over the array of updates and run each one tmpCount = update.$each.length; for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) { recurseUpdated = this.updateObject(doc, update.$each[tmpIndex], query, options, path); if (recurseUpdated) { updated = true; } } updated = updated || recurseUpdated; break; default: operation = true; // Now run the operation recurseUpdated = this.updateObject(doc, update[i], query, options, path, i); updated = updated || recurseUpdated; break; } } // Check if the key has a .$ at the end, denoting an array lookup if (this._isPositionalKey(i)) { operation = true; // Modify i to be the name of the field i = i.substr(0, i.length - 2); pathInstance = new Path(path + '.' + i); // Check if the key is an array and has items if (doc[i] && doc[i] instanceof Array && doc[i].length) { tmpArray = []; // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { if (this._match(doc[i][tmpIndex], pathInstance.value(query)[0], '', {})) { tmpArray.push(tmpIndex); } } // Loop the items that matched and update them for (tmpIndex = 0; tmpIndex < tmpArray.length; tmpIndex++) { recurseUpdated = this.updateObject(doc[i][tmpArray[tmpIndex]], update[i + '.$'], query, options, path + '.' + i, opType); updated = updated || recurseUpdated; } } } if (!operation) { if (!opType && typeof(update[i]) === 'object') { if (doc[i] !== null && typeof(doc[i]) === 'object') { // Check if we are dealing with arrays sourceIsArray = doc[i] instanceof Array; updateIsArray = update[i] instanceof Array; if (sourceIsArray || updateIsArray) { // Check if the update is an object and the doc is an array if (!updateIsArray && sourceIsArray) { // Update is an object, source is an array so match the array items // with our query object to find the one to update inside this array // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { recurseUpdated = this.updateObject(doc[i][tmpIndex], update[i], query, options, path + '.' + i, opType); updated = updated || recurseUpdated; } } else { // Either both source and update are arrays or the update is // an array and the source is not, so set source to update if (doc[i] !== update[i]) { this._updateProperty(doc, i, update[i]); updated = true; } } } else { // The doc key is an object so traverse the // update further recurseUpdated = this.updateObject(doc[i], update[i], query, options, path + '.' + i, opType); updated = updated || recurseUpdated; } } else { if (doc[i] !== update[i]) { this._updateProperty(doc, i, update[i]); updated = true; } } } else { switch (opType) { case '$inc': this._updateIncrement(doc, i, update[i]); updated = true; break; case '$cast': // Casts a property to the type specified if it is not already // that type. If the cast is an array or an object and the property // is not already that type a new array or object is created and // set to the property, overwriting the previous value switch (update[i]) { case 'array': if (!(doc[i] instanceof Array)) { // Cast to an array this._updateProperty(doc, i, update.$data || []); updated = true; } break; case 'object': if (!(doc[i] instanceof Object) || (doc[i] instanceof Array)) { // Cast to an object this._updateProperty(doc, i, update.$data || {}); updated = true; } break; case 'number': if (typeof doc[i] !== 'number') { // Cast to a number this._updateProperty(doc, i, Number(doc[i])); updated = true; } break; case 'string': if (typeof doc[i] !== 'string') { // Cast to a string this._updateProperty(doc, i, String(doc[i])); updated = true; } break; default: throw('ForerunnerDB.Collection "' + this.name() + '": Cannot update cast to unknown type: ' + update[i]); } break; case '$push': // Check if the target key is undefined and if so, create an array if (doc[i] === undefined) { // Initialise a new array this._updateProperty(doc, i, []); } // Check that the target key is an array if (doc[i] instanceof Array) { // Check for a $position modifier with an $each if (update[i].$position !== undefined && update[i].$each instanceof Array) { // Grab the position to insert at tempIndex = update[i].$position; // Loop the each array and push each item tmpCount = update[i].$each.length; for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) { this._updateSplicePush(doc[i], tempIndex + tmpIndex, update[i].$each[tmpIndex]); } } else if (update[i].$each instanceof Array) { // Do a loop over the each to push multiple items tmpCount = update[i].$each.length; for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) { this._updatePush(doc[i], update[i].$each[tmpIndex]); } } else { // Do a standard push this._updatePush(doc[i], update[i]); } updated = true; } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot push to a key that is not an array! (' + i + ')'); } break; case '$pull': if (doc[i] instanceof Array) { tmpArray = []; // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { if (this._match(doc[i][tmpIndex], update[i], '', {})) { tmpArray.push(tmpIndex); } } tmpCount = tmpArray.length; // Now loop the pull array and remove items to be pulled while (tmpCount--) { this._updatePull(doc[i], tmpArray[tmpCount]); updated = true; } } break; case '$pullAll': if (doc[i] instanceof Array) { if (update[i] instanceof Array) { tmpArray = doc[i]; tmpCount = tmpArray.length; if (tmpCount > 0) { // Now loop the pull array and remove items to be pulled while (tmpCount--) { for (tempIndex = 0; tempIndex < update[i].length; tempIndex++) { if (tmpArray[tmpCount] === update[i][tempIndex]) { this._updatePull(doc[i], tmpCount); tmpCount--; updated = true; } } if (tmpCount < 0) { break; } } } } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot pullAll without being given an array of values to pull! (' + i + ')'); } } break; case '$addToSet': // Check if the target key is undefined and if so, create an array if (doc[i] === undefined) { // Initialise a new array this._updateProperty(doc, i, []); } // Check that the target key is an array if (doc[i] instanceof Array) { // Loop the target array and check for existence of item var targetArr = doc[i], targetArrIndex, targetArrCount = targetArr.length, objHash, addObj = true, optionObj = (options && options.$addToSet), hashMode, pathSolver; // Check if we have an options object for our operation if (update[i].$key) { hashMode = false; pathSolver = new Path(update[i].$key); objHash = pathSolver.value(update[i])[0]; // Remove the key from the object before we add it delete update[i].$key; } else if (optionObj && optionObj.key) { hashMode = false; pathSolver = new Path(optionObj.key); objHash = pathSolver.value(update[i])[0]; } else { objHash = JSON.stringify(update[i]); hashMode = true; } for (targetArrIndex = 0; targetArrIndex < targetArrCount; targetArrIndex++) { if (hashMode) { // Check if objects match via a string hash (JSON) if (JSON.stringify(targetArr[targetArrIndex]) === objHash) { // The object already exists, don't add it addObj = false; break; } } else { // Check if objects match based on the path if (objHash === pathSolver.value(targetArr[targetArrIndex])[0]) { // The object already exists, don't add it addObj = false; break; } } } if (addObj) { this._updatePush(doc[i], update[i]); updated = true; } } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot addToSet on a key that is not an array! (' + i + ')'); } break; case '$splicePush': // Check if the target key is undefined and if so, create an array if (doc[i] === undefined) { // Initialise a new array this._updateProperty(doc, i, []); } // Check that the target key is an array if (doc[i] instanceof Array) { tempIndex = update.$index; if (tempIndex !== undefined) { delete update.$index; // Check for out of bounds index if (tempIndex > doc[i].length) { tempIndex = doc[i].length; } this._updateSplicePush(doc[i], tempIndex, update[i]); updated = true; } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot splicePush without a $index integer value!'); } } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot splicePush with a key that is not an array! (' + i + ')'); } break; case '$move': if (doc[i] instanceof Array) { // Loop the array and find matches to our search for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) { if (this._match(doc[i][tmpIndex], update[i], '', {})) { var moveToIndex = update.$index; if (moveToIndex !== undefined) { delete update.$index; this._updateSpliceMove(doc[i], tmpIndex, moveToIndex); updated = true; } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot move without a $index integer value!'); } break; } } } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot move on a key that is not an array! (' + i + ')'); } break; case '$mul': this._updateMultiply(doc, i, update[i]); updated = true; break; case '$rename': this._updateRename(doc, i, update[i]); updated = true; break; case '$overwrite': this._updateOverwrite(doc, i, update[i]); updated = true; break; case '$unset': this._updateUnset(doc, i); updated = true; break; case '$clear': this._updateClear(doc, i); updated = true; break; case '$pop': if (doc[i] instanceof Array) { if (this._updatePop(doc[i], update[i])) { updated = true; } } else { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot pop from a key that is not an array! (' + i + ')'); } break; default: if (doc[i] !== update[i]) { this._updateProperty(doc, i, update[i]); updated = true; } break; } } } } } return updated; }; /** * Determines if the passed key has an array positional mark (a dollar at the end * of its name). * @param {String} key The key to check. * @returns {Boolean} True if it is a positional or false if not. * @private */ Collection.prototype._isPositionalKey = function (key) { return key.substr(key.length - 2, 2) === '.$'; }; /** * Removes any documents from the collection that match the search query * key/values. * @param {Object} query The query object. * @param {Object=} options An options object. * @param {Function=} callback A callback method. * @returns {Array} An array of the documents that were removed. */ Collection.prototype.remove = function (query, options, callback) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } var self = this, dataSet, index, arrIndex, returnArr, removeMethod, triggerOperation, doc, newDoc; if (query instanceof Array) { returnArr = []; for (arrIndex = 0; arrIndex < query.length; arrIndex++) { returnArr.push(this.remove(query[arrIndex], {noEmit: true})); } if (!options || (options && !options.noEmit)) { this._onRemove(returnArr); } if (callback) { callback(false, returnArr); } return returnArr; } else { dataSet = this.find(query, {$decouple: false}); if (dataSet.length) { removeMethod = function (dataItem) { // Remove the item from the collection's indexes self._removeFromIndexes(dataItem); // Remove data from internal stores index = self._data.indexOf(dataItem); self._dataRemoveAtIndex(index); }; // Remove the data from the collection for (var i = 0; i < dataSet.length; i++) { doc = dataSet[i]; if (self.willTrigger(self.TYPE_REMOVE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_REMOVE, self.PHASE_AFTER)) { triggerOperation = { type: 'remove' }; newDoc = self.decouple(doc); if (self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_BEFORE, newDoc, newDoc) !== false) { // The trigger didn't ask to cancel so execute the removal method removeMethod(doc); self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_AFTER, newDoc, newDoc); } } else { // No triggers to execute removeMethod(doc); } } //op.time('Resolve chains'); this.chainSend('remove', { query: query, dataSet: dataSet }, options); //op.time('Resolve chains'); if (!options || (options && !options.noEmit)) { this._onRemove(dataSet); } this.deferEmit('change', {type: 'remove', data: dataSet}); } if (callback) { callback(false, dataSet); } return dataSet; } }; /** * Helper method that removes a document that matches the given id. * @param {String} id The id of the document to remove. * @returns {Array} An array of documents that were removed. */ Collection.prototype.removeById = function (id) { var searchObj = {}; searchObj[this._primaryKey] = id; return this.remove(searchObj); }; /** * Queues an event to be fired. This has automatic de-bouncing so that any * events of the same type that occur within 100 milliseconds of a previous * one will all be wrapped into a single emit rather than emitting tons of * events for lots of chained inserts etc. * @private */ Collection.prototype.deferEmit = function () { var self = this, args; if (!this._noEmitDefer && (!this._db || (this._db && !this._db._noEmitDefer))) { args = arguments; // Check for an existing timeout if (this._changeTimeout) { clearTimeout(this._changeTimeout); } // Set a timeout this._changeTimeout = setTimeout(function () { if (self.debug()) { console.log('ForerunnerDB.Collection: Emitting ' + args[0]); } self.emit.apply(self, args); }, 1); } else { this.emit.apply(this, arguments); } }; /** * Processes a deferred action queue. * @param {String} type The queue name to process. * @param {Function} callback A method to call when the queue has processed. */ Collection.prototype.processQueue = function (type, callback) { var queue = this._deferQueue[type], deferThreshold = this._deferThreshold[type], deferTime = this._deferTime[type]; if (queue.length) { var self = this, dataArr; // Process items up to the threshold if (queue.length) { if (queue.length > deferThreshold) { // Grab items up to the threshold value dataArr = queue.splice(0, deferThreshold); } else { // Grab all the remaining items dataArr = queue.splice(0, queue.length); } this[type](dataArr); } // Queue another process setTimeout(function () { self.processQueue(type, callback); }, deferTime); } else { if (callback) { callback(); } } }; /** * Inserts a document or array of documents into the collection. * @param {Object|Array} data Either a document object or array of document * @param {Number=} index Optional index to insert the record at. * @param {Function=} callback Optional callback called once action is complete. * objects to insert into the collection. */ Collection.prototype.insert = function (data, index, callback) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } if (typeof(index) === 'function') { callback = index; index = this._data.length; } else if (index === undefined) { index = this._data.length; } data = this.transformIn(data); return this._insertHandle(data, index, callback); }; /** * Inserts a document or array of documents into the collection. * @param {Object|Array} data Either a document object or array of document * @param {Number=} index Optional index to insert the record at. * @param {Function=} callback Optional callback called once action is complete. * objects to insert into the collection. */ Collection.prototype._insertHandle = function (data, index, callback) { var //self = this, queue = this._deferQueue.insert, deferThreshold = this._deferThreshold.insert, //deferTime = this._deferTime.insert, inserted = [], failed = [], insertResult, i; if (data instanceof Array) { // Check if there are more insert items than the insert defer // threshold, if so, break up inserts so we don't tie up the // ui or thread if (data.length > deferThreshold) { // Break up insert into blocks this._deferQueue.insert = queue.concat(data); // Fire off the insert queue handler this.processQueue('insert', callback); return; } else { // Loop the array and add items for (i = 0; i < data.length; i++) { insertResult = this._insert(data[i], index + i); if (insertResult === true) { inserted.push(data[i]); } else { failed.push({ doc: data[i], reason: insertResult }); } } } } else { // Store the data item insertResult = this._insert(data, index); if (insertResult === true) { inserted.push(data); } else { failed.push({ doc: data, reason: insertResult }); } } //op.time('Resolve chains'); this.chainSend('insert', data, {index: index}); //op.time('Resolve chains'); this._onInsert(inserted, failed); if (callback) { callback(); } this.deferEmit('change', {type: 'insert', data: inserted}); return { inserted: inserted, failed: failed }; }; /** * Internal method to insert a document into the collection. Will * check for index violations before allowing the document to be inserted. * @param {Object} doc The document to insert after passing index violation * tests. * @param {Number=} index Optional index to insert the document at. * @returns {Boolean|Object} True on success, false if no document passed, * or an object containing details about an index violation if one occurred. * @private */ Collection.prototype._insert = function (doc, index) { if (doc) { var self = this, indexViolation, triggerOperation, insertMethod, newDoc; this.ensurePrimaryKey(doc); // Check indexes are not going to be broken by the document indexViolation = this.insertIndexViolation(doc); insertMethod = function (doc) { // Add the item to the collection's indexes self._insertIntoIndexes(doc); // Check index overflow if (index > self._data.length) { index = self._data.length; } // Insert the document self._dataInsertAtIndex(index, doc); }; if (!indexViolation) { if (self.willTrigger(self.TYPE_INSERT, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) { triggerOperation = { type: 'insert' }; if (self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_BEFORE, {}, doc) !== false) { insertMethod(doc); if (self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) { // Clone the doc so that the programmer cannot update the internal document // on the "after" phase trigger newDoc = self.decouple(doc); self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_AFTER, {}, newDoc); } } else { // The trigger just wants to cancel the operation return false; } } else { // No triggers to execute insertMethod(doc); } return true; } else { return 'Index violation in index: ' + indexViolation; } } return 'No document passed to insert'; }; /** * Inserts a document into the internal collection data array at * Inserts a document into the internal collection data array at * the specified index. * @param {number} index The index to insert at. * @param {object} doc The document to insert. * @private */ Collection.prototype._dataInsertAtIndex = function (index, doc) { this._data.splice(index, 0, doc); }; /** * Removes a document from the internal collection data array at * the specified index. * @param {number} index The index to remove from. * @private */ Collection.prototype._dataRemoveAtIndex = function (index) { this._data.splice(index, 1); }; /** * Replaces all data in the collection's internal data array with * the passed array of data. * @param {array} data The array of data to replace existing data with. * @private */ Collection.prototype._dataReplace = function (data) { // Clear the array - using a while loop with pop is by far the // fastest way to clear an array currently while (this._data.length) { this._data.pop(); } // Append new items to the array this._data = this._data.concat(data); }; /** * Inserts a document into the collection indexes. * @param {Object} doc The document to insert. * @private */ Collection.prototype._insertIntoIndexes = function (doc) { var arr = this._indexByName, arrIndex, violated, jString = JSON.stringify(doc); // Insert to primary key index violated = this._primaryIndex.uniqueSet(doc[this._primaryKey], doc); this._primaryCrc.uniqueSet(doc[this._primaryKey], jString); this._crcLookup.uniqueSet(jString, doc); // Insert into other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arr[arrIndex].insert(doc); } } return violated; }; /** * Removes a document from the collection indexes. * @param {Object} doc The document to remove. * @private */ Collection.prototype._removeFromIndexes = function (doc) { var arr = this._indexByName, arrIndex, jString = JSON.stringify(doc); // Remove from primary key index this._primaryIndex.unSet(doc[this._primaryKey]); this._primaryCrc.unSet(doc[this._primaryKey]); this._crcLookup.unSet(jString); // Remove from other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arr[arrIndex].remove(doc); } } }; /** * Rebuild collection indexes. * @private */ Collection.prototype._rebuildIndexes = function () { var arr = this._indexByName, arrIndex; // Remove from other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arr[arrIndex].rebuild(); } } }; /** * Returns the index of the document identified by the passed item's primary key. * @param {Object} item The item whose primary key should be used to lookup. * @returns {Number} The index the item with the matching primary key is occupying. */ Collection.prototype.indexOfDocById = function (item) { return this._data.indexOf( this._primaryIndex.get( item[this._primaryKey] ) ); }; /** * Uses the passed query to generate a new collection with results * matching the query parameters. * * @param {Object} query The query object to generate the subset with. * @param {Object=} options An options object. * @returns {*} */ Collection.prototype.subset = function (query, options) { var result = this.find(query, options); return new Collection() ._subsetOf(this) .primaryKey(this._primaryKey) .setData(result); }; /** * Gets the collection that this collection is a subset of. * @returns {Collection} */ Collection.prototype.subsetOf = function () { return this.__subsetOf; }; /** * Sets the collection that this collection is a subset of. * @param {Collection} collection The collection to set as the parent of this subset. * @returns {*} This object for chaining. * @private */ Collection.prototype._subsetOf = function (collection) { this.__subsetOf = collection; return this; }; /** * Find the distinct values for a specified field across a single collection and * returns the results in an array. * @param {String} key The field path to return distinct values for e.g. "person.name". * @param {Object=} query The query to use to filter the documents used to return values from. * @param {Object=} options The query options to use when running the query. * @returns {Array} */ Collection.prototype.distinct = function (key, query, options) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } var data = this.find(query, options), pathSolver = new Path(key), valueUsed = {}, distinctValues = [], value, i; // Loop the data and build array of distinct values for (i = 0; i < data.length; i++) { value = pathSolver.value(data[i])[0]; if (value && !valueUsed[value]) { valueUsed[value] = true; distinctValues.push(value); } } return distinctValues; }; /** * Helper method to find a document by it's id. * @param {String} id The id of the document. * @param {Object=} options The options object, allowed keys are sort and limit. * @returns {Array} The items that were updated. */ Collection.prototype.findById = function (id, options) { var searchObj = {}; searchObj[this._primaryKey] = id; return this.find(searchObj, options)[0]; }; /** * Finds all documents that contain the passed string or search object * regardless of where the string might occur within the document. This * will match strings from the start, middle or end of the document's * string (partial match). * @param search The string to search for. Case sensitive. * @param options A standard find() options object. * @returns {Array} An array of documents that matched the search string. */ Collection.prototype.peek = function (search, options) { // Loop all items var arr = this._data, arrCount = arr.length, arrIndex, arrItem, tempColl = new Collection(), typeOfSearch = typeof search; if (typeOfSearch === 'string') { for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { // Get json representation of object arrItem = JSON.stringify(arr[arrIndex]); // Check if string exists in object json if (arrItem.indexOf(search) > -1) { // Add this item to the temp collection tempColl.insert(arr[arrIndex]); } } return tempColl.find({}, options); } else { return this.find(search, options); } }; /** * Provides a query plan / operations log for a query. * @param {Object} query The query to execute. * @param {Object=} options Optional options object. * @returns {Object} The query plan. */ Collection.prototype.explain = function (query, options) { var result = this.find(query, options); return result.__fdbOp._data; }; /** * Generates an options object with default values or adds default * values to a passed object if those values are not currently set * to anything. * @param {object=} obj Optional options object to modify. * @returns {object} The options object. */ Collection.prototype.options = function (obj) { obj = obj || {}; obj.$decouple = obj.$decouple !== undefined ? obj.$decouple : true; obj.$explain = obj.$explain !== undefined ? obj.$explain : false; return obj; }; /** * Queries the collection based on the query object passed. * @param {Object} query The query key/values that a document must match in * order for it to be returned in the result array. * @param {Object=} options An optional options object. * * @returns {Array} The results array from the find operation, containing all * documents that matched the query. */ Collection.prototype.find = function (query, options) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } // TODO: This method is quite long, break into smaller pieces query = query || {}; options = this.options(options); var op = this._metrics.create('find'), pk = this.primaryKey(), self = this, analysis, //finalQuery, scanLength, requiresTableScan = true, resultArr, joinCollectionIndex, joinIndex, joinCollection = {}, joinQuery, joinPath, joinCollectionName, joinCollectionInstance, joinMatch, joinMatchIndex, joinSearch, joinMulti, joinRequire, joinFindResults, resultCollectionName, resultIndex, resultRemove = [], index, i, j, k, fieldListOn = [], fieldListOff = [], elemMatchPathSolver, elemMatchSubArr, elemMatchSpliceArr, matcherTmpOptions = {}, result, cursor = {}, matcher = function (doc) { return self._match(doc, query, 'and', matcherTmpOptions); }; op.start(); if (query) { // Get query analysis to execute best optimised code path op.time('analyseQuery'); analysis = this._analyseQuery(query, options, op); op.time('analyseQuery'); op.data('analysis', analysis); if (analysis.hasJoin && analysis.queriesJoin) { // The query has a join and tries to limit by it's joined data // Get an instance reference to the join collections op.time('joinReferences'); for (joinIndex = 0; joinIndex < analysis.joinsOn.length; joinIndex++) { joinCollectionName = analysis.joinsOn[joinIndex]; joinPath = new Path(analysis.joinQueries[joinCollectionName]); joinQuery = joinPath.value(query)[0]; joinCollection[analysis.joinsOn[joinIndex]] = this._db.collection(analysis.joinsOn[joinIndex]).subset(joinQuery); } op.time('joinReferences'); } // Check if an index lookup can be used to return this result if (analysis.indexMatch.length && (!options || (options && !options.$skipIndex))) { op.data('index.potential', analysis.indexMatch); op.data('index.used', analysis.indexMatch[0].index); // Get the data from the index op.time('indexLookup'); resultArr = analysis.indexMatch[0].lookup; op.time('indexLookup'); // Check if the index coverage is all keys, if not we still need to table scan it if (analysis.indexMatch[0].keyData.totalKeyCount === analysis.indexMatch[0].keyData.score) { // Require a table scan to find relevant documents requiresTableScan = false; } } else { op.flag('usedIndex', false); } if (requiresTableScan) { if (resultArr && resultArr.length) { scanLength = resultArr.length; op.time('tableScan: ' + scanLength); // Filter the source data and return the result resultArr = resultArr.filter(matcher); } else { // Filter the source data and return the result scanLength = this._data.length; op.time('tableScan: ' + scanLength); resultArr = this._data.filter(matcher); } // Order the array if we were passed a sort clause if (options.$orderBy) { op.time('sort'); resultArr = this.sort(options.$orderBy, resultArr); op.time('sort'); } op.time('tableScan: ' + scanLength); } if (options.$page !== undefined && options.$limit !== undefined) { // Record paging data cursor.page = options.$page; cursor.pages = Math.ceil(resultArr.length / options.$limit); cursor.records = resultArr.length; // Check if we actually need to apply the paging logic if (options.$page && options.$limit > 0) { op.data('cursor', cursor); // Skip to the page specified based on limit resultArr.splice(0, options.$page * options.$limit); } } if (options.$skip) { cursor.skip = options.$skip; // Skip past the number of records specified resultArr.splice(0, options.$skip); op.data('skip', options.$skip); } if (options.$limit && resultArr && resultArr.length > options.$limit) { cursor.limit = options.$limit; resultArr.length = options.$limit; op.data('limit', options.$limit); } if (options.$decouple) { // Now decouple the data from the original objects op.time('decouple'); resultArr = this.decouple(resultArr); op.time('decouple'); op.data('flag.decouple', true); } // Now process any joins on the final data if (options.$join) { for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) { for (joinCollectionName in options.$join[joinCollectionIndex]) { if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) { // Set the key to store the join result in to the collection name by default resultCollectionName = joinCollectionName; // Get the join collection instance from the DB joinCollectionInstance = this._db.collection(joinCollectionName); // Get the match data for the join joinMatch = options.$join[joinCollectionIndex][joinCollectionName]; // Loop our result data array for (resultIndex = 0; resultIndex < resultArr.length; resultIndex++) { // Loop the join conditions and build a search object from them joinSearch = {}; joinMulti = false; joinRequire = false; for (joinMatchIndex in joinMatch) { if (joinMatch.hasOwnProperty(joinMatchIndex)) { // Check the join condition name for a special command operator if (joinMatchIndex.substr(0, 1) === '$') { // Special command switch (joinMatchIndex) { case '$as': // Rename the collection when stored in the result document resultCollectionName = joinMatch[joinMatchIndex]; break; case '$multi': // Return an array of documents instead of a single matching document joinMulti = joinMatch[joinMatchIndex]; break; case '$require': // Remove the result item if no matching join data is found joinRequire = joinMatch[joinMatchIndex]; break; /*default: // Check for a double-dollar which is a back-reference to the root collection item if (joinMatchIndex.substr(0, 3) === '$$.') { // Back reference // TODO: Support complex joins } break;*/ } } else { // TODO: Could optimise this by caching path objects // Get the data to match against and store in the search object joinSearch[joinMatchIndex] = new Path(joinMatch[joinMatchIndex]).value(resultArr[resultIndex])[0]; } } } // Do a find on the target collection against the match data joinFindResults = joinCollectionInstance.find(joinSearch); // Check if we require a joined row to allow the result item if (!joinRequire || (joinRequire && joinFindResults[0])) { // Join is not required or condition is met resultArr[resultIndex][resultCollectionName] = joinMulti === false ? joinFindResults[0] : joinFindResults; } else { // Join required but condition not met, add item to removal queue resultRemove.push(resultArr[resultIndex]); } } } } } op.data('flag.join', true); } // Process removal queue if (resultRemove.length) { op.time('removalQueue'); for (i = 0; i < resultRemove.length; i++) { index = resultArr.indexOf(resultRemove[i]); if (index > -1) { resultArr.splice(index, 1); } } op.time('removalQueue'); } if (options.$transform) { op.time('transform'); for (i = 0; i < resultArr.length; i++) { resultArr.splice(i, 1, options.$transform(resultArr[i])); } op.time('transform'); op.data('flag.transform', true); } // Process transforms if (this._transformEnabled && this._transformOut) { op.time('transformOut'); resultArr = this.transformOut(resultArr); op.time('transformOut'); } op.data('results', resultArr.length); } else { resultArr = []; } // Generate a list of fields to limit data by // Each property starts off being enabled by default (= 1) then // if any property is explicitly specified as 1 then all switch to // zero except _id. // // Any that are explicitly set to zero are switched off. op.time('scanFields'); for (i in options) { if (options.hasOwnProperty(i) && i.indexOf('$') !== 0) { if (options[i] === 1) { fieldListOn.push(i); } else if (options[i] === 0) { fieldListOff.push(i); } } } op.time('scanFields'); // Limit returned fields by the options data if (fieldListOn.length || fieldListOff.length) { op.data('flag.limitFields', true); op.data('limitFields.on', fieldListOn); op.data('limitFields.off', fieldListOff); op.time('limitFields'); // We have explicit fields switched on or off for (i = 0; i < resultArr.length; i++) { result = resultArr[i]; for (j in result) { if (result.hasOwnProperty(j)) { if (fieldListOn.length) { // We have explicit fields switched on so remove all fields // that are not explicitly switched on // Check if the field name is not the primary key if (j !== pk) { if (fieldListOn.indexOf(j) === -1) { // This field is not in the on list, remove it delete result[j]; } } } if (fieldListOff.length) { // We have explicit fields switched off so remove fields // that are explicitly switched off if (fieldListOff.indexOf(j) > -1) { // This field is in the off list, remove it delete result[j]; } } } } } op.time('limitFields'); } // Now run any projections on the data required if (options.$elemMatch) { op.data('flag.elemMatch', true); op.time('projection-elemMatch'); for (i in options.$elemMatch) { if (options.$elemMatch.hasOwnProperty(i)) { elemMatchPathSolver = new Path(i); // Loop the results array for (j = 0; j < resultArr.length; j++) { elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0]; // Check we have a sub-array to loop if (elemMatchSubArr && elemMatchSubArr.length) { // Loop the sub-array and check for projection query matches for (k = 0; k < elemMatchSubArr.length; k++) { // Check if the current item in the sub-array matches the projection query if (self._match(elemMatchSubArr[k], options.$elemMatch[i], '', {})) { // The item matches the projection query so set the sub-array // to an array that ONLY contains the matching item and then // exit the loop since we only want to match the first item elemMatchPathSolver.set(resultArr[j], i, [elemMatchSubArr[k]]); break; } } } } } } op.time('projection-elemMatch'); } if (options.$elemsMatch) { op.data('flag.elemsMatch', true); op.time('projection-elemsMatch'); for (i in options.$elemsMatch) { if (options.$elemsMatch.hasOwnProperty(i)) { elemMatchPathSolver = new Path(i); // Loop the results array for (j = 0; j < resultArr.length; j++) { elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0]; // Check we have a sub-array to loop if (elemMatchSubArr && elemMatchSubArr.length) { elemMatchSpliceArr = []; // Loop the sub-array and check for projection query matches for (k = 0; k < elemMatchSubArr.length; k++) { // Check if the current item in the sub-array matches the projection query if (self._match(elemMatchSubArr[k], options.$elemsMatch[i], '', {})) { // The item matches the projection query so add it to the final array elemMatchSpliceArr.push(elemMatchSubArr[k]); } } // Now set the final sub-array to the matched items elemMatchPathSolver.set(resultArr[j], i, elemMatchSpliceArr); } } } } op.time('projection-elemsMatch'); } op.stop(); resultArr.__fdbOp = op; resultArr.$cursor = cursor; return resultArr; }; /** * Returns one document that satisfies the specified query criteria. If multiple * documents satisfy the query, this method returns the first document to match * the query. * @returns {*} */ Collection.prototype.findOne = function () { return (this.find.apply(this, arguments))[0]; }; /** * Gets the index in the collection data array of the first item matched by * the passed query object. * @param {Object} query The query to run to find the item to return the index of. * @returns {Number} */ Collection.prototype.indexOf = function (query) { var item = this.find(query, {$decouple: false})[0]; if (item) { return this._data.indexOf(item); } }; /** * Gets / sets the collection transform options. * @param {Object} obj A collection transform options object. * @returns {*} */ Collection.prototype.transform = function (obj) { if (obj !== undefined) { if (typeof obj === "object") { if (obj.enabled !== undefined) { this._transformEnabled = obj.enabled; } if (obj.dataIn !== undefined) { this._transformIn = obj.dataIn; } if (obj.dataOut !== undefined) { this._transformOut = obj.dataOut; } } else { this._transformEnabled = obj !== false; } return this; } return { enabled: this._transformEnabled, dataIn: this._transformIn, dataOut: this._transformOut }; }; /** * Transforms data using the set transformIn method. * @param {Object} data The data to transform. * @returns {*} */ Collection.prototype.transformIn = function (data) { if (this._transformEnabled && this._transformIn) { if (data instanceof Array) { var finalArr = [], i; for (i = 0; i < data.length; i++) { finalArr[i] = this._transformIn(data[i]); } return finalArr; } else { return this._transformIn(data); } } return data; }; /** * Transforms data using the set transformOut method. * @param {Object} data The data to transform. * @returns {*} */ Collection.prototype.transformOut = function (data) { if (this._transformEnabled && this._transformOut) { if (data instanceof Array) { var finalArr = [], i; for (i = 0; i < data.length; i++) { finalArr[i] = this._transformOut(data[i]); } return finalArr; } else { return this._transformOut(data); } } return data; }; /** * Sorts an array of documents by the given sort path. * @param {*} sortObj The keys and orders the array objects should be sorted by. * @param {Array} arr The array of documents to sort. * @returns {Array} */ Collection.prototype.sort = function (sortObj, arr) { // Make sure we have an array object arr = arr || []; var sortArr = [], sortKey, sortSingleObj; for (sortKey in sortObj) { if (sortObj.hasOwnProperty(sortKey)) { sortSingleObj = {}; sortSingleObj[sortKey] = sortObj[sortKey]; sortSingleObj.___fdbKey = sortKey; sortArr.push(sortSingleObj); } } if (sortArr.length < 2) { // There is only one sort criteria, do a simple sort and return it return this._sort(sortObj, arr); } else { return this._bucketSort(sortArr, arr); } }; /** * Takes array of sort paths and sorts them into buckets before returning final * array fully sorted by multi-keys. * @param keyArr * @param arr * @returns {*} * @private */ Collection.prototype._bucketSort = function (keyArr, arr) { var keyObj = keyArr.shift(), arrCopy, buckets, i, finalArr = []; if (keyArr.length > 0) { // Sort array by bucket key arr = this._sort(keyObj, arr); // Split items into buckets buckets = this.bucket(keyObj.___fdbKey, arr); // Loop buckets and sort contents for (i in buckets) { if (buckets.hasOwnProperty(i)) { arrCopy = [].concat(keyArr); finalArr = finalArr.concat(this._bucketSort(arrCopy, buckets[i])); } } return finalArr; } else { return this._sort(keyObj, arr); } }; /** * Sorts array by individual sort path. * @param key * @param arr * @returns {Array|*} * @private */ Collection.prototype._sort = function (key, arr) { var self = this, sorterMethod, pathSolver = new Path(), dataPath = pathSolver.parse(key, true)[0]; pathSolver.path(dataPath.path); if (dataPath.value === 1) { // Sort ascending sorterMethod = function (a, b) { var valA = pathSolver.value(a)[0], valB = pathSolver.value(b)[0]; return self.sortAsc(valA, valB); }; } else if (dataPath.value === -1) { // Sort descending sorterMethod = function (a, b) { var valA = pathSolver.value(a)[0], valB = pathSolver.value(b)[0]; return self.sortDesc(valA, valB); }; } else { throw('ForerunnerDB.Collection "' + this.name() + '": $orderBy clause has invalid direction: ' + dataPath.value + ', accepted values are 1 or -1 for ascending or descending!'); } return arr.sort(sorterMethod); }; /** * Takes an array of objects and returns a new object with the array items * split into buckets by the passed key. * @param {String} key The key to split the array into buckets by. * @param {Array} arr An array of objects. * @returns {Object} */ Collection.prototype.bucket = function (key, arr) { var i, buckets = {}; for (i = 0; i < arr.length; i++) { buckets[arr[i][key]] = buckets[arr[i][key]] || []; buckets[arr[i][key]].push(arr[i]); } return buckets; }; /** * Internal method that takes a search query and options and returns an object * containing details about the query which can be used to optimise the search. * * @param query * @param options * @param op * @returns {Object} * @private */ Collection.prototype._analyseQuery = function (query, options, op) { var analysis = { queriesOn: [this._name], indexMatch: [], hasJoin: false, queriesJoin: false, joinQueries: {}, query: query, options: options }, joinCollectionIndex, joinCollectionName, joinCollections = [], joinCollectionReferences = [], queryPath, index, indexMatchData, indexRef, indexRefName, indexLookup, pathSolver, queryKeyCount, i; // Check if the query is a primary key lookup op.time('checkIndexes'); pathSolver = new Path(); queryKeyCount = pathSolver.countKeys(query); if (queryKeyCount) { if (query[this._primaryKey] !== undefined) { // Return item via primary key possible op.time('checkIndexMatch: Primary Key'); analysis.indexMatch.push({ lookup: this._primaryIndex.lookup(query, options), keyData: { matchedKeys: [this._primaryKey], totalKeyCount: queryKeyCount, score: 1 }, index: this._primaryIndex }); op.time('checkIndexMatch: Primary Key'); } // Check if an index can speed up the query for (i in this._indexById) { if (this._indexById.hasOwnProperty(i)) { indexRef = this._indexById[i]; indexRefName = indexRef.name(); op.time('checkIndexMatch: ' + indexRefName); indexMatchData = indexRef.match(query, options); if (indexMatchData.score > 0) { // This index can be used, store it indexLookup = indexRef.lookup(query, options); analysis.indexMatch.push({ lookup: indexLookup, keyData: indexMatchData, index: indexRef }); } op.time('checkIndexMatch: ' + indexRefName); if (indexMatchData.score === queryKeyCount) { // Found an optimal index, do not check for any more break; } } } op.time('checkIndexes'); // Sort array descending on index key count (effectively a measure of relevance to the query) if (analysis.indexMatch.length > 1) { op.time('findOptimalIndex'); analysis.indexMatch.sort(function (a, b) { if (a.keyData.score > b.keyData.score) { // This index has a higher score than the other return -1; } if (a.keyData.score < b.keyData.score) { // This index has a lower score than the other return 1; } // The indexes have the same score but can still be compared by the number of records // they return from the query. The fewer records they return the better so order by // record count if (a.keyData.score === b.keyData.score) { return a.lookup.length - b.lookup.length; } }); op.time('findOptimalIndex'); } } // Check for join data if (options.$join) { analysis.hasJoin = true; // Loop all join operations for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) { // Loop the join collections and keep a reference to them for (joinCollectionName in options.$join[joinCollectionIndex]) { if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) { joinCollections.push(joinCollectionName); // Check if the join uses an $as operator if ('$as' in options.$join[joinCollectionIndex][joinCollectionName]) { joinCollectionReferences.push(options.$join[joinCollectionIndex][joinCollectionName].$as); } else { joinCollectionReferences.push(joinCollectionName); } } } } // Loop the join collection references and determine if the query references // any of the collections that are used in the join. If there no queries against // joined collections the find method can use a code path optimised for this. // Queries against joined collections requires the joined collections to be filtered // first and then joined so requires a little more work. for (index = 0; index < joinCollectionReferences.length; index++) { // Check if the query references any collection data that the join will create queryPath = this._queryReferencesCollection(query, joinCollectionReferences[index], ''); if (queryPath) { analysis.joinQueries[joinCollections[index]] = queryPath; analysis.queriesJoin = true; } } analysis.joinsOn = joinCollections; analysis.queriesOn = analysis.queriesOn.concat(joinCollections); } return analysis; }; /** * Checks if the passed query references this collection. * @param query * @param collection * @param path * @returns {*} * @private */ Collection.prototype._queryReferencesCollection = function (query, collection, path) { var i; for (i in query) { if (query.hasOwnProperty(i)) { // Check if this key is a reference match if (i === collection) { if (path) { path += '.'; } return path + i; } else { if (typeof(query[i]) === 'object') { // Recurse if (path) { path += '.'; } path += i; return this._queryReferencesCollection(query[i], collection, path); } } } } return false; }; /** * Returns the number of documents currently in the collection. * @returns {Number} */ Collection.prototype.count = function (query, options) { if (!query) { return this._data.length; } else { // Run query and return count return this.find(query, options).length; } }; /** * Finds sub-documents from the collection's documents. * @param match * @param path * @param subDocQuery * @param subDocOptions * @returns {*} */ Collection.prototype.findSub = function (match, path, subDocQuery, subDocOptions) { var pathHandler = new Path(path), docArr = this.find(match), docCount = docArr.length, docIndex, subDocArr, subDocCollection = this._db.collection('__FDB_temp_' + this.objectId()), subDocResults, resultObj = { parents: docCount, subDocTotal: 0, subDocs: [], pathFound: false, err: '' }; for (docIndex = 0; docIndex < docCount; docIndex++) { subDocArr = pathHandler.value(docArr[docIndex])[0]; if (subDocArr) { subDocCollection.setData(subDocArr); subDocResults = subDocCollection.find(subDocQuery, subDocOptions); if (subDocOptions.returnFirst && subDocResults.length) { return subDocResults[0]; } resultObj.subDocs.push(subDocResults); resultObj.subDocTotal += subDocResults.length; resultObj.pathFound = true; } } // Drop the sub-document collection subDocCollection.drop(); // Check if the call should not return stats, if so return only subDocs array if (subDocOptions.noStats) { return resultObj.subDocs; } if (!resultObj.pathFound) { resultObj.err = 'No objects found in the parent documents with a matching path of: ' + path; } return resultObj; }; /** * Checks that the passed document will not violate any index rules if * inserted into the collection. * @param {Object} doc The document to check indexes against. * @returns {Boolean} Either false (no violation occurred) or true if * a violation was detected. */ Collection.prototype.insertIndexViolation = function (doc) { var indexViolated, arr = this._indexByName, arrIndex, arrItem; // Check the item's primary key is not already in use if (this._primaryIndex.get(doc[this._primaryKey])) { indexViolated = this._primaryIndex; } else { // Check violations of other indexes for (arrIndex in arr) { if (arr.hasOwnProperty(arrIndex)) { arrItem = arr[arrIndex]; if (arrItem.unique()) { if (arrItem.violation(doc)) { indexViolated = arrItem; break; } } } } } return indexViolated ? indexViolated.name() : false; }; /** * Creates an index on the specified keys. * @param {Object} keys The object containing keys to index. * @param {Object} options An options object. * @returns {*} */ Collection.prototype.ensureIndex = function (keys, options) { if (this._state === 'dropped') { throw('ForerunnerDB.Collection "' + this.name() + '": Cannot operate in a dropped state!'); } this._indexByName = this._indexByName || {}; this._indexById = this._indexById || {}; var index, time = { start: new Date().getTime() }; if (options) { switch (options.type) { case 'hashed': index = new IndexHashMap(keys, options, this); break; case 'btree': index = new IndexBinaryTree(keys, options, this); break; default: // Default index = new IndexHashMap(keys, options, this); break; } } else { // Default index = new IndexHashMap(keys, options, this); } // Check the index does not already exist if (this._indexByName[index.name()]) { // Index already exists return { err: 'Index with that name already exists' }; } if (this._indexById[index.id()]) { // Index already exists return { err: 'Index with those keys already exists' }; } // Create the index index.rebuild(); // Add the index this._indexByName[index.name()] = index; this._indexById[index.id()] = index; time.end = new Date().getTime(); time.total = time.end - time.start; this._lastOp = { type: 'ensureIndex', stats: { time: time } }; return { index: index, id: index.id(), name: index.name(), state: index.state() }; }; /** * Gets an index by it's name. * @param {String} name The name of the index to retreive. * @returns {*} */ Collection.prototype.index = function (name) { if (this._indexByName) { return this._indexByName[name]; } }; /** * Gets the last reporting operation's details such as run time. * @returns {Object} */ Collection.prototype.lastOp = function () { return this._metrics.list(); }; /** * Generates a difference object that contains insert, update and remove arrays * representing the operations to execute to make this collection have the same * data as the one passed. * @param {Collection} collection The collection to diff against. * @returns {{}} */ Collection.prototype.diff = function (collection) { var diff = { insert: [], update: [], remove: [] }; var pm = this.primaryKey(), arr, arrIndex, arrItem, arrCount; // Check if the primary key index of each collection can be utilised if (pm !== collection.primaryKey()) { throw('ForerunnerDB.Collection "' + this.name() + '": Collection diffing requires that both collections have the same primary key!'); } // Use the collection primary key index to do the diff (super-fast) arr = collection._data; // Check if we have an array or another collection while (arr && !(arr instanceof Array)) { // We don't have an array, assign collection and get data collection = arr; arr = collection._data; } arrCount = arr.length; // Loop the collection's data array and check for matching items for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arrItem = arr[arrIndex]; // Check for a matching item in this collection if (this._primaryIndex.get(arrItem[pm])) { // Matching item exists, check if the data is the same if (this._primaryCrc.get(arrItem[pm]) !== collection._primaryCrc.get(arrItem[pm])) { // The documents exist in both collections but data differs, update required diff.update.push(arrItem); } } else { // The document is missing from this collection, insert required diff.insert.push(arrItem); } } // Now loop this collection's data and check for matching items arr = this._data; arrCount = arr.length; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arrItem = arr[arrIndex]; if (!collection._primaryIndex.get(arrItem[pm])) { // The document does not exist in the other collection, remove required diff.remove.push(arrItem); } } return diff; }; Collection.prototype.collateAdd = new Overload({ /** * Adds a data source to collate data from and specifies the * key name to collate data to. * @func collateAdd * @memberof Collection * @param {Collection} collection The collection to collate data from. * @param {String=} keyName Optional name of the key to collate data to. * If none is provided the record CRUD is operated on the root collection * data. */ 'object, string': function (collection, keyName) { var self = this; self.collateAdd(collection, function (packet) { var obj1, obj2; switch (packet.type) { case 'insert': if (keyName) { obj1 = { $push: {} }; obj1.$push[keyName] = self.decouple(packet.data); self.update({}, obj1); } else { self.insert(packet.data); } break; case 'update': if (keyName) { obj1 = {}; obj2 = {}; obj1[keyName] = packet.data.query; obj2[keyName + '.$'] = packet.data.update; self.update(obj1, obj2); } else { self.update(packet.data.query, packet.data.update); } break; case 'remove': if (keyName) { obj1 = { $pull: {} }; obj1.$pull[keyName] = {}; obj1.$pull[keyName][self.primaryKey()] = packet.data.dataSet[0][collection.primaryKey()]; self.update({}, obj1); } else { self.remove(packet.data); } break; default: } }); }, /** * Adds a data source to collate data from and specifies a process * method that will handle the collation functionality (for custom * collation). * @func collateAdd * @memberof Collection * @param {Collection} collection The collection to collate data from. * @param {Function} process The process method. */ 'object, function': function (collection, process) { if (typeof collection === 'string') { // The collection passed is a name, not a reference so get // the reference from the name collection = this._db.collection(collection, { autoCreate: false, throwError: false }); } if (collection) { this._collate = this._collate || {}; this._collate[collection.name()] = new ReactorIO(collection, this, process); return this; } else { throw('Cannot collate from a non-existent collection!'); } } }); Collection.prototype.collateRemove = function (collection) { if (typeof collection === 'object') { // We need to have the name of the collection to remove it collection = collection.name(); } if (collection) { // Drop the reactor IO chain node this._collate[collection].drop(); // Remove the collection data from the collate object delete this._collate[collection]; return this; } else { throw('No collection name passed to collateRemove() or collection not found!'); } }; Db.prototype.collection = new Overload({ /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {Object} options An options object. * @returns {Collection} */ 'object': function (options) { return this.$main.call(this, options); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @returns {Collection} */ 'string': function (collectionName) { return this.$main.call(this, { name: collectionName }); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @param {String} primaryKey Optional primary key to specify the primary key field on the collection * objects. Defaults to "_id". * @returns {Collection} */ 'string, string': function (collectionName, primaryKey) { return this.$main.call(this, { name: collectionName, primaryKey: primaryKey }); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @param {Object} options An options object. * @returns {Collection} */ 'string, object': function (collectionName, options) { options.name = collectionName; return this.$main.call(this, options); }, /** * Get a collection by name. If the collection does not already exist * then one is created for that name automatically. * @func collection * @memberof Db * @param {String} collectionName The name of the collection. * @param {String} primaryKey Optional primary key to specify the primary key field on the collection * objects. Defaults to "_id". * @param {Object} options An options object. * @returns {Collection} */ 'string, string, object': function (collectionName, primaryKey, options) { options.name = collectionName; options.primaryKey = primaryKey; return this.$main.call(this, options); }, /** * The main handler method. This gets called by all the other variants and * handles the actual logic of the overloaded method. * @func collection * @memberof Db * @param {Object} options An options object. * @returns {*} */ '$main': function (options) { var name = options.name; if (name) { if (!this._collection[name]) { if (options && options.autoCreate === false) { if (options && options.throwError !== false) { throw('ForerunnerDB.Db "' + this.name() + '": Cannot get collection ' + name + ' because it does not exist and auto-create has been disabled!'); } } if (this.debug()) { console.log('Creating collection ' + name); } } this._collection[name] = this._collection[name] || new Collection(name).db(this); if (options.primaryKey !== undefined) { this._collection[name].primaryKey(options.primaryKey); } return this._collection[name]; } else { if (!options || (options && options.throwError !== false)) { throw('ForerunnerDB.Db "' + this.name() + '": Cannot get collection with undefined name!'); } } } }); /** * Determine if a collection with the passed name already exists. * @memberof Db * @param {String} viewName The name of the collection to check for. * @returns {boolean} */ Db.prototype.collectionExists = function (viewName) { return Boolean(this._collection[viewName]); }; /** * Returns an array of collections the DB currently has. * @memberof Db * @param {String|RegExp=} search The optional search string or regular expression to use * to match collection names against. * @returns {Array} An array of objects containing details of each collection * the database is currently managing. */ Db.prototype.collections = function (search) { var arr = [], i; if (search) { if (!(search instanceof RegExp)) { // Turn the search into a regular expression search = new RegExp(search); } } for (i in this._collection) { if (this._collection.hasOwnProperty(i)) { if (search) { if (search.exec(i)) { arr.push({ name: i, count: this._collection[i].count() }); } } else { arr.push({ name: i, count: this._collection[i].count() }); } } } arr.sort(function (a, b) { return a.name.localeCompare(b.name); }); return arr; }; Shared.finishModule('Collection'); module.exports = Collection; },{"./Crc":4,"./IndexBinaryTree":6,"./IndexHashMap":7,"./KeyValueStore":8,"./Metrics":9,"./Overload":20,"./Path":21,"./ReactorIO":22,"./Shared":23}],3:[function(_dereq_,module,exports){ /* License Copyright (c) 2015 Irrelon Software Limited http://www.irrelon.com http://www.forerunnerdb.com Please visit the license page to see latest license information: http://www.forerunnerdb.com/licensing.html */ "use strict"; var Shared, Db, Metrics, Overload; Shared = _dereq_('./Shared'); Overload = _dereq_('./Overload'); /** * Creates a new ForerunnerDB instance. Core instances handle the lifecycle of * multiple database instances. * @constructor */ var Core = function (name) { this.init.apply(this, arguments); }; Core.prototype.init = function () { this._db = {}; this._debug = {}; }; Core.prototype.moduleLoaded = new Overload({ /** * Checks if a module has been loaded into the database. * @func moduleLoaded * @memberof Core * @param {String} moduleName The name of the module to check for. * @returns {Boolean} True if the module is loaded, false if not. */ 'string': function (moduleName) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } return true; } return false; }, /** * Checks if a module is loaded and if so calls the passed * callback method. * @func moduleLoaded * @memberof Core * @param {String} moduleName The name of the module to check for. * @param {Function} callback The callback method to call if module is loaded. */ 'string, function': function (moduleName, callback) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } callback(); } }, /** * Checks if a module is loaded and if so calls the passed * success method, otherwise calls the failure method. * @func moduleLoaded * @memberof Core * @param {String} moduleName The name of the module to check for. * @param {Function} success The callback method to call if module is loaded. * @param {Function} failure The callback method to call if module not loaded. */ 'string, function, function': function (moduleName, success, failure) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { failure(); return false; } } success(); } } }); /** * Checks version against the string passed and if it matches (or partially matches) * then the callback is called. * @param {String} val The version to check against. * @param {Function} callback The callback to call if match is true. * @returns {Boolean} */ Core.prototype.version = function (val, callback) { if (val !== undefined) { if (Shared.version.indexOf(val) === 0) { if (callback) { callback(); } return true; } return false; } return Shared.version; }; // Expose moduleLoaded method to non-instantiated object ForerunnerDB Core.moduleLoaded = Core.prototype.moduleLoaded; // Expose version method to non-instantiated object ForerunnerDB Core.version = Core.prototype.version; // Provide public access to the Shared object Core.shared = Shared; Core.prototype.shared = Shared; Shared.addModule('Core', Core); Shared.mixin(Core.prototype, 'Mixin.Common'); Shared.mixin(Core.prototype, 'Mixin.Constants'); Db = _dereq_('./Db.js'); Metrics = _dereq_('./Metrics.js'); Core.prototype._isServer = false; /** * Returns true if ForerunnerDB is running on a client browser. * @returns {boolean} */ Core.prototype.isClient = function () { return !this._isServer; }; /** * Returns true if ForerunnerDB is running on a server. * @returns {boolean} */ Core.prototype.isServer = function () { return this._isServer; }; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a browser. */ Core.prototype.isClient = function () { return !this._isServer; }; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a server. */ Core.prototype.isServer = function () { return this._isServer; }; /** * Added to provide an error message for users who have not seen * the new instantiation breaking change warning and try to get * a collection directly from the core instance. */ Core.prototype.collection = function () { throw("ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"); }; module.exports = Core; },{"./Db.js":5,"./Metrics.js":9,"./Overload":20,"./Shared":23}],4:[function(_dereq_,module,exports){ "use strict"; /** * @mixin */ var crcTable = (function () { var crcTable = [], c, n, k; for (n = 0; n < 256; n++) { c = n; for (k = 0; k < 8; k++) { c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); // jshint ignore:line } crcTable[n] = c; } return crcTable; }()); module.exports = function(str) { var crc = 0 ^ (-1), // jshint ignore:line i; for (i = 0; i < str.length; i++) { crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF]; // jshint ignore:line } return (crc ^ (-1)) >>> 0; // jshint ignore:line }; },{}],5:[function(_dereq_,module,exports){ "use strict"; var Shared, Core, Collection, Metrics, Crc, Overload; Shared = _dereq_('./Shared'); Overload = _dereq_('./Overload'); /** * Creates a new ForerunnerDB database instance. * @constructor */ var Db = function (name) { this.init.apply(this, arguments); }; Db.prototype.init = function (name) { this._primaryKey = '_id'; this._name = name; this._collection = {}; this._debug = {}; }; Db.prototype.moduleLoaded = new Overload({ /** * Checks if a module has been loaded into the database. * @func moduleLoaded * @memberof Db * @param {String} moduleName The name of the module to check for. * @returns {Boolean} True if the module is loaded, false if not. */ 'string': function (moduleName) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } return true; } return false; }, /** * Checks if a module is loaded and if so calls the passed * callback method. * @func moduleLoaded * @memberof Db * @param {String} moduleName The name of the module to check for. * @param {Function} callback The callback method to call if module is loaded. */ 'string, function': function (moduleName, callback) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { return false; } } callback(); } }, /** * Checks if a module is loaded and if so calls the passed * success method, otherwise calls the failure method. * @func moduleLoaded * @memberof Db * @param {String} moduleName The name of the module to check for. * @param {Function} success The callback method to call if module is loaded. * @param {Function} failure The callback method to call if module not loaded. */ 'string, function, function': function (moduleName, success, failure) { if (moduleName !== undefined) { moduleName = moduleName.replace(/ /g, ''); var modules = moduleName.split(','), index; for (index = 0; index < modules.length; index++) { if (!Shared.modules[modules[index]]) { failure(); return false; } } success(); } } }); /** * Checks version against the string passed and if it matches (or partially matches) * then the callback is called. * @param {String} val The version to check against. * @param {Function} callback The callback to call if match is true. * @returns {Boolean} */ Db.prototype.version = function (val, callback) { if (val !== undefined) { if (Shared.version.indexOf(val) === 0) { if (callback) { callback(); } return true; } return false; } return Shared.version; }; // Expose moduleLoaded method to non-instantiated object ForerunnerDB Db.moduleLoaded = Db.prototype.moduleLoaded; // Expose version method to non-instantiated object ForerunnerDB Db.version = Db.prototype.version; // Provide public access to the Shared object Db.shared = Shared; Db.prototype.shared = Shared; Shared.addModule('Db', Db); Shared.mixin(Db.prototype, 'Mixin.Common'); Shared.mixin(Db.prototype, 'Mixin.ChainReactor'); Shared.mixin(Db.prototype, 'Mixin.Constants'); Core = Shared.modules.Core; Collection = _dereq_('./Collection.js'); Metrics = _dereq_('./Metrics.js'); Crc = _dereq_('./Crc.js'); Db.prototype._isServer = false; /** * Gets / sets the core object this database belongs to. */ Shared.synthesize(Db.prototype, 'core'); /** * Gets / sets the default primary key for new collections. * @param {String=} val The name of the primary key to set. * @returns {*} */ Shared.synthesize(Db.prototype, 'primaryKey'); /** * Gets / sets the current state. * @param {String=} val The name of the state to set. * @returns {*} */ Shared.synthesize(Db.prototype, 'state'); /** * Gets / sets the name of the database. * @param {String=} val The name of the database to set. * @returns {*} */ Shared.synthesize(Db.prototype, 'name'); /** * Returns true if ForerunnerDB is running on a client browser. * @returns {boolean} */ Db.prototype.isClient = function () { return !this._isServer; }; /** * Returns true if ForerunnerDB is running on a server. * @returns {boolean} */ Db.prototype.isServer = function () { return this._isServer; }; /** * Returns a checksum of a string. * @param {String} string The string to checksum. * @return {String} The checksum generated. */ Db.prototype.crc = Crc; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a browser. */ Db.prototype.isClient = function () { return !this._isServer; }; /** * Checks if the database is running on a client (browser) or * a server (node.js). * @returns {Boolean} Returns true if running on a server. */ Db.prototype.isServer = function () { return this._isServer; }; /** * Converts a normal javascript array of objects into a DB collection. * @param {Array} arr An array of objects. * @returns {Collection} A new collection instance with the data set to the * array passed. */ Db.prototype.arrayToCollection = function (arr) { return new Collection().setData(arr); }; /** * Registers an event listener against an event name. * @param {String} event The name of the event to listen for. * @param {Function} listener The listener method to call when * the event is fired. * @returns {*} */ Db.prototype.on = function(event, listener) { this._listeners = this._listeners || {}; this._listeners[event] = this._listeners[event] || []; this._listeners[event].push(listener); return this; }; /** * De-registers an event listener from an event name. * @param {String} event The name of the event to stop listening for. * @param {Function} listener The listener method passed to on() when * registering the event listener. * @returns {*} */ Db.prototype.off = function(event, listener) { if (event in this._listeners) { var arr = this._listeners[event], index = arr.indexOf(listener); if (index > -1) { arr.splice(index, 1); } } return this; }; /** * Emits an event by name with the given data. * @param {String} event The name of the event to emit. * @param {*=} data The data to emit with the event. * @returns {*} */ Db.prototype.emit = function(event, data) { this._listeners = this._listeners || {}; if (event in this._listeners) { var arr = this._listeners[event], arrCount = arr.length, arrIndex; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arr[arrIndex].apply(this, Array.prototype.slice.call(arguments, 1)); } } return this; }; /** * Find all documents across all collections in the database that match the passed * string or search object. * @param search String or search object. * @returns {Array} */ Db.prototype.peek = function (search) { var i, coll, arr = [], typeOfSearch = typeof search; // Loop collections for (i in this._collection) { if (this._collection.hasOwnProperty(i)) { coll = this._collection[i]; if (typeOfSearch === 'string') { arr = arr.concat(coll.peek(search)); } else { arr = arr.concat(coll.find(search)); } } } return arr; }; /** * Find all documents across all collections in the database that match the passed * string or search object and return them in an object where each key is the name * of the collection that the document was matched in. * @param search String or search object. * @returns {object} */ Db.prototype.peekCat = function (search) { var i, coll, cat = {}, arr, typeOfSearch = typeof search; // Loop collections for (i in this._collection) { if (this._collection.hasOwnProperty(i)) { coll = this._collection[i]; if (typeOfSearch === 'string') { arr = coll.peek(search); if (arr && arr.length) { cat[coll.name()] = arr; } } else { arr = coll.find(search); if (arr && arr.length) { cat[coll.name()] = arr; } } } } return cat; }; Db.prototype.drop = new Overload({ /** * Drops the database. * @func drop * @memberof Db */ '': function () { if (this._state !== 'dropped') { var arr = this.collections(), arrCount = arr.length, arrIndex; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; }, /** * Drops the database with optional callback method. * @func drop * @memberof Db * @param {Function} callback Optional callback method. */ 'function': function (callback) { if (this._state !== 'dropped') { var arr = this.collections(), arrCount = arr.length, arrIndex, finishCount = 0, afterDrop = function () { finishCount++; if (finishCount === arrCount) { if (callback) { callback(); } } }; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(afterDrop); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; }, /** * Drops the database with optional persistent storage drop. Persistent * storage is dropped by default if no preference is provided. * @func drop * @memberof Db * @param {Boolean} removePersist Drop persistent storage for this database. */ 'boolean': function (removePersist) { if (this._state !== 'dropped') { var arr = this.collections(), arrCount = arr.length, arrIndex; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(removePersist); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; }, /** * Drops the database and optionally controls dropping persistent storage * and callback method. * @func drop * @memberof Db * @param {Boolean} removePersist Drop persistent storage for this database. * @param {Function} callback Optional callback method. */ 'boolean, function': function (removePersist, callback) { if (this._state !== 'dropped') { var arr = this.collections(), arrCount = arr.length, arrIndex, finishCount = 0, afterDrop = function () { finishCount++; if (finishCount === arrCount) { if (callback) { callback(); } } }; this._state = 'dropped'; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { this.collection(arr[arrIndex].name).drop(removePersist, afterDrop); delete this._collection[arr[arrIndex].name]; } this.emit('drop', this); delete this._core._db[this._name]; } return true; } }); /** * Gets a database instance by name. * @memberof Core * @param {String=} name Optional name of the database. If none is provided * a random name is assigned. * @returns {Db} */ Core.prototype.db = function (name) { if (!name) { name = this.objectId(); } this._db[name] = this._db[name] || new Db(name).core(this); return this._db[name]; }; /** * Returns an array of databases that ForerunnerDB currently has. * @memberof Core * @param {String|RegExp=} search The optional search string or regular expression to use * to match collection names against. * @returns {Array} An array of objects containing details of each database * that ForerunnerDB is currently managing and it's child entities. */ Core.prototype.databases = function (search) { var arr = [], tmpObj, addDb, i; if (search) { if (!(search instanceof RegExp)) { // Turn the search into a regular expression search = new RegExp(search); } } for (i in this._db) { if (this._db.hasOwnProperty(i)) { addDb = true; if (search) { if (!search.exec(i)) { addDb = false; } } if (addDb) { tmpObj = { name: i, children: [] }; if (this.shared.moduleExists('Collection')) { tmpObj.children.push({ module: 'collection', moduleName: 'Collections', count: this._db[i].collections().length }); } if (this.shared.moduleExists('CollectionGroup')) { tmpObj.children.push({ module: 'collectionGroup', moduleName: 'Collection Groups', count: this._db[i].collectionGroups().length }); } if (this.shared.moduleExists('Document')) { tmpObj.children.push({ module: 'document', moduleName: 'Documents', count: this._db[i].documents().length }); } if (this.shared.moduleExists('Grid')) { tmpObj.children.push({ module: 'grid', moduleName: 'Grids', count: this._db[i].grids().length }); } if (this.shared.moduleExists('Overview')) { tmpObj.children.push({ module: 'overview', moduleName: 'Overviews', count: this._db[i].overviews().length }); } if (this.shared.moduleExists('View')) { tmpObj.children.push({ module: 'view', moduleName: 'Views', count: this._db[i].views().length }); } arr.push(tmpObj); } } } arr.sort(function (a, b) { return a.name.localeCompare(b.name); }); return arr; }; module.exports = Db; },{"./Collection.js":2,"./Crc.js":4,"./Metrics.js":9,"./Overload":20,"./Shared":23}],6:[function(_dereq_,module,exports){ "use strict"; /* name id rebuild state match lookup */ var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'), btree = function () {}; /** * The index class used to instantiate hash map indexes that the database can * use to speed up queries on collections and views. * @constructor */ var IndexBinaryTree = function () { this.init.apply(this, arguments); }; IndexBinaryTree.prototype.init = function (keys, options, collection) { this._btree = new (btree.create(2, this.sortAsc))(); this._size = 0; this._id = this._itemKeyHash(keys, keys); this.unique(options && options.unique ? options.unique : false); if (keys !== undefined) { this.keys(keys); } if (collection !== undefined) { this.collection(collection); } this.name(options && options.name ? options.name : this._id); }; Shared.addModule('IndexBinaryTree', IndexBinaryTree); Shared.mixin(IndexBinaryTree.prototype, 'Mixin.ChainReactor'); Shared.mixin(IndexBinaryTree.prototype, 'Mixin.Sorting'); IndexBinaryTree.prototype.id = function () { return this._id; }; IndexBinaryTree.prototype.state = function () { return this._state; }; IndexBinaryTree.prototype.size = function () { return this._size; }; Shared.synthesize(IndexBinaryTree.prototype, 'data'); Shared.synthesize(IndexBinaryTree.prototype, 'name'); Shared.synthesize(IndexBinaryTree.prototype, 'collection'); Shared.synthesize(IndexBinaryTree.prototype, 'type'); Shared.synthesize(IndexBinaryTree.prototype, 'unique'); IndexBinaryTree.prototype.keys = function (val) { if (val !== undefined) { this._keys = val; // Count the keys this._keyCount = (new Path()).parse(this._keys).length; return this; } return this._keys; }; IndexBinaryTree.prototype.rebuild = function () { // Do we have a collection? if (this._collection) { // Get sorted data var collection = this._collection.subset({}, { $decouple: false, $orderBy: this._keys }), collectionData = collection.find(), dataIndex, dataCount = collectionData.length; // Clear the index data for the index this._btree = new (btree.create(2, this.sortAsc))(); if (this._unique) { this._uniqueLookup = {}; } // Loop the collection data for (dataIndex = 0; dataIndex < dataCount; dataIndex++) { this.insert(collectionData[dataIndex]); } } this._state = { name: this._name, keys: this._keys, indexSize: this._size, built: new Date(), updated: new Date(), ok: true }; }; IndexBinaryTree.prototype.insert = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, dataItemHash = this._itemKeyHash(dataItem, this._keys), keyArr; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); this._uniqueLookup[uniqueHash] = dataItem; } // We store multiple items that match a key inside an array // that is then stored against that key in the tree... // Check if item exists for this key already keyArr = this._btree.get(dataItemHash); // Check if the array exists if (keyArr === undefined) { // Generate an array for this key first keyArr = []; // Put the new array into the tree under the key this._btree.put(dataItemHash, keyArr); } // Push the item into the array keyArr.push(dataItem); this._size++; }; IndexBinaryTree.prototype.remove = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, dataItemHash = this._itemKeyHash(dataItem, this._keys), keyArr, itemIndex; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); delete this._uniqueLookup[uniqueHash]; } // Try and get the array for the item hash key keyArr = this._btree.get(dataItemHash); if (keyArr !== undefined) { // The key array exits, remove the item from the key array itemIndex = keyArr.indexOf(dataItem); if (itemIndex > -1) { // Check the length of the array if (keyArr.length === 1) { // This item is the last in the array, just kill the tree entry this._btree.del(dataItemHash); } else { // Remove the item keyArr.splice(itemIndex, 1); } this._size--; } } }; IndexBinaryTree.prototype.violation = function (dataItem) { // Generate item hash var uniqueHash = this._itemHash(dataItem, this._keys); // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexBinaryTree.prototype.hashViolation = function (uniqueHash) { // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexBinaryTree.prototype.lookup = function (query) { return this._data[this._itemHash(query, this._keys)] || []; }; IndexBinaryTree.prototype.match = function (query, options) { // Check if the passed query has data in the keys our index // operates on and if so, is the query sort matching our order var pathSolver = new Path(); var indexKeyArr = pathSolver.parseArr(this._keys), queryArr = pathSolver.parseArr(query), matchedKeys = [], matchedKeyCount = 0, i; // Loop the query array and check the order of keys against the // index key array to see if this index can be used for (i = 0; i < indexKeyArr.length; i++) { if (queryArr[i] === indexKeyArr[i]) { matchedKeyCount++; matchedKeys.push(queryArr[i]); } else { // Query match failed - this is a hash map index so partial key match won't work return { matchedKeys: [], totalKeyCount: queryArr.length, score: 0 }; } } return { matchedKeys: matchedKeys, totalKeyCount: queryArr.length, score: matchedKeyCount }; //return pathSolver.countObjectPaths(this._keys, query); }; IndexBinaryTree.prototype._itemHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.value(item, pathData[k].path).join(':'); } return hash; }; IndexBinaryTree.prototype._itemKeyHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.keyValue(item, pathData[k].path); } return hash; }; IndexBinaryTree.prototype._itemHashArr = function (item, keys) { var path = new Path(), pathData, //hash = '', hashArr = [], valArr, i, k, j; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { valArr = path.value(item, pathData[k].path); for (i = 0; i < valArr.length; i++) { if (k === 0) { // Setup the initial hash array hashArr.push(valArr[i]); } else { // Loop the hash array and concat the value to it for (j = 0; j < hashArr.length; j++) { hashArr[j] = hashArr[j] + '_' + valArr[i]; } } } } return hashArr; }; Shared.finishModule('IndexBinaryTree'); module.exports = IndexBinaryTree; },{"./Path":21,"./Shared":23}],7:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'); /** * The index class used to instantiate hash map indexes that the database can * use to speed up queries on collections and views. * @constructor */ var IndexHashMap = function () { this.init.apply(this, arguments); }; IndexHashMap.prototype.init = function (keys, options, collection) { this._crossRef = {}; this._size = 0; this._id = this._itemKeyHash(keys, keys); this.data({}); this.unique(options && options.unique ? options.unique : false); if (keys !== undefined) { this.keys(keys); } if (collection !== undefined) { this.collection(collection); } this.name(options && options.name ? options.name : this._id); }; Shared.addModule('IndexHashMap', IndexHashMap); Shared.mixin(IndexHashMap.prototype, 'Mixin.ChainReactor'); IndexHashMap.prototype.id = function () { return this._id; }; IndexHashMap.prototype.state = function () { return this._state; }; IndexHashMap.prototype.size = function () { return this._size; }; Shared.synthesize(IndexHashMap.prototype, 'data'); Shared.synthesize(IndexHashMap.prototype, 'name'); Shared.synthesize(IndexHashMap.prototype, 'collection'); Shared.synthesize(IndexHashMap.prototype, 'type'); Shared.synthesize(IndexHashMap.prototype, 'unique'); IndexHashMap.prototype.keys = function (val) { if (val !== undefined) { this._keys = val; // Count the keys this._keyCount = (new Path()).parse(this._keys).length; return this; } return this._keys; }; IndexHashMap.prototype.rebuild = function () { // Do we have a collection? if (this._collection) { // Get sorted data var collection = this._collection.subset({}, { $decouple: false, $orderBy: this._keys }), collectionData = collection.find(), dataIndex, dataCount = collectionData.length; // Clear the index data for the index this._data = {}; if (this._unique) { this._uniqueLookup = {}; } // Loop the collection data for (dataIndex = 0; dataIndex < dataCount; dataIndex++) { this.insert(collectionData[dataIndex]); } } this._state = { name: this._name, keys: this._keys, indexSize: this._size, built: new Date(), updated: new Date(), ok: true }; }; IndexHashMap.prototype.insert = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, itemHashArr, hashIndex; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); this._uniqueLookup[uniqueHash] = dataItem; } // Generate item hash itemHashArr = this._itemHashArr(dataItem, this._keys); // Get the path search results and store them for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) { this.pushToPathValue(itemHashArr[hashIndex], dataItem); } }; IndexHashMap.prototype.remove = function (dataItem, options) { var uniqueFlag = this._unique, uniqueHash, itemHashArr, hashIndex; if (uniqueFlag) { uniqueHash = this._itemHash(dataItem, this._keys); delete this._uniqueLookup[uniqueHash]; } // Generate item hash itemHashArr = this._itemHashArr(dataItem, this._keys); // Get the path search results and store them for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) { this.pullFromPathValue(itemHashArr[hashIndex], dataItem); } }; IndexHashMap.prototype.violation = function (dataItem) { // Generate item hash var uniqueHash = this._itemHash(dataItem, this._keys); // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexHashMap.prototype.hashViolation = function (uniqueHash) { // Check if the item breaks the unique constraint return Boolean(this._uniqueLookup[uniqueHash]); }; IndexHashMap.prototype.pushToPathValue = function (hash, obj) { var pathValArr = this._data[hash] = this._data[hash] || []; // Make sure we have not already indexed this object at this path/value if (pathValArr.indexOf(obj) === -1) { // Index the object pathValArr.push(obj); // Record the reference to this object in our index size this._size++; // Cross-reference this association for later lookup this.pushToCrossRef(obj, pathValArr); } }; IndexHashMap.prototype.pullFromPathValue = function (hash, obj) { var pathValArr = this._data[hash], indexOfObject; // Make sure we have already indexed this object at this path/value indexOfObject = pathValArr.indexOf(obj); if (indexOfObject > -1) { // Un-index the object pathValArr.splice(indexOfObject, 1); // Record the reference to this object in our index size this._size--; // Remove object cross-reference this.pullFromCrossRef(obj, pathValArr); } // Check if we should remove the path value array if (!pathValArr.length) { // Remove the array delete this._data[hash]; } }; IndexHashMap.prototype.pull = function (obj) { // Get all places the object has been used and remove them var id = obj[this._collection.primaryKey()], crossRefArr = this._crossRef[id], arrIndex, arrCount = crossRefArr.length, arrItem; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arrItem = crossRefArr[arrIndex]; // Remove item from this index lookup array this._pullFromArray(arrItem, obj); } // Record the reference to this object in our index size this._size--; // Now remove the cross-reference entry for this object delete this._crossRef[id]; }; IndexHashMap.prototype._pullFromArray = function (arr, obj) { var arrCount = arr.length; while (arrCount--) { if (arr[arrCount] === obj) { arr.splice(arrCount, 1); } } }; IndexHashMap.prototype.pushToCrossRef = function (obj, pathValArr) { var id = obj[this._collection.primaryKey()], crObj; this._crossRef[id] = this._crossRef[id] || []; // Check if the cross-reference to the pathVal array already exists crObj = this._crossRef[id]; if (crObj.indexOf(pathValArr) === -1) { // Add the cross-reference crObj.push(pathValArr); } }; IndexHashMap.prototype.pullFromCrossRef = function (obj, pathValArr) { var id = obj[this._collection.primaryKey()]; delete this._crossRef[id]; }; IndexHashMap.prototype.lookup = function (query) { return this._data[this._itemHash(query, this._keys)] || []; }; IndexHashMap.prototype.match = function (query, options) { // Check if the passed query has data in the keys our index // operates on and if so, is the query sort matching our order var pathSolver = new Path(); var indexKeyArr = pathSolver.parseArr(this._keys), queryArr = pathSolver.parseArr(query), matchedKeys = [], matchedKeyCount = 0, i; // Loop the query array and check the order of keys against the // index key array to see if this index can be used for (i = 0; i < indexKeyArr.length; i++) { if (queryArr[i] === indexKeyArr[i]) { matchedKeyCount++; matchedKeys.push(queryArr[i]); } else { // Query match failed - this is a hash map index so partial key match won't work return { matchedKeys: [], totalKeyCount: queryArr.length, score: 0 }; } } return { matchedKeys: matchedKeys, totalKeyCount: queryArr.length, score: matchedKeyCount }; //return pathSolver.countObjectPaths(this._keys, query); }; IndexHashMap.prototype._itemHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.value(item, pathData[k].path).join(':'); } return hash; }; IndexHashMap.prototype._itemKeyHash = function (item, keys) { var path = new Path(), pathData, hash = '', k; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { if (hash) { hash += '_'; } hash += path.keyValue(item, pathData[k].path); } return hash; }; IndexHashMap.prototype._itemHashArr = function (item, keys) { var path = new Path(), pathData, //hash = '', hashArr = [], valArr, i, k, j; pathData = path.parse(keys); for (k = 0; k < pathData.length; k++) { valArr = path.value(item, pathData[k].path); for (i = 0; i < valArr.length; i++) { if (k === 0) { // Setup the initial hash array hashArr.push(valArr[i]); } else { // Loop the hash array and concat the value to it for (j = 0; j < hashArr.length; j++) { hashArr[j] = hashArr[j] + '_' + valArr[i]; } } } } return hashArr; }; Shared.finishModule('IndexHashMap'); module.exports = IndexHashMap; },{"./Path":21,"./Shared":23}],8:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'); /** * The key value store class used when storing basic in-memory KV data, * and can be queried for quick retrieval. Mostly used for collection * primary key indexes and lookups. * @param {String=} name Optional KV store name. * @constructor */ var KeyValueStore = function (name) { this.init.apply(this, arguments); }; KeyValueStore.prototype.init = function (name) { this._name = name; this._data = {}; this._primaryKey = '_id'; }; Shared.addModule('KeyValueStore', KeyValueStore); Shared.mixin(KeyValueStore.prototype, 'Mixin.ChainReactor'); /** * Get / set the name of the key/value store. * @param {String} val The name to set. * @returns {*} */ Shared.synthesize(KeyValueStore.prototype, 'name'); /** * Get / set the primary key. * @param {String} key The key to set. * @returns {*} */ KeyValueStore.prototype.primaryKey = function (key) { if (key !== undefined) { this._primaryKey = key; return this; } return this._primaryKey; }; /** * Removes all data from the store. * @returns {*} */ KeyValueStore.prototype.truncate = function () { this._data = {}; return this; }; /** * Sets data against a key in the store. * @param {String} key The key to set data for. * @param {*} value The value to assign to the key. * @returns {*} */ KeyValueStore.prototype.set = function (key, value) { this._data[key] = value ? value : true; return this; }; /** * Gets data stored for the passed key. * @param {String} key The key to get data for. * @returns {*} */ KeyValueStore.prototype.get = function (key) { return this._data[key]; }; /** * Get / set the primary key. * @param {*} obj A lookup query, can be a string key, an array of string keys, * an object with further query clauses or a regular expression that should be * run against all keys. * @returns {*} */ KeyValueStore.prototype.lookup = function (obj) { var pKeyVal = obj[this._primaryKey], arrIndex, arrCount, lookupItem, result; if (pKeyVal instanceof Array) { // An array of primary keys, find all matches arrCount = pKeyVal.length; result = []; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { lookupItem = this._data[pKeyVal[arrIndex]]; if (lookupItem) { result.push(lookupItem); } } return result; } else if (pKeyVal instanceof RegExp) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (pKeyVal.test(arrIndex)) { result.push(this._data[arrIndex]); } } } return result; } else if (typeof pKeyVal === 'object') { // The primary key clause is an object, now we have to do some // more extensive searching if (pKeyVal.$ne) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (arrIndex !== pKeyVal.$ne) { result.push(this._data[arrIndex]); } } } return result; } if (pKeyVal.$in && (pKeyVal.$in instanceof Array)) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (pKeyVal.$in.indexOf(arrIndex) > -1) { result.push(this._data[arrIndex]); } } } return result; } if (pKeyVal.$nin && (pKeyVal.$nin instanceof Array)) { // Create new data result = []; for (arrIndex in this._data) { if (this._data.hasOwnProperty(arrIndex)) { if (pKeyVal.$nin.indexOf(arrIndex) === -1) { result.push(this._data[arrIndex]); } } } return result; } if (pKeyVal.$or && (pKeyVal.$or instanceof Array)) { // Create new data result = []; for (arrIndex = 0; arrIndex < pKeyVal.$or.length; arrIndex++) { result = result.concat(this.lookup(pKeyVal.$or[arrIndex])); } return result; } } else { // Key is a basic lookup from string lookupItem = this._data[pKeyVal]; if (lookupItem !== undefined) { return [lookupItem]; } else { return []; } } }; /** * Removes data for the given key from the store. * @param {String} key The key to un-set. * @returns {*} */ KeyValueStore.prototype.unSet = function (key) { delete this._data[key]; return this; }; /** * Sets data for the give key in the store only where the given key * does not already have a value in the store. * @param {String} key The key to set data for. * @param {*} value The value to assign to the key. * @returns {Boolean} True if data was set or false if data already * exists for the key. */ KeyValueStore.prototype.uniqueSet = function (key, value) { if (this._data[key] === undefined) { this._data[key] = value; return true; } return false; }; Shared.finishModule('KeyValueStore'); module.exports = KeyValueStore; },{"./Shared":23}],9:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Operation = _dereq_('./Operation'); /** * The metrics class used to store details about operations. * @constructor */ var Metrics = function () { this.init.apply(this, arguments); }; Metrics.prototype.init = function () { this._data = []; }; Shared.addModule('Metrics', Metrics); Shared.mixin(Metrics.prototype, 'Mixin.ChainReactor'); /** * Creates an operation within the metrics instance and if metrics * are currently enabled (by calling the start() method) the operation * is also stored in the metrics log. * @param {String} name The name of the operation. * @returns {Operation} */ Metrics.prototype.create = function (name) { var op = new Operation(name); if (this._enabled) { this._data.push(op); } return op; }; /** * Starts logging operations. * @returns {Metrics} */ Metrics.prototype.start = function () { this._enabled = true; return this; }; /** * Stops logging operations. * @returns {Metrics} */ Metrics.prototype.stop = function () { this._enabled = false; return this; }; /** * Clears all logged operations. * @returns {Metrics} */ Metrics.prototype.clear = function () { this._data = []; return this; }; /** * Returns an array of all logged operations. * @returns {Array} */ Metrics.prototype.list = function () { return this._data; }; Shared.finishModule('Metrics'); module.exports = Metrics; },{"./Operation":19,"./Shared":23}],10:[function(_dereq_,module,exports){ "use strict"; var CRUD = { preSetData: function () { }, postSetData: function () { } }; module.exports = CRUD; },{}],11:[function(_dereq_,module,exports){ "use strict"; /** * The chain reactor mixin, provides a class with chain reaction capabilities. * @mixin */ var ChainReactor = { /** * * @param obj */ chain: function (obj) { this._chain = this._chain || []; var index = this._chain.indexOf(obj); if (index === -1) { this._chain.push(obj); } }, unChain: function (obj) { if (this._chain) { var index = this._chain.indexOf(obj); if (index > -1) { this._chain.splice(index, 1); } } }, chainSend: function (type, data, options) { if (this._chain) { var arr = this._chain, arrItem, count = arr.length, index; for (index = 0; index < count; index++) { arrItem = arr[index]; if (!arrItem._state || (arrItem._state && arrItem._state !== 'dropped')) { arrItem.chainReceive(this, type, data, options); } else { console.log('Reactor Data:', type, data, options); console.log('Reactor Node:', arrItem); throw('Chain reactor attempting to send data to target reactor node that is in a dropped state!'); } } } }, chainReceive: function (sender, type, data, options) { var chainPacket = { sender: sender, type: type, data: data, options: options }; // Fire our internal handler if (!this._chainHandler || (this._chainHandler && !this._chainHandler(chainPacket))) { // Propagate the message down the chain this.chainSend(chainPacket.type, chainPacket.data, chainPacket.options); } } }; module.exports = ChainReactor; },{}],12:[function(_dereq_,module,exports){ "use strict"; var idCounter = 0, Overload = _dereq_('./Overload'), Common; Common = { /** * Gets / sets data in the item store. The store can be used to set and * retrieve data against a key. Useful for adding arbitrary key/value data * to a collection / view etc and retrieving it later. * @param {String|*} key The key under which to store the passed value or * retrieve the existing stored value. * @param {*=} val Optional value. If passed will overwrite the existing value * stored against the specified key if one currently exists. * @returns {*} */ store: function (key, val) { if (key !== undefined) { if (val !== undefined) { // Store the data this._store = this._store || {}; this._store[key] = val; return this; } if (this._store) { return this._store[key]; } } return undefined; }, /** * Removes a previously stored key/value pair from the item store, set previously * by using the store() method. * @param {String|*} key The key of the key/value pair to remove; * @returns {Common} Returns this for chaining. */ unStore: function (key) { if (key !== undefined) { delete this._store[key]; } return this; }, /** * Returns a non-referenced version of the passed object / array. * @param {Object} data The object or array to return as a non-referenced version. * @param {Number=} copies Optional number of copies to produce. If specified, the return * value will be an array of decoupled objects, each distinct from the other. * @returns {*} */ decouple: function (data, copies) { if (data !== undefined) { if (!copies) { return JSON.parse(JSON.stringify(data)); } else { var i, json = JSON.stringify(data), copyArr = []; for (i = 0; i < copies; i++) { copyArr.push(JSON.parse(json)); } return copyArr; } } return undefined; }, /** * Generates a new 16-character hexadecimal unique ID or * generates a new 16-character hexadecimal ID based on * the passed string. Will always generate the same ID * for the same string. * @param {String=} str A string to generate the ID from. * @return {String} */ objectId: function (str) { var id, pow = Math.pow(10, 17); if (!str) { idCounter++; id = (idCounter + ( Math.random() * pow + Math.random() * pow + Math.random() * pow + Math.random() * pow )).toString(16); } else { var val = 0, count = str.length, i; for (i = 0; i < count; i++) { val += str.charCodeAt(i) * pow; } id = val.toString(16); } return id; }, /** * Gets / sets debug flag that can enable debug message output to the * console if required. * @param {Boolean} val The value to set debug flag to. * @return {Boolean} True if enabled, false otherwise. */ /** * Sets debug flag for a particular type that can enable debug message * output to the console if required. * @param {String} type The name of the debug type to set flag for. * @param {Boolean} val The value to set debug flag to. * @return {Boolean} True if enabled, false otherwise. */ debug: new Overload([ function () { return this._debug && this._debug.all; }, function (val) { if (val !== undefined) { if (typeof val === 'boolean') { this._debug = this._debug || {}; this._debug.all = val; this.chainSend('debug', this._debug); return this; } else { return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[val]) || (this._debug && this._debug.all); } } return this._debug && this._debug.all; }, function (type, val) { if (type !== undefined) { if (val !== undefined) { this._debug = this._debug || {}; this._debug[type] = val; this.chainSend('debug', this._debug); return this; } return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[type]); } return this._debug && this._debug.all; } ]) }; module.exports = Common; },{"./Overload":20}],13:[function(_dereq_,module,exports){ "use strict"; var Constants = { TYPE_INSERT: 0, TYPE_UPDATE: 1, TYPE_REMOVE: 2, PHASE_BEFORE: 0, PHASE_AFTER: 1 }; module.exports = Constants; },{}],14:[function(_dereq_,module,exports){ "use strict"; var Overload = _dereq_('./Overload'); var Events = { on: new Overload({ /** * Attach an event listener to the passed event. * @param {String} event The name of the event to listen for. * @param {Function} listener The method to call when the event is fired. */ 'string, function': function (event, listener) { this._listeners = this._listeners || {}; this._listeners[event] = this._listeners[event] || {}; this._listeners[event]['*'] = this._listeners[event]['*'] || []; this._listeners[event]['*'].push(listener); return this; }, /** * Attach an event listener to the passed event only if the passed * id matches the document id for the event being fired. * @param {String} event The name of the event to listen for. * @param {*} id The document id to match against. * @param {Function} listener The method to call when the event is fired. */ 'string, *, function': function (event, id, listener) { this._listeners = this._listeners || {}; this._listeners[event] = this._listeners[event] || {}; this._listeners[event][id] = this._listeners[event][id] || []; this._listeners[event][id].push(listener); return this; } }), off: new Overload({ 'string': function (event) { if (this._listeners && this._listeners[event] && event in this._listeners) { delete this._listeners[event]; } return this; }, 'string, function': function (event, listener) { var arr, index; if (typeof(listener) === 'string') { if (this._listeners && this._listeners[event] && this._listeners[event][listener]) { delete this._listeners[event][listener]; } } else { if (this._listeners && event in this._listeners) { arr = this._listeners[event]['*']; index = arr.indexOf(listener); if (index > -1) { arr.splice(index, 1); } } } return this; }, 'string, *, function': function (event, id, listener) { if (this._listeners && event in this._listeners && id in this.listeners[event]) { var arr = this._listeners[event][id], index = arr.indexOf(listener); if (index > -1) { arr.splice(index, 1); } } }, 'string, *': function (event, id) { if (this._listeners && event in this._listeners && id in this._listeners[event]) { // Kill all listeners for this event id delete this._listeners[event][id]; } } }), emit: function (event, data) { this._listeners = this._listeners || {}; if (event in this._listeners) { var arrIndex, arrCount; // Handle global emit if (this._listeners[event]['*']) { var arr = this._listeners[event]['*']; arrCount = arr.length; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { arr[arrIndex].apply(this, Array.prototype.slice.call(arguments, 1)); } } // Handle individual emit if (data instanceof Array) { // Check if the array is an array of objects in the collection if (data[0] && data[0][this._primaryKey]) { // Loop the array and check for listeners against the primary key var listenerIdArr = this._listeners[event], listenerIdCount, listenerIdIndex; arrCount = data.length; for (arrIndex = 0; arrIndex < arrCount; arrIndex++) { if (listenerIdArr[data[arrIndex][this._primaryKey]]) { // Emit for this id listenerIdCount = listenerIdArr[data[arrIndex][this._primaryKey]].length; for (listenerIdIndex = 0; listenerIdIndex < listenerIdCount; listenerIdIndex++) { listenerIdArr[data[arrIndex][this._primaryKey]][listenerIdIndex].apply(this, Array.prototype.slice.call(arguments, 1)); } } } } } } return this; } }; module.exports = Events; },{"./Overload":20}],15:[function(_dereq_,module,exports){ "use strict"; var Matching = { /** * Internal method that checks a document against a test object. * @param {*} source The source object or value to test against. * @param {*} test The test object or value to test with. * @param {String=} opToApply The special operation to apply to the test such * as 'and' or an 'or' operator. * @param {Object=} options An object containing options to apply to the * operation such as limiting the fields returned etc. * @returns {Boolean} True if the test was positive, false on negative. * @private */ _match: function (source, test, opToApply, options) { // TODO: This method is quite long, break into smaller pieces var operation, applyOp, recurseVal, tmpIndex, sourceType = typeof source, testType = typeof test, matchedAll = true, opResult, substringCache, i; options = options || {}; // Check if options currently holds a root query object if (!options.$rootQuery) { // Root query not assigned, hold the root query options.$rootQuery = test; } options.$rootData = options.$rootData || {}; // Check if the comparison data are both strings or numbers if ((sourceType === 'string' || sourceType === 'number') && (testType === 'string' || testType === 'number')) { // The source and test data are flat types that do not require recursive searches, // so just compare them and return the result if (sourceType === 'number') { // Number comparison if (source !== test) { matchedAll = false; } } else { // String comparison if (source.localeCompare(test)) { matchedAll = false; } } } else { for (i in test) { if (test.hasOwnProperty(i)) { // Reset operation flag operation = false; substringCache = i.substr(0, 2); // Check if the property is a comment (ignorable) if (substringCache === '//') { // Skip this property continue; } // Check if the property starts with a dollar (function) if (substringCache.indexOf('$') === 0) { // Ask the _matchOp method to handle the operation opResult = this._matchOp(i, source, test[i], options); // Check the result of the matchOp operation // If the result is -1 then no operation took place, otherwise the result // will be a boolean denoting a match (true) or no match (false) if (opResult > -1) { if (opResult) { if (opToApply === 'or') { return true; } } else { // Set the matchedAll flag to the result of the operation // because the operation did not return true matchedAll = opResult; } // Record that an operation was handled operation = true; } } // Check for regex if (!operation && test[i] instanceof RegExp) { operation = true; if (typeof(source) === 'object' && source[i] !== undefined && test[i].test(source[i])) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } if (!operation) { // Check if our query is an object if (typeof(test[i]) === 'object') { // Because test[i] is an object, source must also be an object // Check if our source data we are checking the test query against // is an object or an array if (source[i] !== undefined) { if (source[i] instanceof Array && !(test[i] instanceof Array)) { // The source data is an array, so check each item until a // match is found recurseVal = false; for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) { recurseVal = this._match(source[i][tmpIndex], test[i], applyOp, options); if (recurseVal) { // One of the array items matched the query so we can // include this item in the results, so break now break; } } if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else if (!(source[i] instanceof Array) && test[i] instanceof Array) { // The test key data is an array and the source key data is not so check // each item in the test key data to see if the source item matches one // of them. This is effectively an $in search. recurseVal = false; for (tmpIndex = 0; tmpIndex < test[i].length; tmpIndex++) { recurseVal = this._match(source[i], test[i][tmpIndex], applyOp, options); if (recurseVal) { // One of the array items matched the query so we can // include this item in the results, so break now break; } } if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else if (typeof(source) === 'object') { // Recurse down the object tree recurseVal = this._match(source[i], test[i], applyOp, options); if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else { recurseVal = this._match(undefined, test[i], applyOp, options); if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } } else { // First check if the test match is an $exists if (test[i] && test[i].$exists !== undefined) { // Push the item through another match recurse recurseVal = this._match(undefined, test[i], applyOp, options); if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else { matchedAll = false; } } } else { // Check if the prop matches our test value if (source && source[i] === test[i]) { if (opToApply === 'or') { return true; } } else if (source && source[i] && source[i] instanceof Array && test[i] && typeof(test[i]) !== "object") { // We are looking for a value inside an array // The source data is an array, so check each item until a // match is found recurseVal = false; for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) { recurseVal = this._match(source[i][tmpIndex], test[i], applyOp, options); if (recurseVal) { // One of the array items matched the query so we can // include this item in the results, so break now break; } } if (recurseVal) { if (opToApply === 'or') { return true; } } else { matchedAll = false; } } else { matchedAll = false; } } } if (opToApply === 'and' && !matchedAll) { return false; } } } } return matchedAll; }, /** * Internal method, performs a matching process against a query operator such as $gt or $nin. * @param {String} key The property name in the test that matches the operator to perform * matching against. * @param {*} source The source data to match the query against. * @param {*} test The query to match the source against. * @param {Object=} options An options object. * @returns {*} * @private */ _matchOp: function (key, source, test, options) { // Check for commands switch (key) { case '$gt': // Greater than return source > test; case '$gte': // Greater than or equal return source >= test; case '$lt': // Less than return source < test; case '$lte': // Less than or equal return source <= test; case '$exists': // Property exists return (source === undefined) !== test; case '$ne': // Not equals return source != test; // jshint ignore:line case '$or': // Match true on ANY check to pass for (var orIndex = 0; orIndex < test.length; orIndex++) { if (this._match(source, test[orIndex], 'and', options)) { return true; } } return false; case '$and': // Match true on ALL checks to pass for (var andIndex = 0; andIndex < test.length; andIndex++) { if (!this._match(source, test[andIndex], 'and', options)) { return false; } } return true; case '$in': // In // Check that the in test is an array if (test instanceof Array) { var inArr = test, inArrCount = inArr.length, inArrIndex; for (inArrIndex = 0; inArrIndex < inArrCount; inArrIndex++) { if (inArr[inArrIndex] === source) { return true; } } return false; } else { throw('ForerunnerDB.Mixin.Matching "' + this.name() + '": Cannot use an $in operator on a non-array key: ' + key); } break; case '$nin': // Not in // Check that the not-in test is an array if (test instanceof Array) { var notInArr = test, notInArrCount = notInArr.length, notInArrIndex; for (notInArrIndex = 0; notInArrIndex < notInArrCount; notInArrIndex++) { if (notInArr[notInArrIndex] === source) { return false; } } return true; } else { throw('ForerunnerDB.Mixin.Matching "' + this.name() + '": Cannot use a $nin operator on a non-array key: ' + key); } break; case '$distinct': // Ensure options holds a distinct lookup options.$rootData['//distinctLookup'] = options.$rootData['//distinctLookup'] || {}; for (var distinctProp in test) { if (test.hasOwnProperty(distinctProp)) { options.$rootData['//distinctLookup'][distinctProp] = options.$rootData['//distinctLookup'][distinctProp] || {}; // Check if the options distinct lookup has this field's value if (options.$rootData['//distinctLookup'][distinctProp][source[distinctProp]]) { // Value is already in use return false; } else { // Set the value in the lookup options.$rootData['//distinctLookup'][distinctProp][source[distinctProp]] = true; // Allow the item in the results return true; } } } break; } return -1; } }; module.exports = Matching; },{}],16:[function(_dereq_,module,exports){ "use strict"; var Sorting = { /** * Sorts the passed value a against the passed value b ascending. * @param {*} a The first value to compare. * @param {*} b The second value to compare. * @returns {*} 1 if a is sorted after b, -1 if a is sorted before b. */ sortAsc: function (a, b) { if (typeof(a) === 'string' && typeof(b) === 'string') { return a.localeCompare(b); } else { if (a > b) { return 1; } else if (a < b) { return -1; } } return 0; }, /** * Sorts the passed value a against the passed value b descending. * @param {*} a The first value to compare. * @param {*} b The second value to compare. * @returns {*} 1 if a is sorted after b, -1 if a is sorted before b. */ sortDesc: function (a, b) { if (typeof(a) === 'string' && typeof(b) === 'string') { return b.localeCompare(a); } else { if (a > b) { return -1; } else if (a < b) { return 1; } } return 0; } }; module.exports = Sorting; },{}],17:[function(_dereq_,module,exports){ "use strict"; var Overload = _dereq_('./Overload'); var Triggers = { /** * Add a trigger by id. * @param {String} id The id of the trigger. This must be unique to the type and * phase of the trigger. Only one trigger may be added with this id per type and * phase. * @param {Number} type The type of operation to apply the trigger to. See * Mixin.Constants for constants to use. * @param {Number} phase The phase of an operation to fire the trigger on. See * Mixin.Constants for constants to use. * @param {Function} method The method to call when the trigger is fired. * @returns {boolean} True if the trigger was added successfully, false if not. */ addTrigger: function (id, type, phase, method) { var self = this, triggerIndex; // Check if the trigger already exists triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex === -1) { // The trigger does not exist, create it self._trigger = self._trigger || {}; self._trigger[type] = self._trigger[type] || {}; self._trigger[type][phase] = self._trigger[type][phase] || []; self._trigger[type][phase].push({ id: id, method: method, enabled: true }); return true; } return false; }, /** * * @param {String} id The id of the trigger to remove. * @param {Number} type The type of operation to remove the trigger from. See * Mixin.Constants for constants to use. * @param {Number} phase The phase of the operation to remove the trigger from. * See Mixin.Constants for constants to use. * @returns {boolean} True if removed successfully, false if not. */ removeTrigger: function (id, type, phase) { var self = this, triggerIndex; // Check if the trigger already exists triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex > -1) { // The trigger exists, remove it self._trigger[type][phase].splice(triggerIndex, 1); } return false; }, enableTrigger: new Overload({ 'string': function (id) { // Alter all triggers of this type var self = this, types = self._trigger, phases, triggers, result = false, i, k, j; if (types) { for (j in types) { if (types.hasOwnProperty(j)) { phases = types[j]; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set enabled flag for (k = 0; k < triggers.length; k++) { if (triggers[k].id === id) { triggers[k].enabled = true; result = true; } } } } } } } } return result; }, 'number': function (type) { // Alter all triggers of this type var self = this, phases = self._trigger[type], triggers, result = false, i, k; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set to enabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = true; result = true; } } } } return result; }, 'number, number': function (type, phase) { // Alter all triggers of this type and phase var self = this, phases = self._trigger[type], triggers, result = false, k; if (phases) { triggers = phases[phase]; if (triggers) { // Loop triggers and set to enabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = true; result = true; } } } return result; }, 'string, number, number': function (id, type, phase) { // Check if the trigger already exists var self = this, triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex > -1) { // Update the trigger self._trigger[type][phase][triggerIndex].enabled = true; return true; } return false; } }), disableTrigger: new Overload({ 'string': function (id) { // Alter all triggers of this type var self = this, types = self._trigger, phases, triggers, result = false, i, k, j; if (types) { for (j in types) { if (types.hasOwnProperty(j)) { phases = types[j]; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set enabled flag for (k = 0; k < triggers.length; k++) { if (triggers[k].id === id) { triggers[k].enabled = false; result = true; } } } } } } } } return result; }, 'number': function (type) { // Alter all triggers of this type var self = this, phases = self._trigger[type], triggers, result = false, i, k; if (phases) { for (i in phases) { if (phases.hasOwnProperty(i)) { triggers = phases[i]; // Loop triggers and set to disabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = false; result = true; } } } } return result; }, 'number, number': function (type, phase) { // Alter all triggers of this type and phase var self = this, phases = self._trigger[type], triggers, result = false, k; if (phases) { triggers = phases[phase]; if (triggers) { // Loop triggers and set to disabled for (k = 0; k < triggers.length; k++) { triggers[k].enabled = false; result = true; } } } return result; }, 'string, number, number': function (id, type, phase) { // Check if the trigger already exists var self = this, triggerIndex = self._triggerIndexOf(id, type, phase); if (triggerIndex > -1) { // Update the trigger self._trigger[type][phase][triggerIndex].enabled = false; return true; } return false; } }), /** * Checks if a trigger will fire based on the type and phase provided. * @param {Number} type The type of operation. See Mixin.Constants for * constants to use. * @param {Number} phase The phase of the operation. See Mixin.Constants * for constants to use. * @returns {Boolean} True if the trigger will fire, false otherwise. */ willTrigger: function (type, phase) { if (this._trigger && this._trigger[type] && this._trigger[type][phase] && this._trigger[type][phase].length) { // Check if a trigger in this array is enabled var arr = this._trigger[type][phase], i; for (i = 0; i < arr.length; i++) { if (arr[i].enabled) { return true; } } } return false; }, /** * Processes trigger actions based on the operation, type and phase. * @param {Object} operation Operation data to pass to the trigger. * @param {Number} type The type of operation. See Mixin.Constants for * constants to use. * @param {Number} phase The phase of the operation. See Mixin.Constants * for constants to use. * @param {Object} oldDoc The document snapshot before operations are * carried out against the data. * @param {Object} newDoc The document snapshot after operations are * carried out against the data. * @returns {boolean} */ processTrigger: function (operation, type, phase, oldDoc, newDoc) { var self = this, triggerArr, triggerIndex, triggerCount, triggerItem, response; if (self._trigger && self._trigger[type] && self._trigger[type][phase]) { triggerArr = self._trigger[type][phase]; triggerCount = triggerArr.length; for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) { triggerItem = triggerArr[triggerIndex]; // Check if the trigger is enabled if (triggerItem.enabled) { if (this.debug()) { var typeName, phaseName; switch (type) { case this.TYPE_INSERT: typeName = 'insert'; break; case this.TYPE_UPDATE: typeName = 'update'; break; case this.TYPE_REMOVE: typeName = 'remove'; break; default: typeName = ''; break; } switch (phase) { case this.PHASE_BEFORE: phaseName = 'before'; break; case this.PHASE_AFTER: phaseName = 'after'; break; default: phaseName = ''; break; } //console.log('Triggers: Processing trigger "' + id + '" for ' + typeName + ' in phase "' + phaseName + '"'); } // Run the trigger's method and store the response response = triggerItem.method.call(self, operation, oldDoc, newDoc); // Check the response for a non-expected result (anything other than // undefined, true or false is considered a throwable error) if (response === false) { // The trigger wants us to cancel operations return false; } if (response !== undefined && response !== true && response !== false) { // Trigger responded with error, throw the error throw('ForerunnerDB.Mixin.Triggers: Trigger error: ' + response); } } } // Triggers all ran without issue, return a success (true) return true; } }, /** * Returns the index of a trigger by id based on type and phase. * @param {String} id The id of the trigger to find the index of. * @param {Number} type The type of operation. See Mixin.Constants for * constants to use. * @param {Number} phase The phase of the operation. See Mixin.Constants * for constants to use. * @returns {number} * @private */ _triggerIndexOf: function (id, type, phase) { var self = this, triggerArr, triggerCount, triggerIndex; if (self._trigger && self._trigger[type] && self._trigger[type][phase]) { triggerArr = self._trigger[type][phase]; triggerCount = triggerArr.length; for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) { if (triggerArr[triggerIndex].id === id) { return triggerIndex; } } } return -1; } }; module.exports = Triggers; },{"./Overload":20}],18:[function(_dereq_,module,exports){ "use strict"; var Updating = { /** * Updates a property on an object. * @param {Object} doc The object whose property is to be updated. * @param {String} prop The property to update. * @param {*} val The new value of the property. * @private */ _updateProperty: function (doc, prop, val) { doc[prop] = val; if (this.debug()) { console.log('ForerunnerDB.Mixin.Updating: Setting non-data-bound document property "' + prop + '" for "' + this.name() + '"'); } }, /** * Increments a value for a property on a document by the passed number. * @param {Object} doc The document to modify. * @param {String} prop The property to modify. * @param {Number} val The amount to increment by. * @private */ _updateIncrement: function (doc, prop, val) { doc[prop] += val; }, /** * Changes the index of an item in the passed array. * @param {Array} arr The array to modify. * @param {Number} indexFrom The index to move the item from. * @param {Number} indexTo The index to move the item to. * @private */ _updateSpliceMove: function (arr, indexFrom, indexTo) { arr.splice(indexTo, 0, arr.splice(indexFrom, 1)[0]); if (this.debug()) { console.log('ForerunnerDB.Mixin.Updating: Moving non-data-bound document array index from "' + indexFrom + '" to "' + indexTo + '" for "' + this.name() + '"'); } }, /** * Inserts an item into the passed array at the specified index. * @param {Array} arr The array to insert into. * @param {Number} index The index to insert at. * @param {Object} doc The document to insert. * @private */ _updateSplicePush: function (arr, index, doc) { if (arr.length > index) { arr.splice(index, 0, doc); } else { arr.push(doc); } }, /** * Inserts an item at the end of an array. * @param {Array} arr The array to insert the item into. * @param {Object} doc The document to insert. * @private */ _updatePush: function (arr, doc) { arr.push(doc); }, /** * Removes an item from the passed array. * @param {Array} arr The array to modify. * @param {Number} index The index of the item in the array to remove. * @private */ _updatePull: function (arr, index) { arr.splice(index, 1); }, /** * Multiplies a value for a property on a document by the passed number. * @param {Object} doc The document to modify. * @param {String} prop The property to modify. * @param {Number} val The amount to multiply by. * @private */ _updateMultiply: function (doc, prop, val) { doc[prop] *= val; }, /** * Renames a property on a document to the passed property. * @param {Object} doc The document to modify. * @param {String} prop The property to rename. * @param {Number} val The new property name. * @private */ _updateRename: function (doc, prop, val) { doc[val] = doc[prop]; delete doc[prop]; }, /** * Sets a property on a document to the passed value. * @param {Object} doc The document to modify. * @param {String} prop The property to delete. * @param {*} val The new property value. * @private */ _updateOverwrite: function (doc, prop, val) { doc[prop] = val; }, /** * Deletes a property on a document. * @param {Object} doc The document to modify. * @param {String} prop The property to delete. * @private */ _updateUnset: function (doc, prop) { delete doc[prop]; }, /** * Removes all properties from an object without destroying * the object instance, thereby maintaining data-bound linking. * @param {Object} doc The parent object to modify. * @param {String} prop The name of the child object to clear. * @private */ _updateClear: function (doc, prop) { var obj = doc[prop], i; if (obj && typeof obj === 'object') { for (i in obj) { if (obj.hasOwnProperty(i)) { this._updateUnset(obj, i); } } } }, /** * Pops an item from the array stack. * @param {Object} doc The document to modify. * @param {Number=} val Optional, if set to 1 will pop, if set to -1 will shift. * @return {Boolean} * @private */ _updatePop: function (doc, val) { var updated = false; if (doc.length > 0) { if (val === 1) { doc.pop(); updated = true; } else if (val === -1) { doc.shift(); updated = true; } } return updated; } }; module.exports = Updating; },{}],19:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'), Path = _dereq_('./Path'); /** * The operation class, used to store details about an operation being * performed by the database. * @param {String} name The name of the operation. * @constructor */ var Operation = function (name) { this.pathSolver = new Path(); this.counter = 0; this.init.apply(this, arguments); }; Operation.prototype.init = function (name) { this._data = { operation: name, // The name of the operation executed such as "find", "update" etc index: { potential: [], // Indexes that could have potentially been used used: false // The index that was picked to use }, steps: [], // The steps taken to generate the query results, time: { startMs: 0, stopMs: 0, totalMs: 0, process: {} }, flag: {}, // An object with flags that denote certain execution paths log: [] // Any extra data that might be useful such as warnings or helpful hints }; }; Shared.addModule('Operation', Operation); Shared.mixin(Operation.prototype, 'Mixin.ChainReactor'); /** * Starts the operation timer. */ Operation.prototype.start = function () { this._data.time.startMs = new Date().getTime(); }; /** * Adds an item to the operation log. * @param {String} event The item to log. * @returns {*} */ Operation.prototype.log = function (event) { if (event) { var lastLogTime = this._log.length > 0 ? this._data.log[this._data.log.length - 1].time : 0, logObj = { event: event, time: new Date().getTime(), delta: 0 }; this._data.log.push(logObj); if (lastLogTime) { logObj.delta = logObj.time - lastLogTime; } return this; } return this._data.log; }; /** * Called when starting and ending a timed operation, used to time * internal calls within an operation's execution. * @param {String} section An operation name. * @returns {*} */ Operation.prototype.time = function (section) { if (section !== undefined) { var process = this._data.time.process, processObj = process[section] = process[section] || {}; if (!processObj.startMs) { // Timer started processObj.startMs = new Date().getTime(); processObj.stepObj = { name: section }; this._data.steps.push(processObj.stepObj); } else { processObj.stopMs = new Date().getTime(); processObj.totalMs = processObj.stopMs - processObj.startMs; processObj.stepObj.totalMs = processObj.totalMs; delete processObj.stepObj; } return this; } return this._data.time; }; /** * Used to set key/value flags during operation execution. * @param {String} key * @param {String} val * @returns {*} */ Operation.prototype.flag = function (key, val) { if (key !== undefined && val !== undefined) { this._data.flag[key] = val; } else if (key !== undefined) { return this._data.flag[key]; } else { return this._data.flag; } }; Operation.prototype.data = function (path, val, noTime) { if (val !== undefined) { // Assign value to object path this.pathSolver.set(this._data, path, val); return this; } return this.pathSolver.get(this._data, path); }; Operation.prototype.pushData = function (path, val, noTime) { // Assign value to object path this.pathSolver.push(this._data, path, val); }; /** * Stops the operation timer. */ Operation.prototype.stop = function () { this._data.time.stopMs = new Date().getTime(); this._data.time.totalMs = this._data.time.stopMs - this._data.time.startMs; }; Shared.finishModule('Operation'); module.exports = Operation; },{"./Path":21,"./Shared":23}],20:[function(_dereq_,module,exports){ "use strict"; /** * Allows a method to accept overloaded calls with different parameters controlling * which passed overload function is called. * @param {Object} def * @returns {Function} * @constructor */ var Overload = function (def) { if (def) { var self = this, index, count, tmpDef, defNewKey, sigIndex, signatures; if (!(def instanceof Array)) { tmpDef = {}; // Def is an object, make sure all prop names are devoid of spaces for (index in def) { if (def.hasOwnProperty(index)) { defNewKey = index.replace(/ /g, ''); // Check if the definition array has a * string in it if (defNewKey.indexOf('*') === -1) { // No * found tmpDef[defNewKey] = def[index]; } else { // A * was found, generate the different signatures that this // definition could represent signatures = this.generateSignaturePermutations(defNewKey); for (sigIndex = 0; sigIndex < signatures.length; sigIndex++) { if (!tmpDef[signatures[sigIndex]]) { tmpDef[signatures[sigIndex]] = def[index]; } } } } } def = tmpDef; } return function () { var arr = [], lookup, type; // Check if we are being passed a key/function object or an array of functions if (def instanceof Array) { // We were passed an array of functions count = def.length; for (index = 0; index < count; index++) { if (def[index].length === arguments.length) { return self.callExtend(this, '$main', def, def[index], arguments); } } } else { // Generate lookup key from arguments // Copy arguments to an array for (index = 0; index < arguments.length; index++) { type = typeof arguments[index]; // Handle detecting arrays if (type === 'object' && arguments[index] instanceof Array) { type = 'array'; } // Handle been presented with a single undefined argument if (arguments.length === 1 && type === 'undefined') { break; } // Add the type to the argument types array arr.push(type); } lookup = arr.join(','); // Check for an exact lookup match if (def[lookup]) { return self.callExtend(this, '$main', def, def[lookup], arguments); } else { for (index = arr.length; index >= 0; index--) { // Get the closest match lookup = arr.slice(0, index).join(','); if (def[lookup + ',...']) { // Matched against arguments + "any other" return self.callExtend(this, '$main', def, def[lookup + ',...'], arguments); } } } } throw('ForerunnerDB.Overload "' + this.name() + '": Overloaded method does not have a matching signature for the passed arguments: ' + JSON.stringify(arr)); }; } return function () {}; }; /** * Generates an array of all the different definition signatures that can be * created from the passed string with a catch-all wildcard *. E.g. it will * convert the signature: string,*,string to all potentials: * string,string,string * string,number,string * string,object,string, * string,function,string, * string,undefined,string * * @param {String} str Signature string with a wildcard in it. * @returns {Array} An array of signature strings that are generated. */ Overload.prototype.generateSignaturePermutations = function (str) { var signatures = [], newSignature, types = ['string', 'object', 'number', 'function', 'undefined'], index; if (str.indexOf('*') > -1) { // There is at least one "any" type, break out into multiple keys // We could do this at query time with regular expressions but // would be significantly slower for (index = 0; index < types.length; index++) { newSignature = str.replace('*', types[index]); signatures = signatures.concat(this.generateSignaturePermutations(newSignature)); } } else { signatures.push(str); } return signatures; }; Overload.prototype.callExtend = function (context, prop, propContext, func, args) { var tmp, ret; if (context && propContext[prop]) { tmp = context[prop]; context[prop] = propContext[prop]; ret = func.apply(context, args); context[prop] = tmp; return ret; } else { return func.apply(context, args); } }; module.exports = Overload; },{}],21:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'); /** * Path object used to resolve object paths and retrieve data from * objects by using paths. * @param {String=} path The path to assign. * @constructor */ var Path = function (path) { this.init.apply(this, arguments); }; Path.prototype.init = function (path) { if (path) { this.path(path); } }; Shared.addModule('Path', Path); Shared.mixin(Path.prototype, 'Mixin.ChainReactor'); /** * Gets / sets the given path for the Path instance. * @param {String=} path The path to assign. */ Path.prototype.path = function (path) { if (path !== undefined) { this._path = this.clean(path); this._pathParts = this._path.split('.'); return this; } return this._path; }; /** * Tests if the passed object has the paths that are specified and that * a value exists in those paths. * @param {Object} testKeys The object describing the paths to test for. * @param {Object} testObj The object to test paths against. * @returns {Boolean} True if the object paths exist. */ Path.prototype.hasObjectPaths = function (testKeys, testObj) { var result = true, i; for (i in testKeys) { if (testKeys.hasOwnProperty(i)) { if (testObj[i] === undefined) { return false; } if (typeof testKeys[i] === 'object') { // Recurse object result = this.hasObjectPaths(testKeys[i], testObj[i]); // Should we exit early? if (!result) { return false; } } } } return result; }; /** * Counts the total number of key endpoints in the passed object. * @param {Object} testObj The object to count key endpoints for. * @returns {Number} The number of endpoints. */ Path.prototype.countKeys = function (testObj) { var totalKeys = 0, i; for (i in testObj) { if (testObj.hasOwnProperty(i)) { if (testObj[i] !== undefined) { if (typeof testObj[i] !== 'object') { totalKeys++; } else { totalKeys += this.countKeys(testObj[i]); } } } } return totalKeys; }; /** * Tests if the passed object has the paths that are specified and that * a value exists in those paths and if so returns the number matched. * @param {Object} testKeys The object describing the paths to test for. * @param {Object} testObj The object to test paths against. * @returns {Object} Stats on the matched keys */ Path.prototype.countObjectPaths = function (testKeys, testObj) { var matchData, matchedKeys = {}, matchedKeyCount = 0, totalKeyCount = 0, i; for (i in testObj) { if (testObj.hasOwnProperty(i)) { if (typeof testObj[i] === 'object') { // The test / query object key is an object, recurse matchData = this.countObjectPaths(testKeys[i], testObj[i]); matchedKeys[i] = matchData.matchedKeys; totalKeyCount += matchData.totalKeyCount; matchedKeyCount += matchData.matchedKeyCount; } else { // The test / query object has a property that is not an object so add it as a key totalKeyCount++; // Check if the test keys also have this key and it is also not an object if (testKeys && testKeys[i] && typeof testKeys[i] !== 'object') { matchedKeys[i] = true; matchedKeyCount++; } else { matchedKeys[i] = false; } } } } return { matchedKeys: matchedKeys, matchedKeyCount: matchedKeyCount, totalKeyCount: totalKeyCount }; }; /** * Takes a non-recursive object and converts the object hierarchy into * a path string. * @param {Object} obj The object to parse. * @param {Boolean=} withValue If true will include a 'value' key in the returned * object that represents the value the object path points to. * @returns {Object} */ Path.prototype.parse = function (obj, withValue) { var paths = [], path = '', resultData, i, k; for (i in obj) { if (obj.hasOwnProperty(i)) { // Set the path to the key path = i; if (typeof(obj[i]) === 'object') { if (withValue) { resultData = this.parse(obj[i], withValue); for (k = 0; k < resultData.length; k++) { paths.push({ path: path + '.' + resultData[k].path, value: resultData[k].value }); } } else { resultData = this.parse(obj[i]); for (k = 0; k < resultData.length; k++) { paths.push({ path: path + '.' + resultData[k].path }); } } } else { if (withValue) { paths.push({ path: path, value: obj[i] }); } else { paths.push({ path: path }); } } } } return paths; }; /** * Takes a non-recursive object and converts the object hierarchy into * an array of path strings that allow you to target all possible paths * in an object. * * @returns {Array} */ Path.prototype.parseArr = function (obj, options) { options = options || {}; return this._parseArr(obj, '', [], options); }; Path.prototype._parseArr = function (obj, path, paths, options) { var i, newPath = ''; path = path || ''; paths = paths || []; for (i in obj) { if (obj.hasOwnProperty(i)) { if (!options.ignore || (options.ignore && !options.ignore.test(i))) { if (path) { newPath = path + '.' + i; } else { newPath = i; } if (typeof(obj[i]) === 'object') { this._parseArr(obj[i], newPath, paths, options); } else { paths.push(newPath); } } } } return paths; }; /** * Gets the value(s) that the object contains for the currently assigned path string. * @param {Object} obj The object to evaluate the path against. * @param {String=} path A path to use instead of the existing one passed in path(). * @returns {Array} An array of values for the given path. */ Path.prototype.value = function (obj, path) { if (obj !== undefined && typeof obj === 'object') { var pathParts, arr, arrCount, objPart, objPartParent, valuesArr = [], i, k; if (path !== undefined) { path = this.clean(path); pathParts = path.split('.'); } arr = pathParts || this._pathParts; arrCount = arr.length; objPart = obj; for (i = 0; i < arrCount; i++) { objPart = objPart[arr[i]]; if (objPartParent instanceof Array) { // Search inside the array for the next key for (k = 0; k < objPartParent.length; k++) { valuesArr = valuesArr.concat(this.value(objPartParent, k + '.' + arr[i])); } return valuesArr; } else { if (!objPart || typeof(objPart) !== 'object') { break; } } objPartParent = objPart; } return [objPart]; } else { return []; } }; /** * Sets a value on an object for the specified path. * @param {Object} obj The object to update. * @param {String} path The path to update. * @param {*} val The value to set the object path to. * @returns {*} */ Path.prototype.set = function (obj, path, val) { if (obj !== undefined && path !== undefined) { var pathParts, part; path = this.clean(path); pathParts = path.split('.'); part = pathParts.shift(); if (pathParts.length) { // Generate the path part in the object if it does not already exist obj[part] = obj[part] || {}; // Recurse this.set(obj[part], pathParts.join('.'), val); } else { // Set the value obj[part] = val; } } return obj; }; Path.prototype.get = function (obj, path) { return this.value(obj, path)[0]; }; /** * Push a value to an array on an object for the specified path. * @param {Object} obj The object to update. * @param {String} path The path to the array to push to. * @param {*} val The value to push to the array at the object path. * @returns {*} */ Path.prototype.push = function (obj, path, val) { if (obj !== undefined && path !== undefined) { var pathParts, part; path = this.clean(path); pathParts = path.split('.'); part = pathParts.shift(); if (pathParts.length) { // Generate the path part in the object if it does not already exist obj[part] = obj[part] || {}; // Recurse this.set(obj[part], pathParts.join('.'), val); } else { // Set the value obj[part] = obj[part] || []; if (obj[part] instanceof Array) { obj[part].push(val); } else { throw('ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!'); } } } return obj; }; /** * Gets the value(s) that the object contains for the currently assigned path string * with their associated keys. * @param {Object} obj The object to evaluate the path against. * @param {String=} path A path to use instead of the existing one passed in path(). * @returns {Array} An array of values for the given path with the associated key. */ Path.prototype.keyValue = function (obj, path) { var pathParts, arr, arrCount, objPart, objPartParent, objPartHash, i; if (path !== undefined) { path = this.clean(path); pathParts = path.split('.'); } arr = pathParts || this._pathParts; arrCount = arr.length; objPart = obj; for (i = 0; i < arrCount; i++) { objPart = objPart[arr[i]]; if (!objPart || typeof(objPart) !== 'object') { objPartHash = arr[i] + ':' + objPart; break; } objPartParent = objPart; } return objPartHash; }; /** * Removes leading period (.) from string and returns it. * @param {String} str The string to clean. * @returns {*} */ Path.prototype.clean = function (str) { if (str.substr(0, 1) === '.') { str = str.substr(1, str.length -1); } return str; }; Shared.finishModule('Path'); module.exports = Path; },{"./Shared":23}],22:[function(_dereq_,module,exports){ "use strict"; var Shared = _dereq_('./Shared'); var ReactorIO = function (reactorIn, reactorOut, reactorProcess) { if (reactorIn && reactorOut && reactorProcess) { this._reactorIn = reactorIn; this._reactorOut = reactorOut; this._chainHandler = reactorProcess; if (!reactorIn.chain || !reactorOut.chainReceive) { throw('ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!'); } // Register the reactorIO with the input reactorIn.chain(this); // Register the output with the reactorIO this.chain(reactorOut); } else { throw('ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!'); } }; Shared.addModule('ReactorIO', ReactorIO); ReactorIO.prototype.drop = function () { if (this._state !== 'dropped') { this._state = 'dropped'; // Remove links if (this._reactorIn) { this._reactorIn.unChain(this); } if (this._reactorOut) { this.unChain(this._reactorOut); } delete this._reactorIn; delete this._reactorOut; delete this._chainHandler; this.emit('drop', this); } return true; }; /** * Gets / sets the current state. * @param {String=} val The name of the state to set. * @returns {*} */ Shared.synthesize(ReactorIO.prototype, 'state'); Shared.mixin(ReactorIO.prototype, 'Mixin.ChainReactor'); Shared.mixin(ReactorIO.prototype, 'Mixin.Events'); Shared.finishModule('ReactorIO'); module.exports = ReactorIO; },{"./Shared":23}],23:[function(_dereq_,module,exports){ "use strict"; /** * A shared object that can be used to store arbitrary data between class * instances, and access helper methods. * @mixin */ var Shared = { version: '1.3.52', modules: {}, _synth: {}, /** * Adds a module to ForerunnerDB. * @memberof Shared * @param {String} name The name of the module. * @param {Function} module The module class. */ addModule: function (name, module) { this.modules[name] = module; this.emit('moduleLoad', [name, module]); }, /** * Called by the module once all processing has been completed. Used to determine * if the module is ready for use by other modules. * @memberof Shared * @param {String} name The name of the module. */ finishModule: function (name) { if (this.modules[name]) { this.modules[name]._fdbFinished = true; this.emit('moduleFinished', [name, this.modules[name]]); } else { throw('ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): ' + name); } }, /** * Will call your callback method when the specified module has loaded. If the module * is already loaded the callback is called immediately. * @memberof Shared * @param {String} name The name of the module. * @param {Function} callback The callback method to call when the module is loaded. */ moduleFinished: function (name, callback) { if (this.modules[name] && this.modules[name]._fdbFinished) { if (callback) { callback(name, this.modules[name]); } } else { this.on('moduleFinished', callback); } }, /** * Determines if a module has been added to ForerunnerDB or not. * @memberof Shared * @param {String} name The name of the module. * @returns {Boolean} True if the module exists or false if not. */ moduleExists: function (name) { return Boolean(this.modules[name]); }, /** * Adds the properties and methods defined in the mixin to the passed object. * @memberof Shared * @param {Object} obj The target object to add mixin key/values to. * @param {String} mixinName The name of the mixin to add to the object. */ mixin: function (obj, mixinName) { var system = this.mixins[mixinName]; if (system) { for (var i in system) { if (system.hasOwnProperty(i)) { obj[i] = system[i]; } } } else { throw('ForerunnerDB.Shared: Cannot find mixin named: ' + mixinName); } }, /** * Generates a generic getter/setter method for the passed method name. * @memberof Shared * @param {Object} obj The object to add the getter/setter to. * @param {String} name The name of the getter/setter to generate. * @param {Function=} extend A method to call before executing the getter/setter. * The existing getter/setter can be accessed from the extend method via the * $super e.g. this.$super(); */ synthesize: function (obj, name, extend) { this._synth[name] = this._synth[name] || function (val) { if (val !== undefined) { this['_' + name] = val; return this; } return this['_' + name]; }; if (extend) { var self = this; obj[name] = function () { var tmp = this.$super, ret; this.$super = self._synth[name]; ret = extend.apply(this, arguments); this.$super = tmp; return ret; }; } else { obj[name] = this._synth[name]; } }, /** * Allows a method to be overloaded. * @memberof Shared * @param arr * @returns {Function} * @constructor */ overload: _dereq_('./Overload'), /** * Define the mixins that other modules can use as required. * @memberof Shared */ mixins: { 'Mixin.Common': _dereq_('./Mixin.Common'), 'Mixin.Events': _dereq_('./Mixin.Events'), 'Mixin.ChainReactor': _dereq_('./Mixin.ChainReactor'), 'Mixin.CRUD': _dereq_('./Mixin.CRUD'), 'Mixin.Constants': _dereq_('./Mixin.Constants'), 'Mixin.Triggers': _dereq_('./Mixin.Triggers'), 'Mixin.Sorting': _dereq_('./Mixin.Sorting'), 'Mixin.Matching': _dereq_('./Mixin.Matching'), 'Mixin.Updating': _dereq_('./Mixin.Updating') } }; // Add event handling to shared Shared.mixin(Shared, 'Mixin.Events'); module.exports = Shared; },{"./Mixin.CRUD":10,"./Mixin.ChainReactor":11,"./Mixin.Common":12,"./Mixin.Constants":13,"./Mixin.Events":14,"./Mixin.Matching":15,"./Mixin.Sorting":16,"./Mixin.Triggers":17,"./Mixin.Updating":18,"./Overload":20}],24:[function(_dereq_,module,exports){ /* jshint strict:false */ if (!Array.prototype.filter) { Array.prototype.filter = function(fun/*, thisArg*/) { if (this === void 0 || this === null) { throw new TypeError(); } var t = Object(this); var len = t.length >>> 0; // jshint ignore:line if (typeof fun !== 'function') { throw new TypeError(); } var res = []; var thisArg = arguments.length >= 2 ? arguments[1] : void 0; for (var i = 0; i < len; i++) { if (i in t) { var val = t[i]; // NOTE: Technically this should Object.defineProperty at // the next index, as push can be affected by // properties on Object.prototype and Array.prototype. // But that method's new, and collisions should be // rare, so use the more-compatible alternative. if (fun.call(thisArg, val, i, t)) { res.push(val); } } } return res; }; } if (typeof Object.create !== 'function') { Object.create = (function() { var Temp = function() {}; return function (prototype) { if (arguments.length > 1) { throw Error('Second argument not supported'); } if (typeof prototype !== 'object') { throw TypeError('Argument must be an object'); } Temp.prototype = prototype; var result = new Temp(); Temp.prototype = null; return result; }; })(); } // Production steps of ECMA-262, Edition 5, 15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14e if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(searchElement, fromIndex) { var k; // 1. Let O be the result of calling ToObject passing // the this value as the argument. if (this === null) { throw new TypeError('"this" is null or not defined'); } var O = Object(this); // 2. Let lenValue be the result of calling the Get // internal method of O with the argument "length". // 3. Let len be ToUint32(lenValue). var len = O.length >>> 0; // jshint ignore:line // 4. If len is 0, return -1. if (len === 0) { return -1; } // 5. If argument fromIndex was passed let n be // ToInteger(fromIndex); else let n be 0. var n = +fromIndex || 0; if (Math.abs(n) === Infinity) { n = 0; } // 6. If n >= len, return -1. if (n >= len) { return -1; } // 7. If n >= 0, then Let k be n. // 8. Else, n<0, Let k be len - abs(n). // If k is less than 0, then let k be 0. k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); // 9. Repeat, while k < len while (k < len) { // a. Let Pk be ToString(k). // This is implicit for LHS operands of the in operator // b. Let kPresent be the result of calling the // HasProperty internal method of O with argument Pk. // This step can be combined with c // c. If kPresent is true, then // i. Let elementK be the result of calling the Get // internal method of O with the argument ToString(k). // ii. Let same be the result of applying the // Strict Equality Comparison Algorithm to // searchElement and elementK. // iii. If same is true, return k. if (k in O && O[k] === searchElement) { return k; } k++; } return -1; }; } module.exports = {}; },{}]},{},[1]);
docs/src/app/components/pages/components/IconButton/ExampleTooltip.js
manchesergit/material-ui
import React from 'react'; import IconButton from 'material-ui/IconButton'; const IconButtonExampleTooltip = () => ( <div> <IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-right" tooltipPosition="bottom-right" /> <IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-center" tooltipPosition="bottom-center" /> <IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-left" tooltipPosition="bottom-left" /> <IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-right" tooltipPosition="top-right" /> <IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-center" tooltipPosition="top-center" /> <IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-left" tooltipPosition="top-left" /> </div> ); export default IconButtonExampleTooltip;
node_modules/react-icons/ti/plug.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const TiPlug = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m20 29.2c-6.4 0-11.7-5.3-11.7-11.7h3.4c0 4.6 3.7 8.3 8.3 8.3s8.3-3.7 8.3-8.3h3.4c0 6.4-5.3 11.7-11.7 11.7z m10-9.2c-0.9 0-1.7-0.7-1.7-1.7v-5h-16.6v5c0 1-0.8 1.7-1.7 1.7s-1.7-0.7-1.7-1.7v-6.6c0-1 0.8-1.7 1.7-1.7h20c0.9 0 1.7 0.7 1.7 1.7v6.6c0 1-0.8 1.7-1.7 1.7z m-13.3-15v5h-3.4v-5h3.4z m0-1.7h-3.4c-0.9 0-1.6 0.8-1.6 1.7v5c0 0.9 0.7 1.7 1.6 1.7h3.4c0.9 0 1.6-0.8 1.6-1.7v-5c0-0.9-0.7-1.7-1.6-1.7z m5 25.9v4.1h-3.4v-4.1h3.4z m0-3.4h-3.4c-1.8 0-3.3 1.5-3.3 3.4v4.1c0 1.9 1.5 3.4 3.3 3.4h3.4c1.8 0 3.3-1.5 3.3-3.4v-4.1c0-1.9-1.5-3.4-3.3-3.4z m5-20.8v5h-3.4v-5h3.4z m0-1.7h-3.4c-0.9 0-1.6 0.8-1.6 1.7v5c0 0.9 0.7 1.7 1.6 1.7h3.4c0.9 0 1.6-0.8 1.6-1.7v-5c0-0.9-0.7-1.7-1.6-1.7z m3.3 16.7h-20c-0.5 0-0.8-0.4-0.8-0.8s0.3-0.9 0.8-0.9h20c0.5 0 0.8 0.4 0.8 0.9s-0.3 0.8-0.8 0.8z m-10 7.5c-0.6 0-1.1-0.1-1.7-0.2v2.7h3.4v-2.7c-0.6 0.1-1.1 0.2-1.7 0.2z m-5-0.8h1.7v3.3h-1.7v-3.3z m8.3 0h1.7v3.3h-1.7v-3.3z"/></g> </Icon> ) export default TiPlug
javascript/components/FillLayer.js
bsudekum/react-native-mapbox-gl
import React from 'react'; import PropTypes from 'prop-types'; import {NativeModules, requireNativeComponent} from 'react-native'; import {viewPropTypes} from '../utils'; import {FillLayerStyleProp} from '../utils/styleMap'; import AbstractLayer from './AbstractLayer'; const MapboxGL = NativeModules.MGLModule; export const NATIVE_MODULE_NAME = 'RCTMGLFillLayer'; /** * FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map. */ class FillLayer extends AbstractLayer { static propTypes = { ...viewPropTypes, /** * A string that uniquely identifies the source in the style to which it is added. */ id: PropTypes.string, /** * The source from which to obtain the data to style. If the source has not yet been added to the current style, the behavior is undefined. */ sourceID: PropTypes.string, /** * Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style. */ sourceLayerID: PropTypes.string, /** * Inserts a layer above aboveLayerID. */ aboveLayerID: PropTypes.string, /** * Inserts a layer below belowLayerID */ belowLayerID: PropTypes.string, /** * Inserts a layer at a specified index */ layerIndex: PropTypes.number, /** * Filter only the features in the source layer that satisfy a condition that you define */ filter: PropTypes.array, /** * The minimum zoom level at which the layer gets parsed and appears. */ minZoomLevel: PropTypes.number, /** * The maximum zoom level at which the layer gets parsed and appears. */ maxZoomLevel: PropTypes.number, /** * Customizable style attributes */ style: PropTypes.oneOfType([ FillLayerStyleProp, PropTypes.arrayOf(FillLayerStyleProp), ]), }; static defaultProps = { sourceID: MapboxGL.StyleSource.DefaultSourceID, }; render() { const props = { ...this.baseProps, sourceLayerID: this.props.sourceLayerID, }; return <RCTMGLFillLayer {...props} />; } } const RCTMGLFillLayer = requireNativeComponent(NATIVE_MODULE_NAME, FillLayer, { nativeOnly: {reactStyle: true}, }); export default FillLayer;
src/main/webapp/js/parallel-coordinates-master/lib/slickgrid/jquery-1.7.min.js
yiducn/h7n9vis
/*! jQuery v1.7 jquery.com | jquery.org/license */ (function(a,b){function cA(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cx(a){if(!cm[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cn||(cn=c.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),b.appendChild(cn);if(!co||!cn.createElement)co=(cn.contentWindow||cn.contentDocument).document,co.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),co.close();d=co.createElement(a),co.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cn)}cm[a]=e}return cm[a]}function cw(a,b){var c={};f.each(cs.concat.apply([],cs.slice(0,b)),function(){c[this]=a});return c}function cv(){ct=b}function cu(){setTimeout(cv,0);return ct=f.now()}function cl(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ck(){try{return new a.XMLHttpRequest}catch(b){}}function ce(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cd(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function cc(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bG.test(a)?d(a,e):cc(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)cc(a+"["+e+"]",b[e],c,d);else d(a,b)}function cb(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function ca(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bV,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=ca(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=ca(a,c,d,e,"*",g));return l}function b_(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bR),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bE(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bz:bA;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bB(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function br(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bi,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bq(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bp(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bp)}function bp(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bo(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bn(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bm(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bl(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a){var b=Y.split(" "),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(){return!0}function M(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.add(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;B.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return a!=null&&m.test(a)&&!isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:H?function(a){return a==null?"":H.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(I)return I.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())}),typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return e});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){return i.done.apply(i,arguments).fail.apply(i,arguments)},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>";m=c.getElementsByTagName("body")[0];!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h))}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}return b}e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g},removeAttr:function(a,b){var c,d,e,g,h=0;if(a.nodeType===1){d=(b||"").split(p),g=d.length;for(;h<g;h++)e=d[h].toLowerCase(),c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1)}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return b;h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){var b=I.exec(a);b&& (b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},K=function(a,b){return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className))},L=function(a){return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=L(c).split(" ");for(k=0;k<c.length;k++){l=E.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,namespace:n.join(".")},p),g&&(o.quick=J(g),!o.quick&&f.expr.match.POS.test(g)&&(o.isPositional=!0)),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d){var e=f.hasData(a)&&f._data(a),g,h,i,j,k,l,m,n,o,p,q;if(!!e&&!!(m=e.events)){b=L(b||"").split(" ");for(g=0;g<b.length;g++){h=E.exec(b[g])||[],i=h[1],j=h[2];if(!i){j=j?"."+j:"";for(l in m)f.event.remove(a,l+j,c,d);return}n=f.event.special[i]||{},i=(d?n.delegateType:n.bindType)||i,p=m[i]||[],k=p.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;if(c||j||d||n.remove)for(l=0;l<p.length;l++){q=p[l];if(!c||c.guid===q.guid)if(!j||j.test(q.namespace))if(!d||d===q.selector||d==="**"&&q.selector)p.splice(l--,1),q.selector&&p.delegateCount--,n.remove&&n.remove.call(a,q)}else p.length=0;p.length===0&&k!==p.length&&((!n.teardown||n.teardown.call(a,j)===!1)&&f.removeEvent(a,i,e.handle),delete m[i])}f.isEmptyObject(m)&&(o=e.handle,o&&(o.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,n=null;for(m=e.parentNode;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length;l++){m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d);if(c.isPropagationStopped())break}c.type=h,c.isDefaultPrevented()||(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=(f.event.special[c.type]||{}).handle,j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click"))for(m=c.target;m!=this;m=m.parentNode||this){o={},q=[];for(k=0;k<e;k++)r=d[k],s=r.selector,t=o[s],r.isPositional?t=(t||(o[s]=f(s))).index(m)>=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);q.length&&j.push({elem:m,matches:q})}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){p=j[k],c.currentTarget=p.elem;for(l=0;l<p.matches.length&&!c.isImmediatePropagationStopped();l++){r=p.matches[l];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=(i||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement 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){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},focus:{delegateType:"focusin",noBubble:!0},blur:{delegateType:"focusout",noBubble:!0},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?N:M):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=N;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=N;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=N,this.stopPropagation()},isDefaultPrevented:M,isPropagationStopped:M,isImmediatePropagationStopped:M},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]=f.event.special[b]={delegateType:b,bindType:b,handle:function(a){var b=this,c=a.relatedTarget,d=a.handleObj,e=d.selector,g,h;if(!c||d.origType===a.type||c!==b&&!f.contains(b,c))g=a.type,a.type=d.origType,h=d.handler.apply(this,arguments),a.type=g;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(A.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;A.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return A.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=M;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=M);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw"Syntax error, unrecognized expression: "+a};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?T.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/<tbody/i,bc=/<|&#?\w+;/,bd=/<(?:script|style)/i,be=/<(?:script|object|embed|option|style)/i,bf=new RegExp("<(?:"+Y.replace(" ","|")+")","i"),bg=/checked\s*(?:[^=]|=\s*.checked.)/i,bh=/\/(java|ecma)script/i,bi=/^\s*<!(?:\[CDATA\[|\-\-)/,bj={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bk=X(c);bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after" ,arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(_,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bg.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bl(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,br)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!be.test(j)&&(f.support.checkClone||!bg.test(j))&&!f.support.unknownElems&&bf.test(j)&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bn(a,d),e=bo(a),g=bo(d);for(h=0;e[h];++h)g[h]&&bn(e[h],g[h])}if(b){bm(a,d);if(c){e=bo(a),g=bo(d);for(h=0;e[h];++h)bm(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bc.test(k))k=b.createTextNode(k);else{k=k.replace(_,"<$1></$2>");var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bq(k[i]);else bq(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bh.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bs=/alpha\([^)]*\)/i,bt=/opacity=([^)]*)/,bu=/([A-Z]|^ms)/g,bv=/^-?\d+(?:px)?$/i,bw=/^-?\d/,bx=/^([\-+])=([\-+.\de]+)/,by={position:"absolute",visibility:"hidden",display:"block"},bz=["Left","Right"],bA=["Top","Bottom"],bB,bC,bD;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bB(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bx.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bB)return bB(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bE(a,b,d);f.swap(a,by,function(){e=bE(a,b,d)});return e}},set:function(a,b){if(!bv.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bs,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bs.test(g)?g.replace(bs,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){var d,e,g;c=c.replace(bu,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bD=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];try{bX=e.href}catch(b$){bX=c.createElement("a"),bX.href="",bX=bX.href}bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bU)return bU.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bH,"\r\n")}}):{name:b.name,value:c.replace(bH,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);return a},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=ce(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bJ.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bS,"$1_="+x);d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=ca(bW,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)cc(g,a[g],c,e);return d.join("&").replace(bF,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cf++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ch=a.ActiveXObject?function(){for(var a in cj)cj[a](0,1)}:!1,ci=0,cj;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ck()||cl()}:ck,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cw("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cx(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cw("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cw("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cx(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cp.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=cq.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cw("show",1),slideUp:cw("hide",1),slideToggle:cw("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=ct||cu(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cr&&(cr=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=ct||cu(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cr),cr=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now))}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cy=/^t(?:able|d|h)$/i,cz=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cA(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cy.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cA(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
src/views/home.js
depcheck/depcheck-www
import React from 'react'; import Layout from './layout'; import Navbar from './navbar'; const Introduction = () => ( <p> Depcheck looks at your project files and scans your code to find any unused dependencies. Get rid of useless dependencies, and ship clean package. </p> ); const Logo = () => ( <img src="/assets/logo-480.jpg" className="img-responsive center-block" alt="Depcheck Logo" /> ); const Login = () => ( <a className="btn btn-default" href="/login/github"> Login with GitHub Account </a> ); const Welcome = ({ login, repoListUrl }) => ( <a className="btn btn-default" href={repoListUrl}> Logged in as <mark>{login.provider}/{login.user}</mark> </a> ); export default React.createClass({ render() { return ( <Layout> <h1 className="text-center">Depcheck</h1> <div className="row"> <div className="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2"> <Introduction /> <p className="text-center"> {this.props.login ? <Welcome {...this.props} /> : <Login />} </p> <Navbar {...this.props} /> </div> </div> <Logo /> </Layout> ); }, });
src/components/GameSelector.js
RolandJansen/basemod
import React, { Component } from 'react'; import { ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; /** * */ class GameChooser extends Component { constructor(props) { super(props); this.state = { dropdownOpen: false, selected: 'Choose Game' }; this.toggle = this.toggle.bind(this) this.select = this.select.bind(this) } toggle() { this.setState({ dropdownOpen: !this.state.dropdownOpen }) } select(e) { this.setState({ selected: e.target.innerText }) this.props.onGameSelect(e.target.innerText) } render() { return ( <ButtonDropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}> <DropdownToggle caret> { this.state.selected } </DropdownToggle> <DropdownMenu> { this.props.games.map(game => ( <DropdownItem key={game.id} onClick={this.select}>{game.name}</DropdownItem> ))} </DropdownMenu> </ButtonDropdown> ); } } export default GameChooser;
src/components/FormSelect/FormSelect.js
Landish/react-spectre-css
import React, { Component } from 'react'; import { array, shapeOf, string, func } from 'prop-types'; import classNames from 'classnames'; class FormSelect extends Component { constructor() { super(); } static propTypes = { /** * Array of objects. */ options: array, /** * Called when the user attempts to change the value. * * `onChange(event: SyntheticEvent, data: object)` * * @param {SyntheticEvent} event - React's original SyntheticEvent. * @param {object} data - All props and proposed value. */ onChange: func, /** Additional classes. */ className: string, /** * Value of currently selected option. */ selected: string }; defaultProps = { selected: '', onChange: (value, label) => {} }; state = { selected: '' }; componentWillMount() { if (this.props.selected) { this.setState({ selected: this.props.selected }); } } handleChange = e => { const select = e.target; const value = select.value; this.setState({ selected: value }); this.props.onChange.call(value, select); }; render() { return ( <select className={classNames('form-select', this.props.className)} multiple={this.props.multiple} onChange={this.handleChange} value={this.state.selected} > {this.props.options.map(option => { return ( <option value={option.value} key={option.value}> {option.label} </option> ); })} </select> ); } } //const FormSelect = ({ // options, // selected, // name, // multiple, // onChange, // className, // ...rest //}) => { // return ( // <select // name={name} // className={classNames('form-select', className)} // {...rest} // multiple={multiple} // onChange={onChange} // value={selected} // > // {options.map((option) => { // return( // <option defaultValue={option.value} key={option.value}>{option.label}</option> // ) // })} // </select> // ); //}; /** * FormSelect property types. */ //FormSelect.propTypes = { // name: string, // options: array, // onChange: func, // className: string //}; // ///** // * FormSelect default properties. // */ //FormSelect.defaultProps = { // options: [], // selected: '', //}; export default FormSelect;
packages/showcase/misc/selection-plot-example.js
uber/react-vis
// Copyright (c) 2016 - 2017 Uber Technologies, Inc. // // 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. import React from 'react'; import { XYPlot, XAxis, YAxis, VerticalGridLines, HorizontalGridLines, MarkSeries, Highlight } from 'react-vis'; import {generateSeededRandom} from '../showcase-utils'; const seededRandom = generateSeededRandom(36); // randomly generated data const data = [...new Array(10)].map(() => ({ x: seededRandom() * 3, y: seededRandom() * 11 + 4, size: seededRandom() * 30 + 1 })); export default class SelectionPlotExample extends React.Component { state = { filter: null }; render() { const {filter} = this.state; const highlightPoint = d => { if (!filter) { return false; } return d.y <= filter.top && d.y >= filter.bottom; }; const numSelectedPoints = filter ? data.filter(highlightPoint).length : 0; return ( <div> <XYPlot width={300} height={300}> <VerticalGridLines /> <HorizontalGridLines /> <XAxis /> <YAxis /> <MarkSeries className="mark-series-example" sizeRange={[5, 15]} colorType="literal" getColor={d => (highlightPoint(d) ? '#EF5D28' : '#12939A')} data={data} /> <Highlight enableX={false} className="selection-example" onBrush={area => this.setState({filter: area})} onBrushEnd={area => this.setState({filter: area})} /> </XYPlot> <p>{`There are ${numSelectedPoints} selected points`}</p> </div> ); } }
app/javascript/mastodon/features/video/index.js
dwango/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { fromJS } from 'immutable'; import { throttle } from 'lodash'; import classNames from 'classnames'; import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen'; import { displayMedia } from '../../initial_state'; const messages = defineMessages({ play: { id: 'video.play', defaultMessage: 'Play' }, pause: { id: 'video.pause', defaultMessage: 'Pause' }, mute: { id: 'video.mute', defaultMessage: 'Mute sound' }, unmute: { id: 'video.unmute', defaultMessage: 'Unmute sound' }, hide: { id: 'video.hide', defaultMessage: 'Hide video' }, expand: { id: 'video.expand', defaultMessage: 'Expand video' }, close: { id: 'video.close', defaultMessage: 'Close video' }, fullscreen: { id: 'video.fullscreen', defaultMessage: 'Full screen' }, exit_fullscreen: { id: 'video.exit_fullscreen', defaultMessage: 'Exit full screen' }, }); const formatTime = secondsNum => { let hours = Math.floor(secondsNum / 3600); let minutes = Math.floor((secondsNum - (hours * 3600)) / 60); let seconds = secondsNum - (hours * 3600) - (minutes * 60); if (hours < 10) hours = '0' + hours; if (minutes < 10) minutes = '0' + minutes; if (seconds < 10) seconds = '0' + seconds; return (hours === '00' ? '' : `${hours}:`) + `${minutes}:${seconds}`; }; export const findElementPosition = el => { let box; if (el.getBoundingClientRect && el.parentNode) { box = el.getBoundingClientRect(); } if (!box) { return { left: 0, top: 0, }; } const docEl = document.documentElement; const body = document.body; const clientLeft = docEl.clientLeft || body.clientLeft || 0; const scrollLeft = window.pageXOffset || body.scrollLeft; const left = (box.left + scrollLeft) - clientLeft; const clientTop = docEl.clientTop || body.clientTop || 0; const scrollTop = window.pageYOffset || body.scrollTop; const top = (box.top + scrollTop) - clientTop; return { left: Math.round(left), top: Math.round(top), }; }; export const getPointerPosition = (el, event) => { const position = {}; const box = findElementPosition(el); const boxW = el.offsetWidth; const boxH = el.offsetHeight; const boxY = box.top; const boxX = box.left; let pageY = event.pageY; let pageX = event.pageX; if (event.changedTouches) { pageX = event.changedTouches[0].pageX; pageY = event.changedTouches[0].pageY; } position.y = Math.max(0, Math.min(1, (pageY - boxY) / boxH)); position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW)); return position; }; export default @injectIntl class Video extends React.PureComponent { static propTypes = { preview: PropTypes.string, src: PropTypes.string.isRequired, alt: PropTypes.string, width: PropTypes.number, height: PropTypes.number, sensitive: PropTypes.bool, startTime: PropTypes.number, onOpenVideo: PropTypes.func, onCloseVideo: PropTypes.func, detailed: PropTypes.bool, inline: PropTypes.bool, intl: PropTypes.object.isRequired, }; state = { currentTime: 0, duration: 0, paused: true, dragging: false, containerWidth: false, fullscreen: false, hovered: false, muted: false, revealed: displayMedia !== 'hide_all' && !this.props.sensitive || displayMedia === 'show_all', }; setPlayerRef = c => { this.player = c; if (c) { this.setState({ containerWidth: c.offsetWidth, }); } } setVideoRef = c => { this.video = c; } setSeekRef = c => { this.seek = c; } handleClickRoot = e => e.stopPropagation(); handlePlay = () => { this.setState({ paused: false }); } handlePause = () => { this.setState({ paused: true }); } handleTimeUpdate = () => { this.setState({ currentTime: Math.floor(this.video.currentTime), duration: Math.floor(this.video.duration), }); } handleMouseDown = e => { document.addEventListener('mousemove', this.handleMouseMove, true); document.addEventListener('mouseup', this.handleMouseUp, true); document.addEventListener('touchmove', this.handleMouseMove, true); document.addEventListener('touchend', this.handleMouseUp, true); this.setState({ dragging: true }); this.video.pause(); this.handleMouseMove(e); e.preventDefault(); e.stopPropagation(); } handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove, true); document.removeEventListener('mouseup', this.handleMouseUp, true); document.removeEventListener('touchmove', this.handleMouseMove, true); document.removeEventListener('touchend', this.handleMouseUp, true); this.setState({ dragging: false }); this.video.play(); } handleMouseMove = throttle(e => { const { x } = getPointerPosition(this.seek, e); const currentTime = Math.floor(this.video.duration * x); if (!isNaN(currentTime)) { this.video.currentTime = currentTime; this.setState({ currentTime }); } }, 60); togglePlay = () => { if (this.state.paused) { this.video.play(); } else { this.video.pause(); } } toggleFullscreen = () => { if (isFullscreen()) { exitFullscreen(); } else { requestFullscreen(this.player); } } componentDidMount () { document.addEventListener('fullscreenchange', this.handleFullscreenChange, true); document.addEventListener('webkitfullscreenchange', this.handleFullscreenChange, true); document.addEventListener('mozfullscreenchange', this.handleFullscreenChange, true); document.addEventListener('MSFullscreenChange', this.handleFullscreenChange, true); } componentWillUnmount () { document.removeEventListener('fullscreenchange', this.handleFullscreenChange, true); document.removeEventListener('webkitfullscreenchange', this.handleFullscreenChange, true); document.removeEventListener('mozfullscreenchange', this.handleFullscreenChange, true); document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true); } handleFullscreenChange = () => { this.setState({ fullscreen: isFullscreen() }); } handleMouseEnter = () => { this.setState({ hovered: true }); } handleMouseLeave = () => { this.setState({ hovered: false }); } toggleMute = () => { this.video.muted = !this.video.muted; this.setState({ muted: this.video.muted }); } toggleReveal = () => { if (this.state.revealed) { this.video.pause(); } this.setState({ revealed: !this.state.revealed }); } handleLoadedData = () => { if (this.props.startTime) { this.video.currentTime = this.props.startTime; this.video.play(); } } handleProgress = () => { if (this.video.buffered.length > 0) { this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 }); } } handleOpenVideo = () => { const { src, preview, width, height, alt } = this.props; const media = fromJS({ type: 'video', url: src, preview_url: preview, description: alt, width, height, }); this.video.pause(); this.props.onOpenVideo(media, this.video.currentTime); } handleCloseVideo = () => { this.video.pause(); this.props.onCloseVideo(); } render () { const { preview, src, inline, startTime, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive } = this.props; const { containerWidth, currentTime, duration, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state; const progress = (currentTime / duration) * 100; const playerStyle = {}; let { width, height } = this.props; if (inline && containerWidth) { width = containerWidth; height = containerWidth / (16/9); playerStyle.width = width; playerStyle.height = height; } let preload; if (startTime || fullscreen || dragging) { preload = 'auto'; } else if (detailed) { preload = 'metadata'; } else { preload = 'none'; } let warning; if (sensitive) { warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />; } else { warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />; } return ( <div role='menuitem' className={classNames('video-player', { inactive: !revealed, detailed, inline: inline && !fullscreen, fullscreen })} style={playerStyle} ref={this.setPlayerRef} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} onClick={this.handleClickRoot} tabIndex={0} > <video ref={this.setVideoRef} src={src} poster={preview} preload={preload} loop role='button' tabIndex='0' aria-label={alt} title={alt} width={width} height={height} onClick={this.togglePlay} onPlay={this.handlePlay} onPause={this.handlePause} onTimeUpdate={this.handleTimeUpdate} onLoadedData={this.handleLoadedData} onProgress={this.handleProgress} /> <button type='button' className={classNames('video-player__spoiler', { active: !revealed })} onClick={this.toggleReveal}> <span className='video-player__spoiler__title'>{warning}</span> <span className='video-player__spoiler__subtitle'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span> </button> <div className={classNames('video-player__controls', { active: paused || hovered })}> <div className='video-player__seek' onMouseDown={this.handleMouseDown} ref={this.setSeekRef}> <div className='video-player__seek__buffer' style={{ width: `${buffer}%` }} /> <div className='video-player__seek__progress' style={{ width: `${progress}%` }} /> <span className={classNames('video-player__seek__handle', { active: dragging })} tabIndex='0' style={{ left: `${progress}%` }} /> </div> <div className='video-player__buttons-bar'> <div className='video-player__buttons left'> <button type='button' aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay}><i className={classNames('fa fa-fw', { 'fa-play': paused, 'fa-pause': !paused })} /></button> <button type='button' aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><i className={classNames('fa fa-fw', { 'fa-volume-off': muted, 'fa-volume-up': !muted })} /></button> {!onCloseVideo && <button type='button' aria-label={intl.formatMessage(messages.hide)} onClick={this.toggleReveal}><i className='fa fa-fw fa-eye' /></button>} {(detailed || fullscreen) && <span> <span className='video-player__time-current'>{formatTime(currentTime)}</span> <span className='video-player__time-sep'>/</span> <span className='video-player__time-total'>{formatTime(duration)}</span> </span> } </div> <div className='video-player__buttons right'> {(!fullscreen && onOpenVideo) && <button type='button' aria-label={intl.formatMessage(messages.expand)} onClick={this.handleOpenVideo}><i className='fa fa-fw fa-expand' /></button>} {onCloseVideo && <button type='button' aria-label={intl.formatMessage(messages.close)} onClick={this.handleCloseVideo}><i className='fa fa-fw fa-compress' /></button>} <button type='button' aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} onClick={this.toggleFullscreen}><i className={classNames('fa fa-fw', { 'fa-arrows-alt': !fullscreen, 'fa-compress': fullscreen })} /></button> </div> </div> </div> </div> ); } }
node_modules/react-bootstrap/es/Collapse.js
skinsshark/skinsshark.github.io
import _extends from 'babel-runtime/helpers/extends'; import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import classNames from 'classnames'; import css from 'dom-helpers/style'; import React from 'react'; import Transition from 'react-overlays/lib/Transition'; import capitalize from './utils/capitalize'; import createChainedFunction from './utils/createChainedFunction'; var MARGINS = { height: ['marginTop', 'marginBottom'], width: ['marginLeft', 'marginRight'] }; // reading a dimension prop will cause the browser to recalculate, // which will let our animations work function triggerBrowserReflow(node) { node.offsetHeight; // eslint-disable-line no-unused-expressions } function getDimensionValue(dimension, elem) { var value = elem['offset' + capitalize(dimension)]; var margins = MARGINS[dimension]; return value + parseInt(css(elem, margins[0]), 10) + parseInt(css(elem, margins[1]), 10); } var propTypes = { /** * Show the component; triggers the expand or collapse animation */ 'in': React.PropTypes.bool, /** * Unmount the component (remove it from the DOM) when it is collapsed */ unmountOnExit: React.PropTypes.bool, /** * Run the expand animation when the component mounts, if it is initially * shown */ transitionAppear: React.PropTypes.bool, /** * Duration of the collapse animation in milliseconds, to ensure that * finishing callbacks are fired even if the original browser transition end * events are canceled */ timeout: React.PropTypes.number, /** * Callback fired before the component expands */ onEnter: React.PropTypes.func, /** * Callback fired after the component starts to expand */ onEntering: React.PropTypes.func, /** * Callback fired after the component has expanded */ onEntered: React.PropTypes.func, /** * Callback fired before the component collapses */ onExit: React.PropTypes.func, /** * Callback fired after the component starts to collapse */ onExiting: React.PropTypes.func, /** * Callback fired after the component has collapsed */ onExited: React.PropTypes.func, /** * The dimension used when collapsing, or a function that returns the * dimension * * _Note: Bootstrap only partially supports 'width'! * You will need to supply your own CSS animation for the `.width` CSS class._ */ dimension: React.PropTypes.oneOfType([React.PropTypes.oneOf(['height', 'width']), React.PropTypes.func]), /** * Function that returns the height or width of the animating DOM node * * Allows for providing some custom logic for how much the Collapse component * should animate in its specified dimension. Called with the current * dimension prop value and the DOM node. */ getDimensionValue: React.PropTypes.func, /** * ARIA role of collapsible element */ role: React.PropTypes.string }; var defaultProps = { 'in': false, timeout: 300, unmountOnExit: false, transitionAppear: false, dimension: 'height', getDimensionValue: getDimensionValue }; var Collapse = function (_React$Component) { _inherits(Collapse, _React$Component); function Collapse(props, context) { _classCallCheck(this, Collapse); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); _this.handleEnter = _this.handleEnter.bind(_this); _this.handleEntering = _this.handleEntering.bind(_this); _this.handleEntered = _this.handleEntered.bind(_this); _this.handleExit = _this.handleExit.bind(_this); _this.handleExiting = _this.handleExiting.bind(_this); return _this; } /* -- Expanding -- */ Collapse.prototype.handleEnter = function handleEnter(elem) { var dimension = this._dimension(); elem.style[dimension] = '0'; }; Collapse.prototype.handleEntering = function handleEntering(elem) { var dimension = this._dimension(); elem.style[dimension] = this._getScrollDimensionValue(elem, dimension); }; Collapse.prototype.handleEntered = function handleEntered(elem) { var dimension = this._dimension(); elem.style[dimension] = null; }; /* -- Collapsing -- */ Collapse.prototype.handleExit = function handleExit(elem) { var dimension = this._dimension(); elem.style[dimension] = this.props.getDimensionValue(dimension, elem) + 'px'; triggerBrowserReflow(elem); }; Collapse.prototype.handleExiting = function handleExiting(elem) { var dimension = this._dimension(); elem.style[dimension] = '0'; }; Collapse.prototype._dimension = function _dimension() { return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension; }; // for testing Collapse.prototype._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) { return elem['scroll' + capitalize(dimension)] + 'px'; }; Collapse.prototype.render = function render() { var _props = this.props; var onEnter = _props.onEnter; var onEntering = _props.onEntering; var onEntered = _props.onEntered; var onExit = _props.onExit; var onExiting = _props.onExiting; var className = _props.className; var props = _objectWithoutProperties(_props, ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'className']); delete props.dimension; delete props.getDimensionValue; var handleEnter = createChainedFunction(this.handleEnter, onEnter); var handleEntering = createChainedFunction(this.handleEntering, onEntering); var handleEntered = createChainedFunction(this.handleEntered, onEntered); var handleExit = createChainedFunction(this.handleExit, onExit); var handleExiting = createChainedFunction(this.handleExiting, onExiting); var classes = { width: this._dimension() === 'width' }; return React.createElement(Transition, _extends({}, props, { 'aria-expanded': props.role ? props['in'] : null, className: classNames(className, classes), exitedClassName: 'collapse', exitingClassName: 'collapsing', enteredClassName: 'collapse in', enteringClassName: 'collapsing', onEnter: handleEnter, onEntering: handleEntering, onEntered: handleEntered, onExit: handleExit, onExiting: handleExiting })); }; return Collapse; }(React.Component); Collapse.propTypes = propTypes; Collapse.defaultProps = defaultProps; export default Collapse;
src/components/search/SearchPage.js
Marsellus47/parking
import React from 'react'; import { Header, Icon, Form, Dropdown, Button, Popup } from 'semantic-ui-react'; import { ParkingSizes, Distances, Pricings, ParkingTypes, Locations, VehicleTypes, Inserted, Durations } from '../../constants/dropdownItems'; const SearchPage = () => { return ( <div> <Header as="h4" icon textAlign="center"> <Icon name="search" /> Search <Header.Subheader> Find parking according to your preferences </Header.Subheader> </Header> <Form> <Form.Input width={4} required label="Address" placeholder="Address" /> <Form.Field width={4}> <label>Distance</label> <Dropdown placeholder="Distance" fluid selection options={Distances} /> </Form.Field> <Form.Field width={4}> <label>Pricing</label> <Dropdown placeholder="Pricing" fluid multiple selection options={Pricings} /> </Form.Field> <Form.Field width={4}> <label>Parking size</label> <Dropdown placeholder="Parking size" fluid multiple selection options={ParkingSizes} /> </Form.Field> <Form.Field width={4}> <label>Vehicle type</label> <Dropdown placeholder="Vehicle type" fluid selection options={VehicleTypes} /> </Form.Field> <Form.Field width={4}> <label>Parking type</label> <Dropdown placeholder="Parking type" fluid multiple selection options={ParkingTypes} /> </Form.Field> <Form.Checkbox label="Person in wheelchair" toggle /> <Form.Field width={4}> <label>Location</label> <Dropdown placeholder="Location" fluid multiple selection options={Locations} /> </Form.Field> <Form.Field width={4}> <Popup trigger={<label>Inserted</label>} content="Time of parking creation" on="hover" /> <Dropdown placeholder="Inserted" fluid selection options={Inserted} /> </Form.Field> <Form.Field width={4}> <Popup trigger={<label>Duration</label>} content="Duration of your parking" on="hover" /> <Dropdown placeholder="Duration" fluid selection options={Durations} /> </Form.Field> <Form.Checkbox label="Confirmed only" toggle /> <Button.Group> <Button>Reset</Button> <Button.Or /> <Button>Search</Button> </Button.Group> </Form> </div> ); }; export default SearchPage;
app/javascript/mastodon/features/ui/components/video_modal.js
codl/mastodon
import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import Video from '../../video'; import ImmutablePureComponent from 'react-immutable-pure-component'; export default class VideoModal extends ImmutablePureComponent { static propTypes = { media: ImmutablePropTypes.map.isRequired, time: PropTypes.number, onClose: PropTypes.func.isRequired, }; render () { const { media, time, onClose } = this.props; return ( <div className='modal-root__modal media-modal'> <div> <Video preview={media.get('preview_url')} src={media.get('url')} startTime={time} onCloseVideo={onClose} detailed description={media.get('description')} /> </div> </div> ); } }