Last active
August 29, 2015 14:09
-
-
Save mrfabbri/1af93c020dce27ca4854 to your computer and use it in GitHub Desktop.
ReactiveTable Bookmarklet (from http://www.phpied.com/reactivetable-bookmarklet/ )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* React v0.5.0 | |
* | |
* Copyright 2013 Facebook, Inc. | |
* | |
* 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. | |
*/ | |
!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.React=t():"undefined"!=typeof global?global.React=t():"undefined"!=typeof self&&(self.React=t())}(function(){return function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e){function n(t){var e=r(t);if(!e)throw new Error(o('Tried to get element with id of "%s" but it is not present on the page.',t));return e}var r=t("./ge"),o=t("./ex");e.exports=n},{"./ex":82,"./ge":86}],2:[function(t,e){"use strict";var n={fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,zIndex:!0,zoom:!0},r={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!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}},o={isUnitlessNumber:n,shorthandPropertyExpansions:r};e.exports=o},{}],3:[function(t,e){"use strict";var n=t("./CSSProperty"),r=t("./dangerousStyleValue"),o=t("./escapeTextForBrowser"),i=t("./hyphenate"),a=t("./memoizeStringOnly"),s=a(function(t){return o(i(t))}),u={createMarkupForStyles:function(t){var e="";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];null!=o&&(e+=s(n)+":",e+=r(n,o)+";")}return e||null},setValueForStyles:function(t,e){var o=t.style;for(var i in e)if(e.hasOwnProperty(i)){var a=r(i,e[i]);if(a)o[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var u in s)o[u]="";else o[i]=""}}}};e.exports=u},{"./CSSProperty":2,"./dangerousStyleValue":79,"./escapeTextForBrowser":81,"./hyphenate":93,"./memoizeStringOnly":102}],4:[function(t,e){"use strict";var n={},r={putListener:function(t,e,r){var o=n[e]||(n[e]={});o[t]=r},getListener:function(t,e){var r=n[e];return r&&r[t]},deleteListener:function(t,e){var r=n[e];r&&delete r[t]},deleteAllListeners:function(t){for(var e in n)delete n[e][t]},__purge:function(){n={}}};e.exports=r},{}],5:[function(t,e){"use strict";function n(t){return"SELECT"===t.nodeName||"INPUT"===t.nodeName&&"file"===t.type}function r(t){var e=E.getPooled(N.change,T,t);y.accumulateTwoPhaseDispatches(e),g.enqueueEvents(e),g.processEventQueue()}function o(t,e){_=t,T=e,_.attachEvent("onchange",r)}function i(){_&&(_.detachEvent("onchange",r),_=null,T=null)}function a(t,e,n){return t===b.topChange?n:void 0}function s(t,e,n){t===b.topFocus?(i(),o(e,n)):t===b.topBlur&&i()}function u(t,e){_=t,T=e,I=t.value,x=Object.getOwnPropertyDescriptor(t.constructor.prototype,"value"),Object.defineProperty(_,"value",S),_.attachEvent("onpropertychange",l)}function c(){_&&(delete _.value,_.detachEvent("onpropertychange",l),_=null,T=null,I=null,x=null)}function l(t){if("value"===t.propertyName){var e=t.srcElement.value;e!==I&&(I=e,r(t))}}function p(t,e,n){return t===b.topInput?n:void 0}function d(t,e,n){t===b.topFocus?(c(),u(e,n)):t===b.topBlur&&c()}function h(t){return t!==b.topSelectionChange&&t!==b.topKeyUp&&t!==b.topKeyDown||!_||_.value===I?void 0:(I=_.value,T)}function f(t){return"INPUT"===t.nodeName&&("checkbox"===t.type||"radio"===t.type)}function m(t,e,n){return t===b.topClick?n:void 0}var v=t("./EventConstants"),g=t("./EventPluginHub"),y=t("./EventPropagators"),C=t("./ExecutionEnvironment"),E=t("./SyntheticEvent"),M=t("./isEventSupported"),R=t("./isTextInputElement"),D=t("./keyOf"),b=v.topLevelTypes,N={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})}}},_=null,T=null,I=null,x=null,P=!1;C.canUseDOM&&(P=M("change")&&(!("documentMode"in document)||document.documentMode>8));var O=!1;C.canUseDOM&&(O=M("input")&&(!("documentMode"in document)||document.documentMode>9));var S={get:function(){return x.get.call(this)},set:function(t){I=""+t,x.set.call(this,t)}},w={eventTypes:N,extractEvents:function(t,e,r,o){var i,u;if(n(e)?P?i=a:u=s:R(e)?O?i=p:(i=h,u=d):f(e)&&(i=m),i){var c=i(t,e,r);if(c){var l=E.getPooled(N.change,c,o);return y.accumulateTwoPhaseDispatches(l),l}}u&&u(t,e,r)}};e.exports=w},{"./EventConstants":14,"./EventPluginHub":16,"./EventPropagators":19,"./ExecutionEnvironment":20,"./SyntheticEvent":64,"./isEventSupported":95,"./isTextInputElement":97,"./keyOf":101}],6:[function(t,e){"use strict";function n(t){switch(t){case v.topCompositionStart:return y.compositionStart;case v.topCompositionEnd:return y.compositionEnd;case v.topCompositionUpdate:return y.compositionUpdate}}function r(t,e){return t===v.topKeyDown&&e.keyCode===f}function o(t,e){switch(t){case v.topKeyUp:return-1!==h.indexOf(e.keyCode);case v.topKeyDown:return e.keyCode!==f;case v.topKeyPress:case v.topMouseDown:case v.topBlur:return!0;default:return!1}}function i(t){this.root=t,this.startSelection=c.getSelection(t),this.startValue=this.getText()}var a=t("./EventConstants"),s=t("./EventPropagators"),u=t("./ExecutionEnvironment"),c=t("./ReactInputSelection"),l=t("./SyntheticCompositionEvent"),p=t("./getTextContentAccessor"),d=t("./keyOf"),h=[9,13,27,32],f=229,m=u.canUseDOM&&"CompositionEvent"in window,v=a.topLevelTypes,g=null,y={compositionEnd:{phasedRegistrationNames:{bubbled:d({onCompositionEnd:null}),captured:d({onCompositionEndCapture:null})}},compositionStart:{phasedRegistrationNames:{bubbled:d({onCompositionStart:null}),captured:d({onCompositionStartCapture:null})}},compositionUpdate:{phasedRegistrationNames:{bubbled:d({onCompositionUpdate:null}),captured:d({onCompositionUpdateCapture:null})}}};i.prototype.getText=function(){return this.root.value||this.root[p()]},i.prototype.getData=function(){var t=this.getText(),e=this.startSelection.start,n=this.startValue.length-this.startSelection.end;return t.substr(e,t.length-n-e)};var C={eventTypes:y,extractEvents:function(t,e,a,u){var c,p;if(m?c=n(t):g?o(t,u)&&(c=y.compositionEnd,p=g.getData(),g=null):r(t,u)&&(c=y.start,g=new i(e)),c){var d=l.getPooled(c,a,u);return p&&(d.data=p),s.accumulateTwoPhaseDispatches(d),d}}};e.exports=C},{"./EventConstants":14,"./EventPropagators":19,"./ExecutionEnvironment":20,"./ReactInputSelection":45,"./SyntheticCompositionEvent":63,"./getTextContentAccessor":92,"./keyOf":101}],7:[function(t,e){"use strict";function n(t,e,n){var r=t.childNodes;r[n]!==e&&(e.parentNode===t&&t.removeChild(e),n>=r.length?t.appendChild(e):t.insertBefore(e,r[n]))}var r=t("./Danger"),o=t("./ReactMultiChildUpdateTypes"),i=t("./getTextContentAccessor"),a=i()||"NA",s={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,processUpdates:function(t,e){for(var i,s=null,u=null,c=0;i=t[c];c++)if(i.type===o.MOVE_EXISTING||i.type===o.REMOVE_NODE){var l=i.fromIndex,p=i.parentNode.childNodes[l],d=i.parentID;s=s||{},s[d]=s[d]||[],s[d][l]=p,u=u||[],u.push(p)}var h=r.dangerouslyRenderMarkup(e);if(u)for(var f=0;f<u.length;f++)u[f].parentNode.removeChild(u[f]);for(var m=0;i=t[m];m++)switch(i.type){case o.INSERT_MARKUP:n(i.parentNode,h[i.markupIndex],i.toIndex);break;case o.MOVE_EXISTING:n(i.parentNode,s[i.parentID][i.fromIndex],i.toIndex);break;case o.TEXT_CONTENT:i.parentNode[a]=i.textContent;break;case o.REMOVE_NODE:}}};e.exports=s},{"./Danger":10,"./ReactMultiChildUpdateTypes":51,"./getTextContentAccessor":92}],8:[function(t,e){"use strict";var n=t("./invariant"),r={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_BOOLEAN_VALUE:4,HAS_SIDE_EFFECTS:8,injectDOMPropertyConfig:function(t){var e=t.Properties||{},o=t.DOMAttributeNames||{},a=t.DOMPropertyNames||{},s=t.DOMMutationMethods||{};t.isCustomAttribute&&i._isCustomAttributeFunctions.push(t.isCustomAttribute);for(var u in e){n(!i.isStandardName[u]),i.isStandardName[u]=!0;var c=u.toLowerCase();i.getPossibleStandardName[c]=u;var l=o[u];l&&(i.getPossibleStandardName[l]=u),i.getAttributeName[u]=l||c,i.getPropertyName[u]=a[u]||u;var p=s[u];p&&(i.getMutationMethod[u]=p);var d=e[u];i.mustUseAttribute[u]=d&r.MUST_USE_ATTRIBUTE,i.mustUseProperty[u]=d&r.MUST_USE_PROPERTY,i.hasBooleanValue[u]=d&r.HAS_BOOLEAN_VALUE,i.hasSideEffects[u]=d&r.HAS_SIDE_EFFECTS,n(!i.mustUseAttribute[u]||!i.mustUseProperty[u]),n(i.mustUseProperty[u]||!i.hasSideEffects[u])}}},o={},i={isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasBooleanValue:{},hasSideEffects:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(t){return i._isCustomAttributeFunctions.some(function(e){return e.call(null,t)})},getDefaultValueForProperty:function(t,e){var n,r=o[t];return r||(o[t]=r={}),e in r||(n=document.createElement(t),r[e]=n[e]),r[e]},injection:r};e.exports=i},{"./invariant":94}],9:[function(t,e){"use strict";var n=t("./DOMProperty"),r=t("./escapeTextForBrowser"),o=t("./memoizeStringOnly"),i=o(function(t){return r(t)+'="'}),a={createMarkupForProperty:function(t,e){if(n.isStandardName[t]){if(null==e||n.hasBooleanValue[t]&&!e)return"";var o=n.getAttributeName[t];return i(o)+r(e)+'"'}return n.isCustomAttribute(t)?null==e?"":i(t)+r(e)+'"':null},setValueForProperty:function(t,e,r){if(n.isStandardName[e]){var o=n.getMutationMethod[e];if(o)o(t,r);else if(n.mustUseAttribute[e])n.hasBooleanValue[e]&&!r?t.removeAttribute(n.getAttributeName[e]):t.setAttribute(n.getAttributeName[e],""+r);else{var i=n.getPropertyName[e];n.hasSideEffects[e]&&t[i]===r||(t[i]=r)}}else n.isCustomAttribute(e)&&t.setAttribute(e,""+r)},deleteValueForProperty:function(t,e){if(n.isStandardName[e]){var r=n.getMutationMethod[e];if(r)r(t,void 0);else if(n.mustUseAttribute[e])t.removeAttribute(n.getAttributeName[e]);else{var o=n.getPropertyName[e];t[o]=n.getDefaultValueForProperty(t.nodeName,e)}}else n.isCustomAttribute(e)&&t.removeAttribute(e)}};e.exports=a},{"./DOMProperty":8,"./escapeTextForBrowser":81,"./memoizeStringOnly":102}],10:[function(t,e){"use strict";function n(t){return t.substring(1,t.indexOf(" "))}var r=t("./ExecutionEnvironment"),o=t("./createNodesFromMarkup"),i=t("./emptyFunction"),a=t("./getMarkupWrap"),s=t("./invariant"),u=t("./mutateHTMLNodeWithMarkup"),c=/^(<[^ \/>]+)/,l="data-danger-index",p={dangerouslyRenderMarkup:function(t){s(r.canUseDOM);for(var e,u={},p=0;p<t.length;p++)s(t[p]),e=n(t[p]),e=a(e)?e:"*",u[e]=u[e]||[],u[e][p]=t[p];var d=[],h=0;for(e in u)if(u.hasOwnProperty(e)){var f=u[e];for(var m in f)if(f.hasOwnProperty(m)){var v=f[m];f[m]=v.replace(c,"$1 "+l+'="'+m+'" ')}var g=o(f.join(""),i);for(p=0;p<g.length;++p){var y=g[p];y.hasAttribute&&y.hasAttribute(l)&&(m=+y.getAttribute(l),y.removeAttribute(l),s(!d.hasOwnProperty(m)),d[m]=y,h+=1)}}return s(h===d.length),s(d.length===t.length),d},dangerouslyReplaceNodeWithMarkup:function(t,e){if(s(r.canUseDOM),s(e),"html"===t.tagName.toLowerCase())return u(t,e),void 0;var n=o(e,i)[0];t.parentNode.replaceChild(n,t)}};e.exports=p},{"./ExecutionEnvironment":20,"./createNodesFromMarkup":77,"./emptyFunction":80,"./getMarkupWrap":89,"./invariant":94,"./mutateHTMLNodeWithMarkup":107}],11:[function(t,e){"use strict";var n=t("./DOMProperty"),r=n.injection.MUST_USE_ATTRIBUTE,o=n.injection.MUST_USE_PROPERTY,i=n.injection.HAS_BOOLEAN_VALUE,a=n.injection.HAS_SIDE_EFFECTS,s={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,accessKey:null,action:null,allowFullScreen:r|i,allowTransparency:r,alt:null,autoComplete:null,autoFocus:i,autoPlay:i,cellPadding:null,cellSpacing:null,charSet:r,checked:o|i,className:o,colSpan:null,content:null,contentEditable:null,contextMenu:r,controls:o|i,data:null,dateTime:r,dir:null,disabled:o|i,draggable:null,encType:null,form:r,frameBorder:r,height:r,hidden:r|i,href:null,htmlFor:null,httpEquiv:null,icon:null,id:o,label:null,lang:null,list:null,max:null,maxLength:r,method:null,min:null,multiple:o|i,name:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:o|i,rel:null,required:i,role:r,rowSpan:null,scrollLeft:o,scrollTop:o,selected:o|i,size:null,spellCheck:null,src:null,step:null,style:null,tabIndex:null,target:null,title:null,type:null,value:o|a,width:r,wmode:r,autoCapitalize:null,cx:r,cy:r,d:r,fill:r,fx:r,fy:r,gradientTransform:r,gradientUnits:r,offset:r,points:r,r:r,rx:r,ry:r,spreadMethod:r,stopColor:r,stopOpacity:r,stroke:r,strokeLinecap:r,strokeWidth:r,transform:r,version:r,viewBox:r,x1:r,x2:r,x:r,y1:r,y2:r,y:r},DOMAttributeNames:{className:"class",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",htmlFor:"for",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeLinecap:"stroke-linecap",strokeWidth:"stroke-width",viewBox:"viewBox"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",encType:"enctype",radioGroup:"radiogroup",spellCheck:"spellcheck"},DOMMutationMethods:{className:function(t,e){t.className=e||""}}};e.exports=s},{"./DOMProperty":8}],12:[function(t,e){"use strict";var n=t("./keyOf"),r=[n({ResponderEventPlugin:null}),n({SimpleEventPlugin:null}),n({TapEventPlugin:null}),n({EnterLeaveEventPlugin:null}),n({ChangeEventPlugin:null}),n({SelectEventPlugin:null}),n({CompositionEventPlugin:null}),n({AnalyticsEventPlugin:null}),n({MobileSafariClickEventPlugin:null})];e.exports=r},{"./keyOf":101}],13:[function(t,e){"use strict";var n=t("./EventConstants"),r=t("./EventPropagators"),o=t("./SyntheticMouseEvent"),i=t("./ReactMount"),a=t("./keyOf"),s=n.topLevelTypes,u=i.getFirstReactDOM,c={mouseEnter:{registrationName:a({onMouseEnter:null})},mouseLeave:{registrationName:a({onMouseLeave:null})}},l=[null,null],p={eventTypes:c,extractEvents:function(t,e,n,a){if(t===s.topMouseOver&&(a.relatedTarget||a.fromElement))return null;if(t!==s.topMouseOut&&t!==s.topMouseOver)return null;var p,d;if(t===s.topMouseOut?(p=e,d=u(a.relatedTarget||a.toElement)||window):(p=window,d=e),p===d)return null;var h=p?i.getID(p):"",f=d?i.getID(d):"",m=o.getPooled(c.mouseLeave,h,a),v=o.getPooled(c.mouseEnter,f,a);return r.accumulateEnterLeaveDispatches(m,v,h,f),l[0]=m,l[1]=v,l}};e.exports=p},{"./EventConstants":14,"./EventPropagators":19,"./ReactMount":48,"./SyntheticMouseEvent":67,"./keyOf":101}],14:[function(t,e){"use strict";var n=t("./keyMirror"),r=n({bubbled:null,captured:null}),o=n({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),i={topLevelTypes:o,PropagationPhases:r};e.exports=i},{"./keyMirror":100}],15:[function(t,e){var n={listen:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)},capture:function(t,e,n){t.addEventListener&&t.addEventListener(e,n,!0)}};e.exports=n},{}],16:[function(t,e){"use strict";var n=t("./CallbackRegistry"),r=t("./EventPluginRegistry"),o=t("./EventPluginUtils"),i=t("./EventPropagators"),a=t("./ExecutionEnvironment"),s=t("./accumulate"),u=t("./forEachAccumulated"),c=t("./invariant"),l=null,p=function(t){if(t){var e=o.executeDispatch,n=r.getPluginModuleForEvent(t);n&&n.executeDispatch&&(e=n.executeDispatch),o.executeDispatchesInOrder(t,e),t.isPersistent()||t.constructor.release(t)}},d={injection:{injectInstanceHandle:i.injection.injectInstanceHandle,injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},registrationNames:r.registrationNames,putListener:n.putListener,getListener:n.getListener,deleteListener:n.deleteListener,deleteAllListeners:n.deleteAllListeners,extractEvents:function(t,e,n,o){for(var i,a=r.plugins,u=0,c=a.length;c>u;u++){var l=a[u];if(l){var p=l.extractEvents(t,e,n,o);p&&(i=s(i,p))}}return i},enqueueEvents:function(t){t&&(l=s(l,t))},processEventQueue:function(){var t=l;l=null,u(t,p),c(!l)}};a.canUseDOM&&(window.EventPluginHub=d),e.exports=d},{"./CallbackRegistry":4,"./EventPluginRegistry":17,"./EventPluginUtils":18,"./EventPropagators":19,"./ExecutionEnvironment":20,"./accumulate":73,"./forEachAccumulated":85,"./invariant":94}],17:[function(t,e){"use strict";function n(){if(a)for(var t in s){var e=s[t],n=a.indexOf(t);if(i(n>-1),!u.plugins[n]){i(e.extractEvents),u.plugins[n]=e;var o=e.eventTypes;for(var c in o)i(r(o[c],e))}}}function r(t,e){var n=t.phasedRegistrationNames;if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];o(i,e)}return!0}return t.registrationName?(o(t.registrationName,e),!0):!1}function o(t,e){i(!u.registrationNames[t]),u.registrationNames[t]=e,u.registrationNamesKeys.push(t)}var i=t("./invariant"),a=null,s={},u={plugins:[],registrationNames:{},registrationNamesKeys:[],injectEventPluginOrder:function(t){i(!a),a=Array.prototype.slice.call(t),n()},injectEventPluginsByName:function(t){var e=!1;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];s[r]!==o&&(i(!s[r]),s[r]=o,e=!0)}e&&n()},getPluginModuleForEvent:function(t){var e=t.dispatchConfig;if(e.registrationName)return u.registrationNames[e.registrationName]||null;for(var n in e.phasedRegistrationNames)if(e.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNames[e.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){a=null;for(var t in s)s.hasOwnProperty(t)&&delete s[t];u.plugins.length=0;var e=u.registrationNames;for(var n in e)e.hasOwnProperty(n)&&delete e[n];u.registrationNamesKeys.length=0}};e.exports=u},{"./invariant":94}],18:[function(t,e){"use strict";function n(t){return t===h.topMouseUp||t===h.topTouchEnd||t===h.topTouchCancel}function r(t){return t===h.topMouseMove||t===h.topTouchMove}function o(t){return t===h.topMouseDown||t===h.topTouchStart}function i(t,e){var n=t._dispatchListeners,r=t._dispatchIDs;if(Array.isArray(n))for(var o=0;o<n.length&&!t.isPropagationStopped();o++)e(t,n[o],r[o]);else n&&e(t,n,r)}function a(t,e,n){e(t,n)}function s(t,e){i(t,e),t._dispatchListeners=null,t._dispatchIDs=null}function u(t){var e=t._dispatchListeners,n=t._dispatchIDs;if(Array.isArray(e)){for(var r=0;r<e.length&&!t.isPropagationStopped();r++)if(e[r](t,n[r]))return n[r]}else if(e&&e(t,n))return n;return null}function c(t){var e=t._dispatchListeners,n=t._dispatchIDs;d(!Array.isArray(e));var r=e?e(t,n):null;return t._dispatchListeners=null,t._dispatchIDs=null,r}function l(t){return!!t._dispatchListeners}var p=t("./EventConstants"),d=t("./invariant"),h=p.topLevelTypes,f={isEndish:n,isMoveish:r,isStartish:o,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:u,executeDirectDispatch:c,hasDispatches:l,executeDispatch:a};e.exports=f},{"./EventConstants":14,"./invariant":94}],19:[function(t,e){"use strict";function n(t,e,n){var r=e.dispatchConfig.phasedRegistrationNames[n];return f(t,r)}function r(t,e,r){var o=e?m.bubbled:m.captured,i=n(t,r,o);i&&(r._dispatchListeners=d(r._dispatchListeners,i),r._dispatchIDs=d(r._dispatchIDs,t))}function o(t){t&&t.dispatchConfig.phasedRegistrationNames&&v.InstanceHandle.traverseTwoPhase(t.dispatchMarker,r,t)}function i(t,e,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=f(t,r);o&&(n._dispatchListeners=d(n._dispatchListeners,o),n._dispatchIDs=d(n._dispatchIDs,t))}}function a(t){t&&t.dispatchConfig.registrationName&&i(t.dispatchMarker,null,t)}function s(t){h(t,o)}function u(t,e,n,r){v.InstanceHandle.traverseEnterLeave(n,r,i,t,e)}function c(t){h(t,a)}var l=t("./CallbackRegistry"),p=t("./EventConstants"),d=t("./accumulate"),h=t("./forEachAccumulated"),f=l.getListener,m=p.PropagationPhases,v={InstanceHandle:null,injectInstanceHandle:function(t){v.InstanceHandle=t},validate:function(){var t=!v.InstanceHandle||!v.InstanceHandle.traverseTwoPhase||!v.InstanceHandle.traverseEnterLeave;if(t)throw new Error("InstanceHandle not injected before use!")}},g={accumulateTwoPhaseDispatches:s,accumulateDirectDispatches:c,accumulateEnterLeaveDispatches:u,injection:v};e.exports=g},{"./CallbackRegistry":4,"./EventConstants":14,"./accumulate":73,"./forEachAccumulated":85}],20:[function(t,e){"use strict";var n="undefined"!=typeof window,r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,isInWorker:!n};e.exports=r},{}],21:[function(t,e){"use strict";var n=t("./invariant"),r={_assertLink:function(){n(null==this.props.value&&null==this.props.onChange)},getValue:function(){return this.props.valueLink?(this._assertLink(),this.props.valueLink.value):this.props.value},getOnChange:function(){return this.props.valueLink?(this._assertLink(),this._handleLinkedValueChange):this.props.onChange},_handleLinkedValueChange:function(t){this.props.valueLink.requestChange(t.target.value)}};e.exports=r},{"./invariant":94}],22:[function(t,e){"use strict";var n=t("./EventConstants"),r=t("./emptyFunction"),o=n.topLevelTypes,i={eventTypes:null,extractEvents:function(t,e,n,i){if(t===o.topTouchStart){var a=i.target;a&&!a.onclick&&(a.onclick=r)}}};e.exports=i},{"./EventConstants":14,"./emptyFunction":80}],23:[function(t,e){"use strict";var n=function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)},r=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},o=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},i=function(t,e,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,t,e,n,r,o),a}return new i(t,e,n,r,o)},a=function(t){var e=this;t.destructor&&t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},s=10,u=n,c=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||u,n.poolSize||(n.poolSize=s),n.release=a,n},l={addPoolingTo:c,oneArgumentPooler:n,twoArgumentPooler:r,threeArgumentPooler:o,fiveArgumentPooler:i};e.exports=l},{}],24:[function(t,e){"use strict";var n=t("./ReactComponent"),r=t("./ReactCompositeComponent"),o=t("./ReactCurrentOwner"),i=t("./ReactDOM"),a=t("./ReactDOMComponent"),s=t("./ReactDefaultInjection"),u=t("./ReactInstanceHandles"),c=t("./ReactMount"),l=t("./ReactMultiChild"),p=t("./ReactPerf"),d=t("./ReactPropTypes"),h=t("./ReactServerRendering"),f=t("./ReactTextComponent");s.inject();var m={DOM:i,PropTypes:d,initializeTouchEvents:function(t){c.useTouchEvents=t},createClass:r.createClass,constructAndRenderComponent:c.constructAndRenderComponent,constructAndRenderComponentByID:c.constructAndRenderComponentByID,renderComponent:p.measure("React","renderComponent",c.renderComponent),renderComponentToString:h.renderComponentToString,unmountComponentAtNode:c.unmountComponentAtNode,unmountAndReleaseReactRootNode:c.unmountAndReleaseReactRootNode,isValidClass:r.isValidClass,isValidComponent:n.isValidComponent,__internals:{Component:n,CurrentOwner:o,DOMComponent:a,InstanceHandles:u,Mount:c,MultiChild:l,TextComponent:f}};m.version="0.5.0",e.exports=m},{"./ReactComponent":25,"./ReactCompositeComponent":28,"./ReactCurrentOwner":29,"./ReactDOM":30,"./ReactDOMComponent":32,"./ReactDefaultInjection":41,"./ReactInstanceHandles":46,"./ReactMount":48,"./ReactMultiChild":50,"./ReactPerf":53,"./ReactPropTypes":55,"./ReactServerRendering":57,"./ReactTextComponent":58}],25:[function(t,e){"use strict";var n=t("./ReactComponentEnvironment"),r=t("./ReactCurrentOwner"),o=t("./ReactOwner"),i=t("./ReactUpdates"),a=t("./invariant"),s=t("./keyMirror"),u=t("./merge"),c=s({MOUNTED:null,UNMOUNTED:null}),l={isValidComponent:function(t){return!(!t||"function"!=typeof t.mountComponentIntoNode||"function"!=typeof t.receiveProps)},getKey:function(t,e){return t&&t.props&&null!=t.props.key?"{"+t.props.key+"}":"["+e+"]"},LifeCycle:c,DOMIDOperations:n.DOMIDOperations,unmountIDFromEnvironment:n.unmountIDFromEnvironment,mountImageIntoNode:n.mountImageIntoNode,ReactReconcileTransaction:n.ReactReconcileTransaction,Mixin:u(n.Mixin,{isMounted:function(){return this._lifeCycleState===c.MOUNTED},setProps:function(t,e){this.replaceProps(u(this._pendingProps||this.props,t),e)},replaceProps:function(t,e){a(!this.props.__owner__),a(this.isMounted()),this._pendingProps=t,i.enqueueUpdate(this,e)},construct:function(t,e){this.props=t||{},this.props.__owner__=r.current,this._lifeCycleState=c.UNMOUNTED,this._pendingProps=null,this._pendingCallbacks=null;var n=arguments.length-1;if(1===n)this.props.children=e;else if(n>1){for(var o=Array(n),i=0;n>i;i++)o[i]=arguments[i+1];this.props.children=o}},mountComponent:function(t,e,n){a(!this.isMounted());var r=this.props;null!=r.ref&&o.addComponentAsRefTo(this,r.ref,r.__owner__),this._rootNodeID=t,this._lifeCycleState=c.MOUNTED,this._mountDepth=n},unmountComponent:function(){a(this.isMounted());var t=this.props;null!=t.ref&&o.removeComponentAsRefFrom(this,t.ref,t.__owner__),l.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=c.UNMOUNTED},receiveProps:function(t,e){a(this.isMounted()),this._pendingProps=t,this._performUpdateIfNecessary(e)},performUpdateIfNecessary:function(){var t=l.ReactReconcileTransaction.getPooled();t.perform(this._performUpdateIfNecessary,this,t),l.ReactReconcileTransaction.release(t)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps){var e=this.props;this.props=this._pendingProps,this._pendingProps=null,this.updateComponent(t,e)}},updateComponent:function(t,e){var n=this.props;(n.__owner__!==e.__owner__||n.ref!==e.ref)&&(null!=e.ref&&o.removeComponentAsRefFrom(this,e.ref,e.__owner__),null!=n.ref&&o.addComponentAsRefTo(this,n.ref,n.__owner__))},mountComponentIntoNode:function(t,e,n){var r=l.ReactReconcileTransaction.getPooled();r.perform(this._mountComponentIntoNode,this,t,e,r,n),l.ReactReconcileTransaction.release(r)},_mountComponentIntoNode:function(t,e,n,r){var o=this.mountComponent(t,n,0);l.mountImageIntoNode(o,e,r)},isOwnedBy:function(t){return this.props.__owner__===t},getSiblingByRef:function(t){var e=this.props.__owner__;return e&&e.refs?e.refs[t]:null}})};e.exports=l},{"./ReactComponentEnvironment":27,"./ReactCurrentOwner":29,"./ReactOwner":52,"./ReactUpdates":59,"./invariant":94,"./keyMirror":100,"./merge":103}],26:[function(t,e){"use strict";var n=t("./ReactDOMIDOperations"),r=t("./ReactMarkupChecksum"),o=t("./ReactMount"),i=t("./ReactReconcileTransaction"),a=t("./getReactRootElementInContainer"),s=t("./invariant"),u=t("./mutateHTMLNodeWithMarkup"),c=1,l=9,p={Mixin:{getDOMNode:function(){return s(this.isMounted()),o.getNode(this._rootNodeID)}},ReactReconcileTransaction:i,DOMIDOperations:n,unmountIDFromEnvironment:function(t){o.purgeID(t)},mountImageIntoNode:function(t,e,n){if(s(e&&(e.nodeType===c||e.nodeType===l&&o.allowFullPageRender)),!n||!r.canReuseMarkup(t,a(e))){if(e.nodeType===l)return u(e.documentElement,t),void 0;var i=e.parentNode;if(i){var p=e.nextSibling;i.removeChild(e),e.innerHTML=t,p?i.insertBefore(e,p):i.appendChild(e)}else e.innerHTML=t}}};e.exports=p},{"./ReactDOMIDOperations":34,"./ReactMarkupChecksum":47,"./ReactMount":48,"./ReactReconcileTransaction":56,"./getReactRootElementInContainer":91,"./invariant":94,"./mutateHTMLNodeWithMarkup":107}],27:[function(t,e){var n=t("./ReactComponentBrowserEnvironment"),r=n;e.exports=r},{"./ReactComponentBrowserEnvironment":26}],28:[function(t,e){"use strict";function n(t,e){var n=E[e];D.hasOwnProperty(e)&&f(n===C.OVERRIDE_BASE),t.hasOwnProperty(e)&&f(n===C.DEFINE_MANY||n===C.DEFINE_MANY_MERGED)}function r(t){var e=t._compositeLifeCycleState;f(t.isMounted()||e===R.MOUNTING),f(e!==R.RECEIVING_STATE&&e!==R.UNMOUNTING)}function o(t,e){var r=t.prototype;for(var o in e){var i=e[o];if(e.hasOwnProperty(o)&&i)if(n(r,o),M.hasOwnProperty(o))M[o](t,i);else{var u=o in E,c=o in r,l=i.__reactDontBind,p="function"==typeof i,d=p&&!u&&!c&&!l;d?(r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[o]=i,r[o]=i):r[o]=c?E[o]===C.DEFINE_MANY_MERGED?a(r[o],i):s(r[o],i):i}}}function i(t,e){return f(t&&e&&"object"==typeof t&&"object"==typeof e),y(e,function(e,n){f(void 0===t[n]),t[n]=e}),t}function a(t,e){return function(){return i(t.apply(this,arguments),e.apply(this,arguments))}}function s(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}var u=t("./ReactComponent"),c=t("./ReactCurrentOwner"),l=t("./ReactOwner"),p=t("./ReactPerf"),d=t("./ReactPropTransferer"),h=t("./ReactUpdates"),f=t("./invariant"),m=t("./keyMirror"),v=t("./merge"),g=t("./mixInto"),y=t("./objMap"),C=m({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),E={mixins:C.DEFINE_MANY,propTypes:C.DEFINE_ONCE,getDefaultProps:C.DEFINE_MANY_MERGED,getInitialState:C.DEFINE_MANY_MERGED,render:C.DEFINE_ONCE,componentWillMount:C.DEFINE_MANY,componentDidMount:C.DEFINE_MANY,componentWillReceiveProps:C.DEFINE_MANY,shouldComponentUpdate:C.DEFINE_ONCE,componentWillUpdate:C.DEFINE_MANY,componentDidUpdate:C.DEFINE_MANY,componentWillUnmount:C.DEFINE_MANY,updateComponent:C.OVERRIDE_BASE},M={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)o(t,e[n])},propTypes:function(t,e){t.propTypes=e}},R=m({MOUNTING:null,UNMOUNTING:null,RECEIVING_PROPS:null,RECEIVING_STATE:null}),D={construct:function(){u.Mixin.construct.apply(this,arguments),this.state=null,this._pendingState=null,this._compositeLifeCycleState=null},isMounted:function(){return u.Mixin.isMounted.call(this)&&this._compositeLifeCycleState!==R.MOUNTING},mountComponent:p.measure("ReactCompositeComponent","mountComponent",function(t,e,n){u.Mixin.mountComponent.call(this,t,e,n),this._compositeLifeCycleState=R.MOUNTING,this._defaultProps=this.getDefaultProps?this.getDefaultProps():null,this._processProps(this.props),this.__reactAutoBindMap&&this._bindAutoBindMethods(),this.state=this.getInitialState?this.getInitialState():null,this._pendingState=null,this._pendingForceUpdate=!1,this.componentWillMount&&(this.componentWillMount(),this._pendingState&&(this.state=this._pendingState,this._pendingState=null)),this._renderedComponent=this._renderValidatedComponent(),this._compositeLifeCycleState=null;var r=this._renderedComponent.mountComponent(t,e,n+1);return this.componentDidMount&&e.getReactMountReady().enqueue(this,this.componentDidMount),r}),unmountComponent:function(){this._compositeLifeCycleState=R.UNMOUNTING,this.componentWillUnmount&&this.componentWillUnmount(),this._compositeLifeCycleState=null,this._defaultProps=null,u.Mixin.unmountComponent.call(this),this._renderedComponent.unmountComponent(),this._renderedComponent=null,this.refs&&(this.refs=null)},setState:function(t,e){this.replaceState(v(this._pendingState||this.state,t),e)},replaceState:function(t,e){r(this),this._pendingState=t,h.enqueueUpdate(this,e)},_processProps:function(t){var e,n=this._defaultProps;for(e in n)e in t||(t[e]=n[e]);var r=this.constructor.propTypes;if(r){var o=this.constructor.displayName;for(e in r){var i=r[e];i&&i(t,e,o)}}},performUpdateIfNecessary:function(){var t=this._compositeLifeCycleState;t!==R.MOUNTING&&t!==R.RECEIVING_PROPS&&u.Mixin.performUpdateIfNecessary.call(this)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps||null!=this._pendingState||this._pendingForceUpdate){var e=this.props;null!=this._pendingProps&&(e=this._pendingProps,this._processProps(e),this._pendingProps=null,this._compositeLifeCycleState=R.RECEIVING_PROPS,this.componentWillReceiveProps&&this.componentWillReceiveProps(e,t)),this._compositeLifeCycleState=R.RECEIVING_STATE; | |
var n=this._pendingState||this.state;this._pendingState=null,this._pendingForceUpdate||!this.shouldComponentUpdate||this.shouldComponentUpdate(e,n)?(this._pendingForceUpdate=!1,this._performComponentUpdate(e,n,t)):(this.props=e,this.state=n),this._compositeLifeCycleState=null}},_performComponentUpdate:function(t,e,n){var r=this.props,o=this.state;this.componentWillUpdate&&this.componentWillUpdate(t,e,n),this.props=t,this.state=e,this.updateComponent(n,r,o),this.componentDidUpdate&&n.getReactMountReady().enqueue(this,this.componentDidUpdate.bind(this,r,o))},updateComponent:p.measure("ReactCompositeComponent","updateComponent",function(t,e){u.Mixin.updateComponent.call(this,t,e);var n=this._renderedComponent,r=this._renderValidatedComponent();if(n.constructor===r.constructor)n.receiveProps(r.props,t);else{var o=this._rootNodeID,i=n._rootNodeID;n.unmountComponent(),this._renderedComponent=r;var a=r.mountComponent(o,t,this._mountDepth+1);u.DOMIDOperations.dangerouslyReplaceNodeWithMarkupByID(i,a)}}),forceUpdate:function(t){var e=this._compositeLifeCycleState;f(this.isMounted()||e===R.MOUNTING),f(e!==R.RECEIVING_STATE&&e!==R.UNMOUNTING),this._pendingForceUpdate=!0,h.enqueueUpdate(this,t)},_renderValidatedComponent:function(){var t;c.current=this;try{t=this.render()}catch(e){throw e}finally{c.current=null}return f(u.isValidComponent(t)),t},_bindAutoBindMethods:function(){for(var t in this.__reactAutoBindMap)if(this.__reactAutoBindMap.hasOwnProperty(t)){var e=this.__reactAutoBindMap[t];this[t]=this._bindAutoBindMethod(e)}},_bindAutoBindMethod:function(t){var e=this,n=function(){return t.apply(e,arguments)};return n}},b=function(){};g(b,u.Mixin),g(b,l.Mixin),g(b,d.Mixin),g(b,D);var N={LifeCycle:R,Base:b,createClass:function(t){var e=function(){};e.prototype=new b,e.prototype.constructor=e,o(e,t),f(e.prototype.render);for(var n in E)e.prototype[n]||(e.prototype[n]=null);var r=function(){var t=new e;return t.construct.apply(t,arguments),t};return r.componentConstructor=e,r.originalSpec=t,r},isValidClass:function(t){return t instanceof Function&&"componentConstructor"in t&&t.componentConstructor instanceof Function}};e.exports=N},{"./ReactComponent":25,"./ReactCurrentOwner":29,"./ReactOwner":52,"./ReactPerf":53,"./ReactPropTransferer":54,"./ReactUpdates":59,"./invariant":94,"./keyMirror":100,"./merge":103,"./mixInto":106,"./objMap":109}],29:[function(t,e){"use strict";var n={current:null};e.exports=n},{}],30:[function(t,e){"use strict";function n(t,e){var n=function(){};n.prototype=new r(t,e),n.prototype.constructor=n,n.displayName=t;var o=function(){var t=new n;return t.construct.apply(t,arguments),t};return o.componentConstructor=n,o}var r=t("./ReactDOMComponent"),o=t("./mergeInto"),i=t("./objMapKeyVal"),a=i({a:!1,abbr:!1,address:!1,area:!1,article:!1,aside:!1,audio:!1,b:!1,base:!1,bdi:!1,bdo:!1,big:!1,blockquote:!1,body:!1,br:!0,button:!1,canvas:!1,caption:!1,cite:!1,code:!1,col:!0,colgroup:!1,data:!1,datalist:!1,dd:!1,del:!1,details:!1,dfn:!1,div:!1,dl:!1,dt:!1,em:!1,embed:!0,fieldset:!1,figcaption:!1,figure:!1,footer:!1,form:!1,h1:!1,h2:!1,h3:!1,h4:!1,h5:!1,h6:!1,head:!1,header:!1,hr:!0,html:!1,i:!1,iframe:!1,img:!0,input:!0,ins:!1,kbd:!1,keygen:!0,label:!1,legend:!1,li:!1,link:!1,main:!1,map:!1,mark:!1,menu:!1,menuitem:!1,meta:!0,meter:!1,nav:!1,noscript:!1,object:!1,ol:!1,optgroup:!1,option:!1,output:!1,p:!1,param:!0,pre:!1,progress:!1,q:!1,rp:!1,rt:!1,ruby:!1,s:!1,samp:!1,script:!1,section:!1,select:!1,small:!1,source:!1,span:!1,strong:!1,style:!1,sub:!1,summary:!1,sup:!1,table:!1,tbody:!1,td:!1,textarea:!1,tfoot:!1,th:!1,thead:!1,time:!1,title:!1,tr:!1,track:!0,u:!1,ul:!1,"var":!1,video:!1,wbr:!1,circle:!1,g:!1,line:!1,path:!1,polyline:!1,rect:!1,svg:!1,text:!1},n),s={injectComponentClasses:function(t){o(a,t)}};a.injection=s,e.exports=a},{"./ReactDOMComponent":32,"./mergeInto":105,"./objMapKeyVal":110}],31:[function(t,e){"use strict";var n=t("./ReactCompositeComponent"),r=t("./ReactDOM"),o=t("./keyMirror"),i=r.button,a=o({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),s=n.createClass({render:function(){var t={};for(var e in this.props)!this.props.hasOwnProperty(e)||this.props.disabled&&a[e]||(t[e]=this.props[e]);return i(t,this.props.children)}});e.exports=s},{"./ReactCompositeComponent":28,"./ReactDOM":30,"./keyMirror":100}],32:[function(t,e){"use strict";function n(t){t&&(h(null==t.children||null==t.dangerouslySetInnerHTML),h(null==t.style||"object"==typeof t.style))}function r(t,e){this._tagOpen="<"+t,this._tagClose=e?"":"</"+t+">",this.tagName=t.toUpperCase()}var o=t("./CSSPropertyOperations"),i=t("./DOMProperty"),a=t("./DOMPropertyOperations"),s=t("./ReactComponent"),u=t("./ReactEventEmitter"),c=t("./ReactMultiChild"),l=t("./ReactMount"),p=t("./ReactPerf"),d=t("./escapeTextForBrowser"),h=t("./invariant"),f=t("./keyOf"),m=t("./merge"),v=t("./mixInto"),g=u.putListener,y=u.deleteListener,C=u.registrationNames,E={string:!0,number:!0},M=f({style:null});r.Mixin={mountComponent:p.measure("ReactDOMComponent","mountComponent",function(t,e,r){return s.Mixin.mountComponent.call(this,t,e,r),n(this.props),this._createOpenTagMarkup()+this._createContentMarkup(e)+this._tagClose}),_createOpenTagMarkup:function(){var t=this.props,e=this._tagOpen;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(null!=r)if(C[n])g(this._rootNodeID,n,r);else{n===M&&(r&&(r=t.style=m(t.style)),r=o.createMarkupForStyles(r));var i=a.createMarkupForProperty(n,r);i&&(e+=" "+i)}}var s=d(this._rootNodeID);return e+" "+l.ATTR_NAME+'="'+s+'">'},_createContentMarkup:function(t){var e=this.props.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html)return e.__html}else{var n=E[typeof this.props.children]?this.props.children:null,r=null!=n?null:this.props.children;if(null!=n)return d(n);if(null!=r){var o=this.mountChildren(r,t);return o.join("")}}return""},receiveProps:function(t,e){n(t),s.Mixin.receiveProps.call(this,t,e)},updateComponent:p.measure("ReactDOMComponent","updateComponent",function(t,e){s.Mixin.updateComponent.call(this,t,e),this._updateDOMProperties(e),this._updateDOMChildren(e,t)}),_updateDOMProperties:function(t){var e,n,r,o=this.props;for(e in t)if(!o.hasOwnProperty(e)&&t.hasOwnProperty(e))if(e===M){var a=t[e];for(n in a)a.hasOwnProperty(n)&&(r=r||{},r[n]="")}else C[e]?y(this._rootNodeID,e):(i.isStandardName[e]||i.isCustomAttribute(e))&&s.DOMIDOperations.deletePropertyByID(this._rootNodeID,e);for(e in o){var u=o[e],c=t[e];if(o.hasOwnProperty(e)&&u!==c)if(e===M)if(u&&(u=o.style=m(u)),c){for(n in c)c.hasOwnProperty(n)&&!u.hasOwnProperty(n)&&(r=r||{},r[n]="");for(n in u)u.hasOwnProperty(n)&&c[n]!==u[n]&&(r=r||{},r[n]=u[n])}else r=u;else C[e]?g(this._rootNodeID,e,u):(i.isStandardName[e]||i.isCustomAttribute(e))&&s.DOMIDOperations.updatePropertyByID(this._rootNodeID,e,u)}r&&s.DOMIDOperations.updateStylesByID(this._rootNodeID,r)},_updateDOMChildren:function(t,e){var n=this.props,r=E[typeof t.children]?t.children:null,o=E[typeof n.children]?n.children:null,i=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,a=n.dangerouslySetInnerHTML&&n.dangerouslySetInnerHTML.__html,u=null!=r?null:t.children,c=null!=o?null:n.children,l=null!=r||null!=i,p=null!=o||null!=a;null!=u&&null==c?this.updateChildren(null,e):l&&!p&&this.updateTextContent(""),null!=o?r!==o&&this.updateTextContent(""+o):null!=a?i!==a&&s.DOMIDOperations.updateInnerHTMLByID(this._rootNodeID,a):null!=c&&this.updateChildren(c,e)},unmountComponent:function(){u.deleteAllListeners(this._rootNodeID),s.Mixin.unmountComponent.call(this),this.unmountChildren()}},v(r,s.Mixin),v(r,r.Mixin),v(r,c.Mixin),e.exports=r},{"./CSSPropertyOperations":3,"./DOMProperty":8,"./DOMPropertyOperations":9,"./ReactComponent":25,"./ReactEventEmitter":42,"./ReactMount":48,"./ReactMultiChild":50,"./ReactPerf":53,"./escapeTextForBrowser":81,"./invariant":94,"./keyOf":101,"./merge":103,"./mixInto":106}],33:[function(t,e){"use strict";var n=t("./ReactCompositeComponent"),r=t("./ReactDOM"),o=t("./ReactEventEmitter"),i=t("./EventConstants"),a=r.form,s=n.createClass({render:function(){return this.transferPropsTo(a(null,this.props.children))},componentDidMount:function(t){o.trapBubbledEvent(i.topLevelTypes.topSubmit,"submit",t)}});e.exports=s},{"./EventConstants":14,"./ReactCompositeComponent":28,"./ReactDOM":30,"./ReactEventEmitter":42}],34:[function(t,e){"use strict";var n=t("./CSSPropertyOperations"),r=t("./DOMChildrenOperations"),o=t("./DOMPropertyOperations"),i=t("./ReactMount"),a=t("./getTextContentAccessor"),s=t("./invariant"),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c=a()||"NA",l=/^ /,p={updatePropertyByID:function(t,e,n){var r=i.getNode(t);s(!u.hasOwnProperty(e)),null!=n?o.setValueForProperty(r,e,n):o.deleteValueForProperty(r,e)},deletePropertyByID:function(t,e,n){var r=i.getNode(t);s(!u.hasOwnProperty(e)),o.deleteValueForProperty(r,e,n)},updatePropertiesByID:function(t,e){for(var n in e)e.hasOwnProperty(n)&&p.updatePropertiesByID(t,n,e[n])},updateStylesByID:function(t,e){var r=i.getNode(t);n.setValueForStyles(r,e)},updateInnerHTMLByID:function(t,e){var n=i.getNode(t);n.innerHTML=e.replace(l," ")},updateTextContentByID:function(t,e){var n=i.getNode(t);n[c]=e},dangerouslyReplaceNodeWithMarkupByID:function(t,e){var n=i.getNode(t);r.dangerouslyReplaceNodeWithMarkup(n,e)},dangerouslyProcessChildrenUpdates:function(t,e){for(var n=0;n<t.length;n++)t[n].parentNode=i.getNode(t[n].parentID);r.processUpdates(t,e)}};e.exports=p},{"./CSSPropertyOperations":3,"./DOMChildrenOperations":7,"./DOMPropertyOperations":9,"./ReactMount":48,"./getTextContentAccessor":92,"./invariant":94}],35:[function(t,e){"use strict";var n=t("./DOMPropertyOperations"),r=t("./LinkedValueMixin"),o=t("./ReactCompositeComponent"),i=t("./ReactDOM"),a=t("./ReactMount"),s=t("./invariant"),u=t("./merge"),c=i.input,l={},p=o.createClass({mixins:[r],getInitialState:function(){var t=this.props.defaultValue;return{checked:this.props.defaultChecked||!1,value:null!=t?t:""}},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var t=u(this.props);t.defaultChecked=null,t.defaultValue=null,t.checked=null!=this.props.checked?this.props.checked:this.state.checked;var e=this.getValue();return t.value=null!=e?e:this.state.value,t.onChange=this._handleChange,c(t,this.props.children)},componentDidMount:function(t){var e=a.getID(t);l[e]=this},componentWillUnmount:function(){var t=this.getDOMNode(),e=a.getID(t);delete l[e]},componentDidUpdate:function(t,e,r){null!=this.props.checked&&n.setValueForProperty(r,"checked",this.props.checked||!1);var o=this.getValue();null!=o&&n.setValueForProperty(r,"value",""+o)},_handleChange:function(t){var e,n=this.getOnChange();n&&(this._isChanging=!0,e=n(t),this._isChanging=!1),this.setState({checked:t.target.checked,value:t.target.value});var r=this.props.name;if("radio"===this.props.type&&null!=r)for(var o=this.getDOMNode(),i=document.getElementsByName(r),u=0,c=i.length;c>u;u++){var p=i[u];if(p!==o&&"INPUT"===p.nodeName&&"radio"===p.type&&p.form===o.form){var d=a.getID(p);s(d);var h=l[d];s(h),h.setState({checked:!1})}}return e}});e.exports=p},{"./DOMPropertyOperations":9,"./LinkedValueMixin":21,"./ReactCompositeComponent":28,"./ReactDOM":30,"./ReactMount":48,"./invariant":94,"./merge":103}],36:[function(t,e){"use strict";var n=t("./ReactCompositeComponent"),r=t("./ReactDOM"),o=r.option,i=n.createClass({componentWillMount:function(){null!=this.props.selected},render:function(){return o(this.props,this.props.children)}});e.exports=i},{"./ReactCompositeComponent":28,"./ReactDOM":30}],37:[function(t,e){"use strict";function n(t,e){null!=t[e]&&(t.multiple?s(Array.isArray(t[e])):s(!Array.isArray(t[e])))}function r(){for(var t=this.getValue(),e=null!=t?t:this.state.value,n=this.getDOMNode().options,r=""+e,o=0,i=n.length;i>o;o++){var a=this.props.multiple?r.indexOf(n[o].value)>=0:a=n[o].value===r;a!==n[o].selected&&(n[o].selected=a)}}var o=t("./LinkedValueMixin"),i=t("./ReactCompositeComponent"),a=t("./ReactDOM"),s=t("./invariant"),u=t("./merge"),c=a.select,l=i.createClass({mixins:[o],propTypes:{defaultValue:n,value:n},getInitialState:function(){return{value:this.props.defaultValue||(this.props.multiple?[]:"")}},componentWillReceiveProps:function(t){!this.props.multiple&&t.multiple?this.setState({value:[this.state.value]}):this.props.multiple&&!t.multiple&&this.setState({value:this.state.value[0]})},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var t=u(this.props);return t.onChange=this._handleChange,t.value=null,c(t,this.props.children)},componentDidMount:r,componentDidUpdate:r,_handleChange:function(t){var e,n=this.getOnChange();n&&(this._isChanging=!0,e=n(t),this._isChanging=!1);var r;if(this.props.multiple){r=[];for(var o=t.target.options,i=0,a=o.length;a>i;i++)o[i].selected&&r.push(o[i].value)}else r=t.target.value;return this.setState({value:r}),e}});e.exports=l},{"./LinkedValueMixin":21,"./ReactCompositeComponent":28,"./ReactDOM":30,"./invariant":94,"./merge":103}],38:[function(t,e){"use strict";function n(t){var e=document.selection,n=e.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(t),o.setEndPoint("EndToStart",n);var i=o.text.length,a=i+r;return{start:i,end:a}}function r(t){var e=window.getSelection();if(0===e.rangeCount)return null;var n=e.anchorNode,r=e.anchorOffset,o=e.focusNode,i=e.focusOffset,a=e.getRangeAt(0),s=a.toString().length,u=a.cloneRange();u.selectNodeContents(t),u.setEnd(a.startContainer,a.startOffset);var c=u.toString().length,l=c+s,p=document.createRange();p.setStart(n,r),p.setEnd(o,i);var d=p.collapsed;return p.detach(),{start:d?l:c,end:d?c:l}}function o(t,e){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof e.end?(n=e.start,r=n):e.start>e.end?(n=e.end,r=e.start):(n=e.start,r=e.end),o.moveToElementText(t),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function i(t,e){var n=window.getSelection(),r=t[s()].length,o=Math.min(e.start,r),i="undefined"==typeof e.end?o:Math.min(e.end,r),u=a(t,o),c=a(t,i);if(u&&c){var l=document.createRange();l.setStart(u.node,u.offset),n.removeAllRanges(),n.addRange(l),n.extend(c.node,c.offset),l.detach()}}var a=t("./getNodeForCharacterOffset"),s=t("./getTextContentAccessor"),u={getOffsets:function(t){var e=document.selection?n:r;return e(t)},setOffsets:function(t,e){var n=document.selection?o:i;n(t,e)}};e.exports=u},{"./getNodeForCharacterOffset":90,"./getTextContentAccessor":92}],39:[function(t,e){"use strict";var n=t("./DOMPropertyOperations"),r=t("./LinkedValueMixin"),o=t("./ReactCompositeComponent"),i=t("./ReactDOM"),a=t("./invariant"),s=t("./merge"),u=i.textarea,c=o.createClass({mixins:[r],getInitialState:function(){var t=this.props.defaultValue,e=this.props.children;null!=e&&(a(null==t),Array.isArray(e)&&(a(e.length<=1),e=e[0]),t=""+e),null==t&&(t="");var n=this.getValue();return{initialValue:""+(null!=n?n:t),value:t}},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var t=s(this.props),e=this.getValue();return a(null==t.dangerouslySetInnerHTML),t.defaultValue=null,t.value=null!=e?e:this.state.value,t.onChange=this._handleChange,u(t,this.state.initialValue)},componentDidUpdate:function(t,e,r){var o=this.getValue();null!=o&&n.setValueForProperty(r,"value",""+o)},_handleChange:function(t){var e,n=this.getOnChange();return n&&(this._isChanging=!0,e=n(t),this._isChanging=!1),this.setState({value:t.target.value}),e}});e.exports=c},{"./DOMPropertyOperations":9,"./LinkedValueMixin":21,"./ReactCompositeComponent":28,"./ReactDOM":30,"./invariant":94,"./merge":103}],40:[function(t,e){"use strict";function n(){this.reinitializeTransaction()}var r=t("./ReactUpdates"),o=t("./Transaction"),i=t("./emptyFunction"),a=t("./mixInto"),s={initialize:i,close:function(){p.isBatchingUpdates=!1}},u={initialize:i,close:r.flushBatchedUpdates.bind(r)},c=[u,s];a(n,o.Mixin),a(n,{getTransactionWrappers:function(){return c}});var l=new n,p={isBatchingUpdates:!1,batchedUpdates:function(t,e){var n=p.isBatchingUpdates;p.isBatchingUpdates=!0,n?t(e):l.perform(t,null,e)}};e.exports=p},{"./ReactUpdates":59,"./Transaction":71,"./emptyFunction":80,"./mixInto":106}],41:[function(t,e){"use strict";function n(){l.TopLevelCallbackCreator=p,y.injection.injectEventPluginOrder(v),y.injection.injectInstanceHandle(E),y.injection.injectEventPluginsByName({SimpleEventPlugin:R,EnterLeaveEventPlugin:g,ChangeEventPlugin:f,CompositionEventPlugin:m,MobileSafariClickEventPlugin:C,SelectEventPlugin:M}),r.injection.injectComponentClasses({button:o,form:i,input:a,option:s,select:u,textarea:c}),h.injection.injectDOMPropertyConfig(d),b.injection.injectBatchingStrategy(D)}var r=t("./ReactDOM"),o=t("./ReactDOMButton"),i=t("./ReactDOMForm"),a=t("./ReactDOMInput"),s=t("./ReactDOMOption"),u=t("./ReactDOMSelect"),c=t("./ReactDOMTextarea"),l=t("./ReactEventEmitter"),p=t("./ReactEventTopLevelCallback");t("./ReactPerf");var d=t("./DefaultDOMPropertyConfig"),h=t("./DOMProperty"),f=t("./ChangeEventPlugin"),m=t("./CompositionEventPlugin"),v=t("./DefaultEventPluginOrder"),g=t("./EnterLeaveEventPlugin"),y=t("./EventPluginHub"),C=t("./MobileSafariClickEventPlugin"),E=t("./ReactInstanceHandles"),M=t("./SelectEventPlugin"),R=t("./SimpleEventPlugin"),D=t("./ReactDefaultBatchingStrategy"),b=t("./ReactUpdates");e.exports={inject:n}},{"./ChangeEventPlugin":5,"./CompositionEventPlugin":6,"./DOMProperty":8,"./DefaultDOMPropertyConfig":11,"./DefaultEventPluginOrder":12,"./EnterLeaveEventPlugin":13,"./EventPluginHub":16,"./MobileSafariClickEventPlugin":22,"./ReactDOM":30,"./ReactDOMButton":31,"./ReactDOMForm":33,"./ReactDOMInput":35,"./ReactDOMOption":36,"./ReactDOMSelect":37,"./ReactDOMTextarea":39,"./ReactDefaultBatchingStrategy":40,"./ReactEventEmitter":42,"./ReactEventTopLevelCallback":44,"./ReactInstanceHandles":46,"./ReactPerf":53,"./ReactUpdates":59,"./SelectEventPlugin":60,"./SimpleEventPlugin":61}],42:[function(t,e){"use strict";function n(t,e,n){a.listen(n,e,f.TopLevelCallbackCreator.createTopLevelCallback(t))}function r(t,e,n){a.capture(n,e,f.TopLevelCallbackCreator.createTopLevelCallback(t))}function o(){var t=l.refreshScrollValues;a.listen(window,"scroll",t),a.listen(window,"resize",t)}var i=t("./EventConstants"),a=t("./EventListener"),s=t("./EventPluginHub"),u=t("./ExecutionEnvironment"),c=t("./ReactEventEmitterMixin"),l=t("./ViewportMetrics"),p=t("./invariant"),d=t("./isEventSupported"),h=t("./merge"),f=h(c,{TopLevelCallbackCreator:null,ensureListening:function(t,e){p(u.canUseDOM),p(f.TopLevelCallbackCreator),c.ensureListening.call(f,{touchNotMouse:t,contentDocument:e})},setEnabled:function(t){p(u.canUseDOM),f.TopLevelCallbackCreator&&f.TopLevelCallbackCreator.setEnabled(t)},isEnabled:function(){return!(!f.TopLevelCallbackCreator||!f.TopLevelCallbackCreator.isEnabled())},listenAtTopLevel:function(t,e){p(!e._isListening);var a=i.topLevelTypes,s=e;o(),n(a.topMouseOver,"mouseover",s),n(a.topMouseDown,"mousedown",s),n(a.topMouseUp,"mouseup",s),n(a.topMouseMove,"mousemove",s),n(a.topMouseOut,"mouseout",s),n(a.topClick,"click",s),n(a.topDoubleClick,"dblclick",s),t&&(n(a.topTouchStart,"touchstart",s),n(a.topTouchEnd,"touchend",s),n(a.topTouchMove,"touchmove",s),n(a.topTouchCancel,"touchcancel",s)),n(a.topKeyUp,"keyup",s),n(a.topKeyPress,"keypress",s),n(a.topKeyDown,"keydown",s),n(a.topInput,"input",s),n(a.topChange,"change",s),n(a.topSelectionChange,"selectionchange",s),n(a.topCompositionEnd,"compositionend",s),n(a.topCompositionStart,"compositionstart",s),n(a.topCompositionUpdate,"compositionupdate",s),d("drag")&&(n(a.topDrag,"drag",s),n(a.topDragEnd,"dragend",s),n(a.topDragEnter,"dragenter",s),n(a.topDragExit,"dragexit",s),n(a.topDragLeave,"dragleave",s),n(a.topDragOver,"dragover",s),n(a.topDragStart,"dragstart",s),n(a.topDrop,"drop",s)),d("wheel")?n(a.topWheel,"wheel",s):d("mousewheel")?n(a.topWheel,"mousewheel",s):n(a.topWheel,"DOMMouseScroll",s),d("scroll",!0)?r(a.topScroll,"scroll",s):n(a.topScroll,"scroll",window),d("focus",!0)?(r(a.topFocus,"focus",s),r(a.topBlur,"blur",s)):d("focusin")&&(n(a.topFocus,"focusin",s),n(a.topBlur,"focusout",s)),d("copy")&&(n(a.topCopy,"copy",s),n(a.topCut,"cut",s),n(a.topPaste,"paste",s))},registrationNames:s.registrationNames,putListener:s.putListener,getListener:s.getListener,deleteListener:s.deleteListener,deleteAllListeners:s.deleteAllListeners,trapBubbledEvent:n,trapCapturedEvent:r});e.exports=f},{"./EventConstants":14,"./EventListener":15,"./EventPluginHub":16,"./ExecutionEnvironment":20,"./ReactEventEmitterMixin":43,"./ViewportMetrics":72,"./invariant":94,"./isEventSupported":95,"./merge":103}],43:[function(t,e){"use strict";function n(t){r.enqueueEvents(t),r.processEventQueue()}var r=t("./EventPluginHub"),o=t("./ReactUpdates"),i={_isListening:!1,ensureListening:function(t){t.contentDocument._reactIsListening||(this.listenAtTopLevel(t.touchNotMouse,t.contentDocument),t.contentDocument._reactIsListening=!0)},handleTopLevel:function(t,e,i,a){var s=r.extractEvents(t,e,i,a);o.batchedUpdates(n,s)}};e.exports=i},{"./EventPluginHub":16,"./ReactUpdates":59}],44:[function(t,e){"use strict";var n=t("./ReactEventEmitter"),r=t("./ReactMount"),o=t("./getEventTarget"),i=!0,a={setEnabled:function(t){i=!!t},isEnabled:function(){return i},createTopLevelCallback:function(t){return function(e){if(i){e.srcElement&&e.srcElement!==e.target&&(e.target=e.srcElement);var a=r.getFirstReactDOM(o(e))||window,s=r.getID(a)||"";n.handleTopLevel(t,a,s,e)}}}};e.exports=a},{"./ReactEventEmitter":42,"./ReactMount":48,"./getEventTarget":88}],45:[function(t,e){"use strict";function n(t){return i(document.documentElement,t)}var r=t("./ReactDOMSelection"),o=t("./getActiveElement"),i=t("./nodeContains"),a={hasSelectionCapabilities:function(t){return t&&("INPUT"===t.nodeName&&"text"===t.type||"TEXTAREA"===t.nodeName||"true"===t.contentEditable)},getSelectionInformation:function(){var t=o();return{focusedElem:t,selectionRange:a.hasSelectionCapabilities(t)?a.getSelection(t):null}},restoreSelection:function(t){var e=o(),r=t.focusedElem,i=t.selectionRange;e!==r&&n(r)&&(a.hasSelectionCapabilities(r)&&a.setSelection(r,i),r.focus())},getSelection:function(t){var e;if("selectionStart"in t)e={start:t.selectionStart,end:t.selectionEnd};else if(document.selection&&"INPUT"===t.nodeName){var n=document.selection.createRange();n.parentElement()===t&&(e={start:-n.moveStart("character",-t.value.length),end:-n.moveEnd("character",-t.value.length)})}else e=r.getOffsets(t);return e||{start:0,end:0}},setSelection:function(t,e){var n=e.start,o=e.end;if("undefined"==typeof o&&(o=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(o,t.value.length);else if(document.selection&&"INPUT"===t.nodeName){var i=t.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(t,e)}};e.exports=a},{"./ReactDOMSelection":38,"./getActiveElement":87,"./nodeContains":108}],46:[function(t,e){"use strict";function n(t){return p+"r["+t.toString(36)+"]"}function r(t,e){return t.charAt(e)===p||e===t.length}function o(t){return""===t||t.charAt(0)===p&&t.charAt(t.length-1)!==p}function i(t,e){return 0===e.indexOf(t)&&r(e,t.length)}function a(t){return t?t.substr(0,t.lastIndexOf(p)):""}function s(t,e){if(l(o(t)&&o(e)),l(i(t,e)),t===e)return t;for(var n=t.length+d,a=n;a<e.length&&!r(e,a);a++);return e.substr(0,a)}function u(t,e){var n=Math.min(t.length,e.length);if(0===n)return"";for(var i=0,a=0;n>=a;a++)if(r(t,a)&&r(e,a))i=a;else if(t.charAt(a)!==e.charAt(a))break;var s=t.substr(0,i);return l(o(s)),s}function c(t,e,n,r,o,u){t=t||"",e=e||"",l(t!==e);var c=i(e,t);l(c||i(t,e));for(var p=0,d=c?a:s,f=t;o&&f===t||u&&f===e||n(f,c,r),f!==e;f=d(f,e))l(p++<h)}var l=t("./invariant"),p=".",d=p.length,h=100,f=9999999,m={createReactRootID:function(){return n(Math.ceil(Math.random()*f))},createReactID:function(t,e){return t+p+e},getReactRootIDFromNodeID:function(t){var e=/\.r\[[^\]]+\]/.exec(t);return e&&e[0]},traverseEnterLeave:function(t,e,n,r,o){var i=u(t,e);i!==t&&c(t,i,n,r,!1,!0),i!==e&&c(i,e,n,o,!0,!1)},traverseTwoPhase:function(t,e,n){t&&(c("",t,e,n,!0,!1),c(t,"",e,n,!1,!0))},_getFirstCommonAncestorID:u,_getNextDescendantID:s,isAncestorIDOf:i,SEPARATOR:p};e.exports=m},{"./invariant":94}],47:[function(t,e){"use strict";var n=t("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(t){var e=n(t);return t.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+e+'">')},canReuseMarkup:function(t,e){var o=e.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var i=n(t);return i===o}};e.exports=r},{"./adler32":74}],48:[function(t,e){"use strict";function n(t){var e=d(t);return e&&R.getID(e)}function r(t){var e=o(t);if(e)if(g.hasOwnProperty(e)){var n=g[e];n!==t&&(h(!s(n,e)),g[e]=t)}else g[e]=t;return e}function o(t){return t&&t.getAttribute&&t.getAttribute(v)||""}function i(t,e){var n=o(t);n!==e&&delete g[n],t.setAttribute(v,e),g[e]=t}function a(t){return g.hasOwnProperty(t)&&s(g[t],t)||(g[t]=R.findReactNodeByID(t)),g[t]}function s(t,e){if(t){h(o(t)===e);var n=R.findReactContainerForID(e);if(n&&f(n,t))return!0}return!1}function u(t){delete g[t]}var c=t("./ReactEventEmitter"),l=t("./ReactInstanceHandles"),p=t("./$"),d=t("./getReactRootElementInContainer"),h=t("./invariant"),f=t("./nodeContains"),m=l.SEPARATOR,v="data-reactid",g={},y=1,C=9,E={},M={},R={allowFullPageRender:!1,totalInstantiationTime:0,totalInjectionTime:0,useTouchEvents:!1,_instancesByReactRootID:E,scrollMonitor:function(t,e){e()},prepareEnvironmentForDOM:function(t){h(t&&(t.nodeType===y||t.nodeType===C));var e=t.nodeType===y?t.ownerDocument:t;c.ensureListening(R.useTouchEvents,e)},_updateRootComponent:function(t,e,n,r){var o=e.props;return R.scrollMonitor(n,function(){t.replaceProps(o,r)}),t},_registerComponent:function(t,e){R.prepareEnvironmentForDOM(e);var n=R.registerContainer(e);return E[n]=t,n},_renderNewRootComponent:function(t,e,n){var r=R._registerComponent(t,e);return t.mountComponentIntoNode(r,e,n),t},renderComponent:function(t,e,r){var o=E[n(e)];if(o){if(o.constructor===t.constructor)return R._updateRootComponent(o,t,e,r);R.unmountComponentAtNode(e)}var i=d(e),a=i&&R.isRenderedByReact(i),s=a&&!o,u=R._renderNewRootComponent(t,e,s);return r&&r(),u},constructAndRenderComponent:function(t,e,n){return R.renderComponent(t(e),n)},constructAndRenderComponentByID:function(t,e,n){return R.constructAndRenderComponent(t,e,p(n))},registerContainer:function(t){var e=n(t);return e&&(e=l.getReactRootIDFromNodeID(e)),e||(e=l.createReactRootID()),M[e]=t,e},unmountComponentAtNode:function(t){var e=n(t),r=E[e];return r?(R.unmountComponentFromNode(r,t),delete E[e],delete M[e],!0):!1},unmountAndReleaseReactRootNode:function(){return R.unmountComponentAtNode.apply(this,arguments)},unmountComponentFromNode:function(t,e){for(t.unmountComponent();e.lastChild;)e.removeChild(e.lastChild)},findReactContainerForID:function(t){var e=l.getReactRootIDFromNodeID(t),n=M[e];return n},findReactNodeByID:function(t){var e=R.findReactContainerForID(t);return R.findComponentRoot(e,t)},isRenderedByReact:function(t){if(1!==t.nodeType)return!1;var e=R.getID(t);return e?e.charAt(0)===m:!1},getFirstReactDOM:function(t){for(var e=t;e&&e.parentNode!==e;){if(R.isRenderedByReact(e))return e;e=e.parentNode}return null},findComponentRoot:function(t,e){for(var n=[t.firstChild],r=0;r<n.length;)for(var o=n[r++];o;){var i=R.getID(o);if(i){if(e===i)return o;if(l.isAncestorIDOf(i,e)){n.length=r=0,n.push(o.firstChild);break}n.push(o.firstChild)}else n.push(o.firstChild);o=o.nextSibling}h(!1)},ATTR_NAME:v,getID:r,setID:i,getNode:a,purgeID:u,injection:{}};e.exports=R},{"./$":1,"./ReactEventEmitter":42,"./ReactInstanceHandles":46,"./getReactRootElementInContainer":91,"./invariant":94,"./nodeContains":108}],49:[function(t,e){"use strict";function n(t){this._queue=t||null}var r=t("./PooledClass"),o=t("./mixInto");o(n,{enqueue:function(t,e){this._queue=this._queue||[],this._queue.push({component:t,callback:e})},notifyAll:function(){var t=this._queue;if(t){this._queue=null;for(var e=0,n=t.length;n>e;e++){var r=t[e].component,o=t[e].callback;o.call(r,r.getDOMNode())}t.length=0}},reset:function(){this._queue=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),e.exports=n},{"./PooledClass":23,"./mixInto":106}],50:[function(t,e){"use strict";function n(t,e){return t&&e&&t.constructor===e.constructor}function r(t,e,n){h.push({parentID:t,parentNode:null,type:l.INSERT_MARKUP,markupIndex:f.push(e)-1,fromIndex:null,textContent:null,toIndex:n})}function o(t,e,n){h.push({parentID:t,parentNode:null,type:l.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:e,toIndex:n})}function i(t,e){h.push({parentID:t,parentNode:null,type:l.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:e,toIndex:null})}function a(t,e){h.push({parentID:t,parentNode:null,type:l.TEXT_CONTENT,markupIndex:null,textContent:e,fromIndex:null,toIndex:null})}function s(){h.length&&(c.DOMIDOperations.dangerouslyProcessChildrenUpdates(h,f),u())}function u(){h.length=0,f.length=0}var c=t("./ReactComponent"),l=t("./ReactMultiChildUpdateTypes"),p=t("./flattenChildren"),d=0,h=[],f=[],m={Mixin:{mountChildren:function(t,e){var n=p(t),r=[],o=0;this._renderedChildren=n;for(var i in n){var a=n[i];if(n.hasOwnProperty(i)&&a){var s=this._rootNodeID+"."+i,u=a.mountComponent(s,e,this._mountDepth+1);a._mountImage=u,a._mountIndex=o,r.push(u),o++}}return r},updateTextContent:function(t){d++;try{var e=this._renderedChildren;for(var n in e)e.hasOwnProperty(n)&&e[n]&&this._unmountChildByName(e[n],n);this.setTextContent(t)}catch(r){throw d--,d||u(),r}d--,d||s()},updateChildren:function(t,e){d++;try{this._updateChildren(t,e)}catch(n){throw d--,d||u(),n}d--,d||s()},_updateChildren:function(t,e){var r=p(t),o=this._renderedChildren;if(r||o){var i,a=0,s=0;for(i in r)if(r.hasOwnProperty(i)){var u=o&&o[i],c=r[i];n(u,c)?(this.moveChild(u,s,a),a=Math.max(u._mountIndex,a),u.receiveProps(c.props,e),u._mountIndex=s):(u&&(a=Math.max(u._mountIndex,a),this._unmountChildByName(u,i)),c&&this._mountChildByNameAtIndex(c,i,s,e)),c&&s++}for(i in o)!o.hasOwnProperty(i)||!o[i]||r&&r[i]||this._unmountChildByName(o[i],i)}},unmountChildren:function(){var t=this._renderedChildren;for(var e in t){var n=t[e];n&&n.unmountComponent&&n.unmountComponent()}this._renderedChildren=null},moveChild:function(t,e,n){t._mountIndex<n&&o(this._rootNodeID,t._mountIndex,e)},createChild:function(t){r(this._rootNodeID,t._mountImage,t._mountIndex)},removeChild:function(t){i(this._rootNodeID,t._mountIndex)},setTextContent:function(t){a(this._rootNodeID,t)},_mountChildByNameAtIndex:function(t,e,n,r){var o=this._rootNodeID+"."+e,i=t.mountComponent(o,r,this._mountDepth+1);t._mountImage=i,t._mountIndex=n,this.createChild(t),this._renderedChildren=this._renderedChildren||{},this._renderedChildren[e]=t},_unmountChildByName:function(t,e){c.isValidComponent(t)&&(this.removeChild(t),t._mountImage=null,t._mountIndex=null,t.unmountComponent(),delete this._renderedChildren[e])}}};e.exports=m},{"./ReactComponent":25,"./ReactMultiChildUpdateTypes":51,"./flattenChildren":84}],51:[function(t,e){var n=t("./keyMirror"),r=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=r},{"./keyMirror":100}],52:[function(t,e){"use strict";var n=t("./invariant"),r={isValidOwner:function(t){return!(!t||"function"!=typeof t.attachRef||"function"!=typeof t.detachRef)},addComponentAsRefTo:function(t,e,o){n(r.isValidOwner(o)),o.attachRef(e,t)},removeComponentAsRefFrom:function(t,e,o){n(r.isValidOwner(o)),o.refs[e]===t&&o.detachRef(e)},Mixin:{attachRef:function(t,e){n(e.isOwnedBy(this));var r=this.refs||(this.refs={});r[t]=e},detachRef:function(t){delete this.refs[t]}}};e.exports=r},{"./invariant":94}],53:[function(t,e){"use strict";function n(t,e,n){return n}var r={enableMeasure:!1,storedMeasure:n,measure:function(t,e,n){return n | |
},injection:{injectMeasure:function(t){r.storedMeasure=t}}};e.exports=r},{}],54:[function(t,e){"use strict";function n(t){return function(e,n,r){e[n]=e.hasOwnProperty(n)?t(e[n],r):r}}var r=t("./emptyFunction"),o=t("./invariant"),i=t("./joinClasses"),a=t("./merge"),s={children:r,className:n(i),ref:r,style:n(a)},u={TransferStrategies:s,Mixin:{transferPropsTo:function(t){o(t.props.__owner__===this);var e={};for(var n in t.props)t.props.hasOwnProperty(n)&&(e[n]=t.props[n]);for(var r in this.props)if(this.props.hasOwnProperty(r)){var i=s[r];i?i(e,r,this.props[r]):e.hasOwnProperty(r)||(e[r]=this.props[r])}return t.props=e,t}}};e.exports=u},{"./emptyFunction":80,"./invariant":94,"./joinClasses":99,"./merge":103}],55:[function(t,e){"use strict";function n(t){function e(e){var n=typeof e;"object"===n&&Array.isArray(e)&&(n="array"),s(n===t)}return i(e)}function r(t){function e(t){s(n[t])}var n=a(t);return i(e)}function o(t){function e(e){s(e instanceof t)}return i(e)}function i(t){function e(n){function r(e,r,o){var i=e[r];null!=i?t(i,r,o||c):s(!n)}return n||(r.isRequired=e(!0)),r}return e(!1)}var a=t("./createObjectFrom"),s=t("./invariant"),u={array:n("array"),bool:n("boolean"),func:n("function"),number:n("number"),object:n("object"),string:n("string"),oneOf:r,instanceOf:o},c="<<anonymous>>";e.exports=u},{"./createObjectFrom":78,"./invariant":94}],56:[function(t,e){"use strict";function n(){this.reinitializeTransaction(),this.reactMountReady=s.getPooled(null)}var r=t("./ExecutionEnvironment"),o=t("./PooledClass"),i=t("./ReactEventEmitter"),a=t("./ReactInputSelection"),s=t("./ReactMountReady"),u=t("./Transaction"),c=t("./mixInto"),l={initialize:a.getSelectionInformation,close:a.restoreSelection},p={initialize:function(){var t=i.isEnabled();return i.setEnabled(!1),t},close:function(t){i.setEnabled(t)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h=[l,p,d],f={getTransactionWrappers:function(){return r.canUseDOM?h:[]},getReactMountReady:function(){return this.reactMountReady},destructor:function(){s.release(this.reactMountReady),this.reactMountReady=null}};c(n,u.Mixin),c(n,f),o.addPoolingTo(n),e.exports=n},{"./ExecutionEnvironment":20,"./PooledClass":23,"./ReactEventEmitter":42,"./ReactInputSelection":45,"./ReactMountReady":49,"./Transaction":71,"./mixInto":106}],57:[function(t,e){"use strict";function n(t,e){var n=i.createReactRootID(),a=o.getPooled();a.reinitializeTransaction();try{a.perform(function(){var o=t.mountComponent(n,a,0);o=r.addChecksumToMarkup(o),e(o)},null)}finally{o.release(a)}}var r=t("./ReactMarkupChecksum"),o=t("./ReactReconcileTransaction"),i=t("./ReactInstanceHandles");e.exports={renderComponentToString:n}},{"./ReactInstanceHandles":46,"./ReactMarkupChecksum":47,"./ReactReconcileTransaction":56}],58:[function(t,e){"use strict";var n=t("./ReactComponent"),r=t("./ReactMount"),o=t("./escapeTextForBrowser"),i=t("./mixInto"),a=function(t){this.construct({text:t})};i(a,n.Mixin),i(a,{mountComponent:function(t,e,i){return n.Mixin.mountComponent.call(this,t,e,i),"<span "+r.ATTR_NAME+'="'+t+'">'+o(this.props.text)+"</span>"},receiveProps:function(t){t.text!==this.props.text&&(this.props.text=t.text,n.DOMIDOperations.updateTextContentByID(this._rootNodeID,t.text))}}),e.exports=a},{"./ReactComponent":25,"./ReactMount":48,"./escapeTextForBrowser":81,"./mixInto":106}],59:[function(t,e){"use strict";function n(){c(p)}function r(t,e){n(),p.batchedUpdates(t,e)}function o(t,e){return t._mountDepth-e._mountDepth}function i(){l.sort(o);for(var t=0;t<l.length;t++){var e=l[t];if(e.isMounted()){var n=e._pendingCallbacks;if(e._pendingCallbacks=null,e.performUpdateIfNecessary(),n)for(var r=0;r<n.length;r++)n[r].call(e)}}}function a(){l.length=0}function s(){try{i()}catch(t){throw t}finally{a()}}function u(t,e){return c(!e||"function"==typeof e),n(),p.isBatchingUpdates?(l.push(t),e&&(t._pendingCallbacks?t._pendingCallbacks.push(e):t._pendingCallbacks=[e]),void 0):(t.performUpdateIfNecessary(),e&&e(),void 0)}var c=t("./invariant"),l=[],p=null,d={injectBatchingStrategy:function(t){c(t),c("function"==typeof t.batchedUpdates),c("boolean"==typeof t.isBatchingUpdates),p=t}},h={batchedUpdates:r,enqueueUpdate:u,flushBatchedUpdates:s,injection:d};e.exports=h},{"./invariant":94}],60:[function(t,e){"use strict";function n(t){if("selectionStart"in t)return{start:t.selectionStart,end:t.selectionEnd};if(document.selection){var e=document.selection.createRange();return{parentElement:e.parentElement(),text:e.text,top:e.boundingTop,left:e.boundingLeft}}var n=window.getSelection();return{anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}}function r(t){if(!D&&C==l()){var e=n(C);if(!R||!f(R,e)){R=e;var r=c.getPooled(v.select,E,t);return r.type="select",r.target=C,s.accumulateTwoPhaseDispatches(r),r}}}function o(){if(M){var t=r(M);M=null,t&&(a.enqueueEvents(t),a.processEventQueue())}}var i=t("./EventConstants"),a=t("./EventPluginHub"),s=t("./EventPropagators"),u=t("./ExecutionEnvironment"),c=t("./SyntheticEvent"),l=t("./getActiveElement"),p=t("./isEventSupported"),d=t("./isTextInputElement"),h=t("./keyOf"),f=t("./shallowEqual"),m=i.topLevelTypes,v={select:{phasedRegistrationNames:{bubbled:h({onSelect:null}),captured:h({onSelectCapture:null})}}},g=!1,y=!1;u.canUseDOM&&(g="onselectionchange"in document,y=p("select"));var C=null,E=null,M=null,R=null,D=!1,b={eventTypes:v,extractEvents:function(t,e,n,i){switch(t){case m.topFocus:(d(e)||"true"===e.contentEditable)&&(C=e,E=n,R=null,D=!1);break;case m.topBlur:C=null,E=null,R=null,D=!1;break;case m.topMouseDown:D=!0;break;case m.topMouseUp:return D=!1,r(i);case m.topSelectionChange:return r(i);case m.topKeyDown:g||(M=i,setTimeout(o,0))}}};e.exports=b},{"./EventConstants":14,"./EventPluginHub":16,"./EventPropagators":19,"./ExecutionEnvironment":20,"./SyntheticEvent":64,"./getActiveElement":87,"./isEventSupported":95,"./isTextInputElement":97,"./keyOf":101,"./shallowEqual":111}],61:[function(t,e){"use strict";var n=t("./EventConstants"),r=t("./EventPropagators"),o=t("./SyntheticClipboardEvent"),i=t("./SyntheticEvent"),a=t("./SyntheticFocusEvent"),s=t("./SyntheticKeyboardEvent"),u=t("./SyntheticMouseEvent"),c=t("./SyntheticTouchEvent"),l=t("./SyntheticUIEvent"),p=t("./SyntheticWheelEvent"),d=t("./invariant"),h=t("./keyOf"),f=n.topLevelTypes,m={blur:{phasedRegistrationNames:{bubbled:h({onBlur:!0}),captured:h({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:h({onClick:!0}),captured:h({onClickCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:h({onCopy:!0}),captured:h({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:h({onCut:!0}),captured:h({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:h({onDoubleClick:!0}),captured:h({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:h({onDrag:!0}),captured:h({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:h({onDragEnd:!0}),captured:h({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:h({onDragEnter:!0}),captured:h({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:h({onDragExit:!0}),captured:h({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:h({onDragLeave:!0}),captured:h({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:h({onDragOver:!0}),captured:h({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:h({onDragStart:!0}),captured:h({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:h({onDrop:!0}),captured:h({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:h({onFocus:!0}),captured:h({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:h({onInput:!0}),captured:h({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:h({onKeyDown:!0}),captured:h({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:h({onKeyPress:!0}),captured:h({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:h({onKeyUp:!0}),captured:h({onKeyUpCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:h({onMouseDown:!0}),captured:h({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:h({onMouseMove:!0}),captured:h({onMouseMoveCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:h({onMouseUp:!0}),captured:h({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:h({onPaste:!0}),captured:h({onPasteCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:h({onScroll:!0}),captured:h({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:h({onSubmit:!0}),captured:h({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:h({onTouchCancel:!0}),captured:h({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:h({onTouchEnd:!0}),captured:h({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:h({onTouchMove:!0}),captured:h({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:h({onTouchStart:!0}),captured:h({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:h({onWheel:!0}),captured:h({onWheelCapture:!0})}}},v={topBlur:m.blur,topClick:m.click,topCopy:m.copy,topCut:m.cut,topDoubleClick:m.doubleClick,topDrag:m.drag,topDragEnd:m.dragEnd,topDragEnter:m.dragEnter,topDragExit:m.dragExit,topDragLeave:m.dragLeave,topDragOver:m.dragOver,topDragStart:m.dragStart,topDrop:m.drop,topFocus:m.focus,topInput:m.input,topKeyDown:m.keyDown,topKeyPress:m.keyPress,topKeyUp:m.keyUp,topMouseDown:m.mouseDown,topMouseMove:m.mouseMove,topMouseUp:m.mouseUp,topPaste:m.paste,topScroll:m.scroll,topSubmit:m.submit,topTouchCancel:m.touchCancel,topTouchEnd:m.touchEnd,topTouchMove:m.touchMove,topTouchStart:m.touchStart,topWheel:m.wheel},g={eventTypes:m,executeDispatch:function(t,e,n){var r=e(t,n);r===!1&&(t.stopPropagation(),t.preventDefault())},extractEvents:function(t,e,n,h){var m=v[t];if(!m)return null;var g;switch(t){case f.topInput:case f.topSubmit:g=i;break;case f.topKeyDown:case f.topKeyPress:case f.topKeyUp:g=s;break;case f.topBlur:case f.topFocus:g=a;break;case f.topClick:if(2===h.button)return null;case f.topDoubleClick:case f.topDrag:case f.topDragEnd:case f.topDragEnter:case f.topDragExit:case f.topDragLeave:case f.topDragOver:case f.topDragStart:case f.topDrop:case f.topMouseDown:case f.topMouseMove:case f.topMouseUp:g=u;break;case f.topTouchCancel:case f.topTouchEnd:case f.topTouchMove:case f.topTouchStart:g=c;break;case f.topScroll:g=l;break;case f.topWheel:g=p;break;case f.topCopy:case f.topCut:case f.topPaste:g=o}d(g);var y=g.getPooled(m,n,h);return r.accumulateTwoPhaseDispatches(y),y}};e.exports=g},{"./EventConstants":14,"./EventPropagators":19,"./SyntheticClipboardEvent":62,"./SyntheticEvent":64,"./SyntheticFocusEvent":65,"./SyntheticKeyboardEvent":66,"./SyntheticMouseEvent":67,"./SyntheticTouchEvent":68,"./SyntheticUIEvent":69,"./SyntheticWheelEvent":70,"./invariant":94,"./keyOf":101}],62:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticEvent"),o={clipboardData:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticEvent":64}],63:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticEvent"),o={data:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticEvent":64}],64:[function(t,e){"use strict";function n(t,e,n){this.dispatchConfig=t,this.dispatchMarker=e,this.nativeEvent=n;var r=this.constructor.Interface;for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];this[i]=a?a(n):n[i]}this.isDefaultPrevented=n.defaultPrevented||n.returnValue===!1?o.thatReturnsTrue:o.thatReturnsFalse,this.isPropagationStopped=o.thatReturnsFalse}var r=t("./PooledClass"),o=t("./emptyFunction"),i=t("./getEventTarget"),a=t("./merge"),s=t("./mergeInto"),u={type:null,target:i,currentTarget:null,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};s(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t.preventDefault?t.preventDefault():t.returnValue=!1,this.isDefaultPrevented=o.thatReturnsTrue},stopPropagation:function(){var t=this.nativeEvent;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this.isPropagationStopped=o.thatReturnsTrue},persist:function(){this.isPersistent=o.thatReturnsTrue},isPersistent:o.thatReturnsFalse,destructor:function(){var t=this.constructor.Interface;for(var e in t)this[e]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),n.Interface=u,n.augmentClass=function(t,e){var n=this,o=Object.create(n.prototype);s(o,t.prototype),t.prototype=o,t.prototype.constructor=t,t.Interface=a(n.Interface,e),t.augmentClass=n.augmentClass,r.addPoolingTo(t,r.threeArgumentPooler)},r.addPoolingTo(n,r.threeArgumentPooler),e.exports=n},{"./PooledClass":23,"./emptyFunction":80,"./getEventTarget":88,"./merge":103,"./mergeInto":105}],65:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o={relatedTarget:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticUIEvent":69}],66:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o={"char":null,key:null,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,charCode:null,keyCode:null,which:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticUIEvent":69}],67:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o=t("./ViewportMetrics"),i={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,button:function(t){var e=t.button;return"which"in t?e:2===e?2:4===e?1:0},buttons:null,relatedTarget:function(t){return t.relatedTarget||(t.fromElement===t.srcElement?t.toElement:t.fromElement)},pageX:function(t){return"pageX"in t?t.pageX:t.clientX+o.currentScrollLeft},pageY:function(t){return"pageY"in t?t.pageY:t.clientY+o.currentScrollTop}};r.augmentClass(n,i),e.exports=n},{"./SyntheticUIEvent":69,"./ViewportMetrics":72}],68:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticUIEvent":69}],69:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticEvent"),o={view:null,detail:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticEvent":64}],70:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticMouseEvent"),o={deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?-t.deltaY:"wheelDeltaY"in t?t.wheelDeltaY:"wheelDelta"in t?t.wheelData:0},deltaZ:null,deltaMode:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticMouseEvent":67}],71:[function(t,e){"use strict";var n=t("./invariant"),r={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this.timingMetrics||(this.timingMetrics={}),this.timingMetrics.methodInvocationTime=0,this.timingMetrics.wrapperInitTimes?this.timingMetrics.wrapperInitTimes.length=0:this.timingMetrics.wrapperInitTimes=[],this.timingMetrics.wrapperCloseTimes?this.timingMetrics.wrapperCloseTimes.length=0:this.timingMetrics.wrapperCloseTimes=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(t,e,r,o,i,a,s,u){n(!this.isInTransaction());var c,l=Date.now(),p=null;try{this.initializeAll(),c=t.call(e,r,o,i,a,s,u)}catch(d){p=d}finally{var h=Date.now();this.methodInvocationTime+=h-l;try{this.closeAll()}catch(f){p=p||f}}if(p)throw p;return c},initializeAll:function(){this._isInTransaction=!0;for(var t=this.transactionWrappers,e=this.timingMetrics.wrapperInitTimes,n=null,r=0;r<t.length;r++){var i=Date.now(),a=t[r];try{this.wrapperInitData[r]=a.initialize?a.initialize.call(this):null}catch(s){n=n||s,this.wrapperInitData[r]=o.OBSERVED_ERROR}finally{var u=e[r],c=Date.now();e[r]=(u||0)+(c-i)}}if(n)throw n},closeAll:function(){n(this.isInTransaction());for(var t=this.transactionWrappers,e=this.timingMetrics.wrapperCloseTimes,r=null,i=0;i<t.length;i++){var a=t[i],s=Date.now(),u=this.wrapperInitData[i];try{u!==o.OBSERVED_ERROR&&a.close&&a.close.call(this,u)}catch(c){r=r||c}finally{var l=Date.now(),p=e[i];e[i]=(p||0)+(l-s)}}if(this.wrapperInitData.length=0,this._isInTransaction=!1,r)throw r}},o={Mixin:r,OBSERVED_ERROR:{}};e.exports=o},{"./invariant":94}],72:[function(t,e){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(){n.currentScrollLeft=document.body.scrollLeft+document.documentElement.scrollLeft,n.currentScrollTop=document.body.scrollTop+document.documentElement.scrollTop}};e.exports=n},{}],73:[function(t,e){"use strict";function n(t,e){if(r(null!=e),null==t)return e;var n=Array.isArray(t),o=Array.isArray(e);return n?t.concat(e):o?[t].concat(e):[t,e]}var r=t("./invariant");e.exports=n},{"./invariant":94}],74:[function(t,e){"use strict";function n(t){for(var e=1,n=0,o=0;o<t.length;o++)e=(e+t.charCodeAt(o))%r,n=(n+e)%r;return e|n<<16}var r=65521;e.exports=n},{}],75:[function(t,e){function n(t,e,n,r,o,i){t=t||{};for(var a,s=[e,n,r,o,i],u=0;s[u];){a=s[u++];for(var c in a)t[c]=a[c];a.hasOwnProperty&&a.hasOwnProperty("toString")&&"undefined"!=typeof a.toString&&t.toString!==a.toString&&(t.toString=a.toString)}return t}e.exports=n},{}],76:[function(t,e){function n(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"length"in t&&!("setInterval"in t)&&"number"!=typeof t.nodeType&&(Array.isArray(t)||"callee"in t||"item"in t)}function r(t){if(!n(t))return[t];if(t.item){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}return Array.prototype.slice.call(t)}e.exports=r},{}],77:[function(t,e){function n(t){var e=t.match(c);return e&&e[1].toLowerCase()}function r(t,e){var r=u;s(!!u);var o=n(t),c=o&&a(o);if(c){r.innerHTML=c[1]+t+c[2];for(var l=c[0];l--;)r=r.lastChild}else r.innerHTML=t;var p=r.getElementsByTagName("script");p.length&&(s(e),i(p).forEach(e));for(var d=i(r.childNodes);r.lastChild;)r.removeChild(r.lastChild);return d}var o=t("./ExecutionEnvironment"),i=t("./createArrayFrom"),a=t("./getMarkupWrap"),s=t("./invariant"),u=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=r},{"./ExecutionEnvironment":20,"./createArrayFrom":76,"./getMarkupWrap":89,"./invariant":94}],78:[function(t,e){function n(t,e){var n={},r=Array.isArray(e);"undefined"==typeof e&&(e=!0);for(var o=t.length;o--;)n[t[o]]=r?e[o]:e;return n}e.exports=n},{}],79:[function(t,e){"use strict";function n(t,e){var n=null==e||"boolean"==typeof e||""===e;if(n)return"";var o=isNaN(e);return o||0===e||r.isUnitlessNumber[t]?""+e:e+"px"}var r=t("./CSSProperty");e.exports=n},{"./CSSProperty":2}],80:[function(t,e){function n(t){return function(){return t}}function r(){}var o=t("./copyProperties");o(r,{thatReturns:n,thatReturnsFalse:n(!1),thatReturnsTrue:n(!0),thatReturnsNull:n(null),thatReturnsThis:function(){return this},thatReturnsArgument:function(t){return t}}),e.exports=r},{"./copyProperties":75}],81:[function(t,e){"use strict";function n(t){return o[t]}function r(t){return(""+t).replace(i,n)}var o={"&":"&",">":">","<":"<",'"':""","'":"'","/":"/"},i=/[&><"'\/]/g;e.exports=r},{}],82:[function(t,e){var n=function(t){var e=Array.prototype.slice.call(arguments).map(function(t){return String(t)}),r=t.split("%s").length-1;return r!==e.length-1?n("ex args number mismatch: %s",JSON.stringify(e)):n._prefix+JSON.stringify(e)+n._suffix};n._prefix="<![EX[",n._suffix="]]>",e.exports=n},{}],83:[function(t,e){"use strict";function n(t,e,n){for(var r=t.attributes,o=r.length,i=[],a=0;o>a;a++){var s=r.item(a);e.call(n,s)&&i.push(s)}return i}e.exports=n},{}],84:[function(t,e){"use strict";function n(t,e,n){var r=t;o(!r.hasOwnProperty(n)),r[n]=e}function r(t){if(null==t)return t;var e={};return i(t,n,e),e}var o=t("./invariant"),i=t("./traverseAllChildren");e.exports=r},{"./invariant":94,"./traverseAllChildren":112}],85:[function(t,e){"use strict";var n=function(t,e,n){Array.isArray(t)?t.forEach(e,n):t&&e.call(n,t)};e.exports=n},{}],86:[function(t,e){function n(t,e,n){return"string"!=typeof t?t:e?r(t,e,n):document.getElementById(t)}function r(t,e,n){var i,a,s;if(o(e)==t)return e;if(e.getElementsByTagName){for(a=e.getElementsByTagName(n||"*"),s=0;s<a.length;s++)if(o(a[s])==t)return a[s]}else for(a=e.childNodes,s=0;s<a.length;s++)if(i=r(t,a[s]))return i;return null}function o(t){var e=t.getAttributeNode&&t.getAttributeNode("id");return e?e.value:null}e.exports=n},{}],87:[function(t,e){function n(){try{return document.activeElement}catch(t){return null}}e.exports=n},{}],88:[function(t,e){"use strict";function n(t){var e=t.target||t.srcElement||window;return 3===e.nodeType?e.parentNode:e}e.exports=n},{}],89:[function(t,e){function n(t){return o(!!i),p.hasOwnProperty(t)||(t="*"),a.hasOwnProperty(t)||(i.innerHTML="*"===t?"<link />":"<"+t+"></"+t+">",a[t]=!i.firstChild),a[t]?p[t]:null}var r=t("./ExecutionEnvironment"),o=t("./invariant"),i=r.canUseDOM?document.createElement("div"):null,a={circle:!0,g:!0,line:!0,path:!0,polyline:!0,rect:!0,text:!0},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,"<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:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c,circle:l,g:l,line:l,path:l,polyline:l,rect:l,text:l};e.exports=n},{"./ExecutionEnvironment":20,"./invariant":94}],90:[function(t,e){"use strict";function n(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function r(t){for(;t;){if(t.nextSibling)return t.nextSibling;t=t.parentNode}}function o(t,e){for(var o=n(t),i=0,a=0;o;){if(3==o.nodeType){if(a=i+o.textContent.length,e>=i&&a>=e)return{node:o,offset:e-i};i=a}o=n(r(o))}}e.exports=o},{}],91:[function(t,e){"use strict";function n(t){return t&&t.firstChild}e.exports=n},{}],92:[function(t,e){"use strict";function n(){return!o&&r.canUseDOM&&(o="innerText"in document.createElement("div")?"innerText":"textContent"),o}var r=t("./ExecutionEnvironment"),o=null;e.exports=n},{"./ExecutionEnvironment":20}],93:[function(t,e){function n(t){return t.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},{}],94:[function(t,e){function n(t){if(!t)throw new Error("Invariant Violation")}e.exports=n},{}],95:[function(t,e){"use strict";function n(t,e){if(!r||e&&!r.addEventListener)return!1;var n=document.createElement("div"),i="on"+t,a=i in n;return a||(n.setAttribute(i,"return;"),a="function"==typeof n[i],"undefined"!=typeof n[i]&&(n[i]=void 0),n.removeAttribute(i)),!a&&o&&"wheel"===t&&(a=document.implementation.hasFeature("Events.wheel","3.0")),n=null,a}var r,o,i=t("./ExecutionEnvironment");i.canUseDOM&&(r=document.createElement("div"),o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},{"./ExecutionEnvironment":20}],96:[function(t,e){function n(t){return!(!t||!("undefined"!=typeof Node?t instanceof Node:"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName))}e.exports=n},{}],97:[function(t,e){"use strict";function n(t){return t&&("INPUT"===t.nodeName&&r[t.type]||"TEXTAREA"===t.nodeName)}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};e.exports=n},{}],98:[function(t,e){function n(t){return r(t)&&3==t.nodeType}var r=t("./isNode");e.exports=n},{"./isNode":96}],99:[function(t,e){"use strict";function n(t){t||(t="");var e,n=arguments.length;if(n>1)for(var r=1;n>r;r++)e=arguments[r],e&&(t+=" "+e);return t}e.exports=n},{}],100:[function(t,e){"use strict";var n=t("./invariant"),r=function(t){var e,r={};n(t instanceof Object&&!Array.isArray(t));for(e in t)t.hasOwnProperty(e)&&(r[e]=e);return r};e.exports=r},{"./invariant":94}],101:[function(t,e){var n=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return e;return null};e.exports=n},{}],102:[function(t,e){"use strict";function n(t){var e={};return function(n){return e.hasOwnProperty(n)?e[n]:e[n]=t.call(this,n)}}e.exports=n},{}],103:[function(t,e){"use strict";var n=t("./mergeInto"),r=function(t,e){var r={};return n(r,t),n(r,e),r};e.exports=r},{"./mergeInto":105}],104:[function(t,e){"use strict";var n=t("./invariant"),r=t("./keyMirror"),o=36,i=function(t){return"object"!=typeof t||null===t},a={MAX_MERGE_DEPTH:o,isTerminal:i,normalizeMergeArg:function(t){return void 0===t||null===t?{}:t},checkMergeArrayArgs:function(t,e){n(Array.isArray(t)&&Array.isArray(e))},checkMergeObjectArgs:function(t,e){a.checkMergeObjectArg(t),a.checkMergeObjectArg(e)},checkMergeObjectArg:function(t){n(!i(t)&&!Array.isArray(t))},checkMergeLevel:function(t){n(o>t)},checkArrayStrategy:function(t){n(void 0===t||t in a.ArrayStrategies)},ArrayStrategies:r({Clobber:!0,IndexByIndex:!0})};e.exports=a},{"./invariant":94,"./keyMirror":100}],105:[function(t,e){"use strict";function n(t,e){if(o(t),null!=e){o(e);for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}}var r=t("./mergeHelpers"),o=r.checkMergeObjectArg;e.exports=n},{"./mergeHelpers":104}],106:[function(t,e){"use strict";var n=function(t,e){var n;for(n in e)e.hasOwnProperty(n)&&(t.prototype[n]=e[n])};e.exports=n},{}],107:[function(t,e){"use strict";function n(t,e){i("html"===t.tagName.toLowerCase()),e=e.trim(),i(0===e.toLowerCase().indexOf("<html"));var n=e.indexOf(">")+1,a=e.lastIndexOf("<"),s=e.substring(0,n),u=e.substring(n,a),c=s.indexOf(" ")>-1,l=null;if(c){l=r(s.replace("html ","span ")+"</span>")[0];var p=o(l,function(e){return t.getAttributeNS(e.namespaceURI,e.name)!==e.value});p.forEach(function(e){t.setAttributeNS(e.namespaceURI,e.name,e.value)})}var d=o(t,function(t){return!(l&&l.hasAttributeNS(t.namespaceURI,t.name))});d.forEach(function(e){t.removeAttributeNS(e.namespaceURI,e.name)}),t.innerHTML=u}var r=t("./createNodesFromMarkup"),o=t("./filterAttributes"),i=t("./invariant");e.exports=n},{"./createNodesFromMarkup":77,"./filterAttributes":83,"./invariant":94}],108:[function(t,e){function n(t,e){return t&&e?t===e?!0:r(t)?!1:r(e)?n(t,e.parentNode):t.contains?t.contains(e):t.compareDocumentPosition?!!(16&t.compareDocumentPosition(e)):!1:!1}var r=t("./isTextNode");e.exports=n},{"./isTextNode":98}],109:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var r=0,o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=e.call(n,t[i],i,r++));return o}e.exports=n},{}],110:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var r=0,o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=e.call(n,i,t[i],r++));return o}e.exports=n},{}],111:[function(t,e){"use strict";function n(t,e){if(t===e)return!0;var n;for(n in t)if(t.hasOwnProperty(n)&&(!e.hasOwnProperty(n)||t[n]!==e[n]))return!1;for(n in e)if(e.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}e.exports=n},{}],112:[function(t,e){"use strict";function n(t,e,n){null!==t&&void 0!==t&&a(t,"",0,e,n)}var r=t("./ReactComponent"),o=t("./ReactTextComponent"),i=t("./invariant"),a=function(t,e,n,s,u){var c=0;if(Array.isArray(t))for(var l=0;l<t.length;l++){var p=t[l],d=e+r.getKey(p,l),h=n+c;c+=a(p,d,h,s,u)}else{var f=typeof t,m=""===e,v=m?r.getKey(t,0):e;if(null===t||void 0===t||"boolean"===f)s(u,null,v,n),c=1;else if(t.mountComponentIntoNode)s(u,t,v,n),c=1;else if("object"===f){i(!t||1!==t.nodeType);for(var g in t)t.hasOwnProperty(g)&&(c+=a(t[g],e+"{"+g+"}",n+c,s,u))}else if("string"===f){var y=new o(t);s(u,y,v,n),c+=1}else if("number"===f){var C=new o(""+t);s(u,C,v,n),c+=1}}return c};e.exports=n},{"./ReactComponent":25,"./ReactTextComponent":58,"./invariant":94}]},{},[24])(24)}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var styles = | |
'#reactive-table-overlay {\ | |
background: rgba(0, 0, 0, 0.7);\ | |
position: fixed;\ | |
width: 100%;\ | |
height: 100%;\ | |
top: 0;\ | |
left: 0;\ | |
}\ | |
#reactive-table-iframe {\ | |
width: 90%;\ | |
height: 90%;\ | |
padding: 5%;\ | |
}'; | |
function $$(s) { | |
return Array.prototype.slice.call(document.querySelectorAll(s)); | |
} | |
function $(s) { | |
return $$(s)[0]; | |
} | |
(function () { | |
$$('table').forEach(function(table, idx) { | |
var button = document.createElement('button'); | |
button.innerHTML = 'pop ↗'; | |
button.onclick = pop.bind(null, idx); | |
table.parentNode.insertBefore(button, table); | |
}); | |
var s = document.createElement('style'); | |
s.textContent = styles; | |
document.head.appendChild(s); | |
}()); | |
function pop(id) { | |
var overlay = document.createElement('div'); | |
overlay.id = 'reactive-table-overlay'; | |
overlay.onclick = function() { | |
document.body.removeChild(overlay); | |
}; | |
var iframe = document.createElement('iframe'); | |
iframe.id = 'reactive-table-iframe'; | |
overlay.appendChild(iframe); | |
document.body.appendChild(overlay); | |
var w, d; | |
setTimeout(function () { | |
w = iframe.contentWindow; | |
d = w.document; | |
var s = d.createElement('script'); | |
s.src = 'https://rawgit.com/mrfabbri/1af93c020dce27ca4854/raw/react.min.js'; | |
s.onload = function() { | |
var s = d.createElement('script'); | |
s.src = 'https://rawgit.com/mrfabbri/1af93c020dce27ca4854/raw/table2.js'; | |
s.onload = populate; | |
d.head.appendChild(s); | |
} | |
d.head.appendChild(s); | |
s = d.createElement('style'); | |
s.textContent = | |
'html{font-family:Arial;background:white}\ | |
td{border-top:1px solid black;padding:5px;cursor:cell}\ | |
th{padding:5px;cursor:pointer}\ | |
table{margin: 20px;border:1px solid black}\ | |
.tools{margin: 20px}\ | |
.tools button,.tools a{\ | |
border-radius:3px;border: 1px solid black;color:black;\ | |
background: #ddd;font:20px/24px Arial;\ | |
margin-right: 5px;padding: 5px;text-decoration: none}'; | |
d.head.appendChild(s); | |
}, 0); | |
function populate() { | |
var headers, data; | |
var table = $$('table')[id]; | |
var head = [].slice.call(table.getElementsByTagName('th')); | |
if (!'0' in head) { | |
head = [].slice.call( | |
table.getElementsByTagName('thead').getElementsByTagName('td')); | |
} | |
headers = head.reduce(function(res, th) { | |
res.push(th.textContent); | |
return res; | |
}, []); | |
var body = [].slice.call(table.getElementsByTagName('tr'), 1); | |
data = body.reduce(function(res, tr) { | |
var tds = tr.getElementsByTagName('td'), row = []; | |
for (var i = 0; i < tds.length; i++) { | |
row.push(tds[i].textContent); | |
} | |
res.push(row); | |
return res; | |
}, []); | |
var table = w.React.renderComponent( | |
w.Table({ | |
headers: headers, | |
data: data | |
}), d.body); | |
} | |
} | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
var Table = React.createClass({displayName: 'Table', | |
getInitialState: function () { | |
return { | |
data: this.props.data, | |
headers: this.props.headers, | |
sortby: null, | |
search: false, | |
edit: [-1, -1] | |
}; | |
}, | |
sort: function (e) { | |
var by = e.target.dataset.idx; | |
var state = this.state; | |
var desc = state.sortby === by; | |
var one = function(boo) {return boo ? 1 : -1}; | |
state.data = state.data.sort(function(a, b) { | |
var numa = Number(a[by].replace(/,/g, '')), | |
numb = Number(b[by].replace(/,/g, '')); | |
if (isNaN(numa)) { | |
return isNaN(numb) | |
? one(desc ? a[by] < b[by] : a[by] > b[by]) // two strings | |
: (desc ? 1 : -1); // numbers first | |
} | |
return isNaN(numb) | |
? (desc ? -1 : 1) | |
: one(desc ? numa < numb : numa > numb); | |
}); | |
state.sortby = desc ? null : by; | |
state.headers = this.props.headers.slice(); | |
state.headers[by] = state.headers[by] + (desc ? ' \u2191' : ' \u2193'); | |
this.setState(state); | |
}, | |
toggleSearch: function(e) { | |
this.state.search = !this.state.search; | |
this.state.data = this.props.data; | |
this.setState(this.state); | |
e.target.innerHTML = this.state.search ? 'nuff searching' : 'search'; | |
}, | |
search: function(e) { | |
var needle = e.target.value.toLowerCase(); | |
if (!needle) { | |
this.state.data = this.props.data; | |
this.setState(this.state); | |
return; | |
} | |
var idx = e.target.dataset.idx; | |
this.state.data = this.props.data.filter(function (a) { | |
return a[idx].toString().toLowerCase().indexOf(needle) > -1; | |
}); | |
this.setState(this.state); | |
}, | |
export: function(format, e) { | |
var contents = format === 'json' | |
? JSON.stringify(this.state.data) | |
: this.state.data.reduce((function(res, row){ | |
return res + this.getCSVRow(row) | |
}).bind(this), this.getCSVRow(this.state.headers)); | |
var URL = window.webkitURL || window.URL; | |
var bb = new Blob([contents], {type: 'text/' + format}); | |
e.target.href = URL.createObjectURL(bb); | |
e.target.download = 'data.' + format; | |
}, | |
getCSVRow: function(row) { | |
return '"' + row.join('","') + '"\n'; | |
}, | |
editor: function (e) { | |
var data = e.target.dataset; | |
this.state.edit = [Number(data.row), Number(data.column)]; | |
this.setState(this.state); | |
}, | |
save: function (e) { | |
e.preventDefault(); | |
var s = this.state; | |
s.data[s.edit[0]][s.edit[1]] = e.target.elements[0].value; | |
s.edit = [-1, -1]; | |
this.setState(s); | |
}, | |
render: function () { | |
// search inputs | |
var search = null; | |
if (this.state.search) { | |
search = | |
React.DOM.tr( {onChange:this.search}, | |
this.props.headers.map(function(ignore, idx) { | |
return React.DOM.td(null, React.DOM.input( {'data-idx':idx})); | |
}) | |
); | |
} | |
return ( | |
React.DOM.div(null, | |
React.DOM.div( {className:"tools"}, | |
React.DOM.button( {onClick:this.toggleSearch}, "search"), | |
" or download: " , React.DOM.a( {href:"data.csv", onClick:this.export.bind(this, 'csv')} , "csv"), | |
React.DOM.a( {href:"data.json", onClick:this.export.bind(this, 'json')}, "json") | |
), | |
React.DOM.table(null, | |
React.DOM.thead( {onClick:this.sort}, React.DOM.tr(null, | |
this.state.headers.map(function(cell, idx) { | |
return React.DOM.th( {'data-idx':idx}, cell); | |
}) | |
)), | |
React.DOM.tbody( {onDoubleClick:this.editor}, | |
search, | |
this.state.data.map(function(row, ridx) { | |
return ( | |
React.DOM.tr(null, | |
row.map(function(cell, cidx) { | |
var content = | |
this.state.edit[0] === ridx && this.state.edit[1] === cidx | |
? React.DOM.form( {onSubmit:this.save}, React.DOM.input( {defaultValue:cell})) | |
: cell; | |
return React.DOM.td( {'data-row':ridx, 'data-column':cidx}, content); | |
}.bind(this)) | |
)); | |
}.bind(this)) | |
) | |
) | |
) | |
); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment