{"version":3,"file":"inferno-component.js","sources":["../../../src/component/updateComponent.js","../../../src/util/noop.js","../../../src/util/ExecutionEnvironment.js","../../../src/util/requestAnimationFrame.js","../../../src/component/applyState.js","../../../src/component/queueStateChanges.js","../../../src/component/Component.js","../../inferno-component/src/index.js"],"sourcesContent":["export default function updateComponent(component, prevState, nextState, prevProps, nextProps, renderCallback) {\n\tif (!nextProps.children) {\n\t\tnextProps.children = prevProps.children;\n\t}\n\tif (prevProps !== nextProps || prevState !== nextState) {\n\t\tif (prevProps !== nextProps) {\n\t\t\tcomponent._blockRender = true;\n\t\t\tcomponent.componentWillReceiveProps(nextProps);\n\t\t\tcomponent._blockRender = false;\n\t\t}\n\t\tconst shouldUpdate = component.shouldComponentUpdate(nextProps, nextState);\n\n\t\tif (shouldUpdate) {\n\t\t\tcomponent._blockSetState = true;\n\t\t\tcomponent.componentWillUpdate(nextProps, nextState);\n\t\t\tcomponent._blockSetState = false;\n\t\t\tcomponent.props = nextProps;\n\t\t\tcomponent.state = nextState;\n\t\t\tconst newDomNode = renderCallback();\n\n\t\t\tcomponent.componentDidUpdate(prevProps, prevState);\n\t\t\treturn newDomNode;\n\t\t}\n\t}\n}\n","export default () => {};","const canUseDOM = !!(\n\ttypeof window !== 'undefined' &&\n\t// Nwjs doesn't add document as a global in their node context, but does have it on window.document,\n\t// As a workaround, check if document is undefined\n\ttypeof document !== 'undefined' &&\n\twindow.document.createElement\n);\n\nexport default {\n\tcanUseDOM: canUseDOM,\n\tcanUseWorkers: typeof Worker !== 'undefined',\n\tcanUseEventListeners: canUseDOM && !!( window.addEventListener ),\n\tcanUseViewport: canUseDOM && !!window.screen,\n\tcanUseSymbol: typeof Symbol === 'function' && typeof Symbol['for'] === 'function'\n};\n","import ExecutionEnvironment from './ExecutionEnvironment';\nimport noop from './noop';\n\n// Server side workaround\nlet requestAnimationFrame = noop;\nlet cancelAnimationFrame = noop;\n\nif ( ExecutionEnvironment.canUseDOM ) {\n\n\tlet lastTime = 0;\n\n\tconst nativeRequestAnimationFrame =\n\t\twindow.requestAnimationFrame ||\n\t\twindow.webkitRequestAnimationFrame ||\n\t\twindow.mozRequestAnimationFrame;\n\n\tconst nativeCancelAnimationFrame =\n\t\twindow.cancelAnimationFrame ||\n\t\twindow.webkitCancelAnimationFrame ||\n\t\twindow.webkitCancelRequestAnimationFrame ||\n\t\twindow.mozCancelAnimationFrame;\n\n\trequestAnimationFrame =\n\t\tnativeRequestAnimationFrame ||\n\t\tfunction ( callback ) {\n\t\t\tconst currTime = Date.now();\n\t\t\tconst timeDelay = Math.max( 0, 16 - ( currTime - lastTime ) ); // 1000 / 60 = 16.666\n\n\t\t\tlastTime = currTime + timeDelay;\n\t\t\treturn window.setTimeout( function () {\n\t\t\t\tcallback( Date.now() );\n\t\t\t}, timeDelay );\n\t\t};\n\n\tcancelAnimationFrame =\n\t\tnativeCancelAnimationFrame ||\n\t\tfunction ( frameId ) {\n\t\t\twindow.clearTimeout( frameId );\n\t\t};\n}\n\nexport {\n\trequestAnimationFrame,\n\tcancelAnimationFrame\n};\n","import updateComponent from './updateComponent';\nimport { requestAnimationFrame } from './../util/requestAnimationFrame';\nimport ExecutionEnvironment from '../util/ExecutionEnvironment';\n\nfunction applyState(component) {\n\tconst blockRender = component._blockRender;\n\n\trequestAnimationFrame(() => {\n\t\tif (component._deferSetState === false) {\n\t\t\tlet activeNode;\n\n\t\t\tif (ExecutionEnvironment.canUseDOM) {\n\t\t\t\tactiveNode = document.activeElement;\n\t\t\t}\n\n\t\t\tcomponent._pendingSetState = false;\n\t\t\tconst pendingState = component._pendingState;\n\t\t\tconst oldState = component.state;\n\t\t\tconst nextState = {\n\t\t\t\t...oldState,\n\t\t\t\t...pendingState\n\t\t\t};\n\n\t\t\tcomponent._pendingState = {};\n\t\t\tcomponent._pendingSetState = false;\n\t\t\tupdateComponent(component, oldState, nextState, component.props, component.props, component.forceUpdate, blockRender);\n\n\t\t\tif (ExecutionEnvironment.canUseDOM &&\n\t\t\t\tactiveNode !== document.body &&\n\t\t\t\tdocument.activeElement !== activeNode) {\n\t\t\t\tactiveNode.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tapplyState(component);\n\t\t}\n\t});\n}\n\nexport default applyState;\n","import applyState from './applyState';\n\nexport default function queueStateChanges(component, newState) {\n\tfor (let stateKey in newState) {\n\t\tcomponent._pendingState[stateKey] = newState[stateKey];\n\t}\n\tif (component._pendingSetState === false) {\n\t\tcomponent._pendingSetState = true;\n\t\tapplyState(component);\n\t}\n}\n","import queueStateChanges from './queueStateChanges';\n\n/** Base Component class, for he ES6 Class method of creating Components\n *\t@public\n *\n *\t@example\n *\tclass MyFoo extends Component {\n *\t\trender(props, state) {\n *\t\t\treturn
;\n *\t\t}\n *\t}\n */\nclass Component {\n\tconstructor(props) {\n\t\t/** @type {object} */\n\t\tthis.props = props || {};\n\t\tthis._blockRender = false;\n\t\tthis._blockSetState = false;\n\t\tthis._deferSetState = false;\n\t\tthis._pendingSetState = false;\n\t\tthis._pendingState = {};\n\t\tthis._lastRender = null;\n\t\t/** @type {object} */\n\t\t\tthis.state = {};\n\t\tthis.context = {};\n\t}\n\trender() {}\n\tforceUpdate() {}\n\tsetState(newState/* , callback */) {\n\t\t// TODO the callback\n\t\tif (this._blockSetState === false) {\n\t\t\tqueueStateChanges(this, newState);\n\t\t} else {\n\t\t\tthrow Error('Inferno Error: Cannot update state via setState() in componentWillUpdate()');\n\t\t}\n\t}\n\tcomponentDidMount() {}\n\tcomponentWillMount() {}\n\tcomponentWillUnmount() {}\n\tcomponentDidUpdate() {}\n\tshouldComponentUpdate() { return true; }\n\tcomponentWillReceiveProps() {}\n\tcomponentWillUpdate() {}\n\tgetChildContext() {}\n}\n\nexport default Component;\n","import Component from '../../../src/component/Component';\nimport updateComponent from '../../../src/component/updateComponent';\n\nexport default {\n\tComponent,\n\tupdateComponent\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAe,SAAS,eAAe,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