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SAAS,EAAO,IAGzB,EAAM,iBAAV,CAIA,EAAM,iBAEN,IAAI,EAAS,KAAK,QAAQ,QAE1B,EAAI,YAAY,SAAS,EAAQ,+DAEjC,IAYM,EAZF,EAAS,KAAK,MACd,EAAU,EAAO,QACjB,EAAS,EAAO,OAChB,EAAY,EAAO,UAGnB,EAAiB,kBAFZ,EAAO,GAE2B,GAE3C,GAAe,QAAX,EAEF,EAAe,MAAQ,SAAS,CAAC,EAAG,EAAe,MAAO,QAI1D,EAAe,MAAQ,SAAS,CAAC,EAAG,EAAe,QAAQ,EAAY,CAAC,GAAa,GAAa,EAAQ,EAAU,GAAW,EAAU,IAG3I,EAAO,KAAK,EAzBZ,CA0BF,EACA,OAAQ,WACN,IAAI,EAAU,KAAK,MAMf,GALY,EAAQ,UACV,EAAQ,QACA,EAAQ,gBACd,EAAQ,UACT,EAAQ,SACd,EAAQ,IACb,EAAQ,yBAAyB,EAAS,CAAC,YAAa,UAAW,kBAAmB,YAAa,WAAY,OAE/G,EAAS,KAAK,QAAQ,OAO1B,OAJI,IACF,EAAM,OAAS,EAAO,WAAW,kBAAkB,EAAI,KAGlD,QAAQ,QAAQ,cAAc,KAAK,MAAM,UAAW,SAAS,CAAC,EAAG,EAAO,CAAE,SAAU,KAAK,eAClG,IAGF,QAAQ,QAAU,KAClB,OAAO,QAAU,QAAiB","file":"/npm/react-router-form@3.0.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-router-form@3.0.0/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _getFormData = require('get-form-data');\n\nvar _getFormData2 = _interopRequireDefault(_getFormData);\n\nvar _invariant = require('invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar _React$PropTypes = _react2.default.PropTypes,\n    any = _React$PropTypes.any,\n    func = _React$PropTypes.func,\n    number = _React$PropTypes.number,\n    object = _React$PropTypes.object,\n    oneOfType = _React$PropTypes.oneOfType,\n    shape = _React$PropTypes.shape,\n    string = _React$PropTypes.string;\nvar toString = Object.prototype.toString;\n\n\nvar typeOf = function typeOf(o) {\n  return toString.call(o).slice(8, -1).toLowerCase();\n};\n\nfunction resolveToLocation(to, router) {\n  switch (typeOf(to)) {\n    case 'function':\n      return to(router.location);\n    case 'string':\n      return { pathname: to };\n  }\n  return to;\n}\n\n// XXX Reproducing ContextSubscriber from react-router/modules/ContextUtils.js\n// so we don't have to import the router, plus it's not available in the UMD\n// build. << ^D\n\n// Works around issues with context updates failing to propagate.\n// Caveat: the context value is expected to never change its identity.\n// https://github.com/facebook/react/issues/2517\n// https://github.com/reactjs/react-router/issues/470\n\nfunction ContextSubscriber(name) {\n  var _contextTypes, _ref2;\n\n  var contextName = '@@contextSubscriber/' + name;\n  var lastRenderedEventIndexKey = contextName + '/lastRenderedEventIndex';\n  var handleContextUpdateKey = contextName + '/handleContextUpdate';\n  var unsubscribeKey = contextName + '/unsubscribe';\n\n  return _ref2 = {\n    contextTypes: (_contextTypes = {}, _contextTypes[contextName] = shape({\n      subscribe: func.isRequired,\n      eventIndex: number.isRequired\n    }), _contextTypes),\n\n    getInitialState: function getInitialState() {\n      var _ref;\n\n      if (!this.context[contextName]) {\n        return {};\n      }\n\n      return _ref = {}, _ref[lastRenderedEventIndexKey] = this.context[contextName].eventIndex, _ref;\n    },\n    componentDidMount: function componentDidMount() {\n      if (!this.context[contextName]) {\n        return;\n      }\n\n      this[unsubscribeKey] = this.context[contextName].subscribe(this[handleContextUpdateKey]);\n    },\n    componentWillReceiveProps: function componentWillReceiveProps() {\n      var _setState;\n\n      if (!this.context[contextName]) {\n        return;\n      }\n\n      this.setState((_setState = {}, _setState[lastRenderedEventIndexKey] = this.context[contextName].eventIndex, _setState));\n    },\n    componentWillUnmount: function componentWillUnmount() {\n      if (!this[unsubscribeKey]) {\n        return;\n      }\n\n      this[unsubscribeKey]();\n      this[unsubscribeKey] = null;\n    }\n  }, _ref2[handleContextUpdateKey] = function (eventIndex) {\n    if (eventIndex !== this.state[lastRenderedEventIndexKey]) {\n      var _setState2;\n\n      this.setState((_setState2 = {}, _setState2[lastRenderedEventIndexKey] = eventIndex, _setState2));\n    }\n  }, _ref2;\n}\n\n// ^D\n\n/**\n * <Form> components are used to create a <form> element that submits its input\n * data to a route.\n *\n * For example, assuming you have the following route:\n *\n *   <Route path=\"/topics/:topicId/add-post\" onEnter={handleAddPost}/>\n *\n * You could use the following component to submit a form's input data to that\n * route as location state:\n *\n *   <Form to={`/topics/${topicId}/add-post`} method=\"POST\">\n */\nvar Form = _react2.default.createClass({\n  displayName: 'Form',\n\n  mixins: [ContextSubscriber('router')],\n\n  contextTypes: {\n    router: shape({\n      push: func.isRequired,\n      replace: func.isRequired,\n      go: func.isRequired,\n      goBack: func.isRequired,\n      goForward: func.isRequired,\n      setRouteLeaveHook: func.isRequired,\n      isActive: func.isRequired\n    })\n  },\n\n  propTypes: {\n    to: oneOfType([string, object, func]),\n\n    component: any,\n    dataKey: string,\n    extractFormData: func,\n    methodKey: string,\n    onSubmit: func\n  },\n\n  getDefaultProps: function getDefaultProps() {\n    return {\n      component: 'form',\n      dataKey: 'body',\n      extractFormData: _getFormData2.default,\n      method: 'GET',\n      methodKey: 'method'\n    };\n  },\n  handleSubmit: function handleSubmit(event) {\n    var formData = this.props.extractFormData(event.target);\n\n    if (this.props.onSubmit) {\n      this.props.onSubmit(event, formData);\n    }\n\n    if (event.defaultPrevented) {\n      return;\n    }\n\n    event.preventDefault();\n\n    var router = this.context.router;\n\n    (0, _invariant2.default)(router, '<Form>s rendered outside of a router context cannot submit.');\n\n    var _props = this.props,\n        dataKey = _props.dataKey,\n        method = _props.method,\n        methodKey = _props.methodKey,\n        to = _props.to;\n\n    var submitLocation = resolveToLocation(to, router);\n\n    if (method === 'GET') {\n      // GET submissions use the query string, so just merge form data into it\n      submitLocation.query = _extends({}, submitLocation.query, formData);\n    } else {\n      var _extends2;\n\n      submitLocation.state = _extends({}, submitLocation.state, (_extends2 = {}, _extends2[methodKey] = method, _extends2[dataKey] = formData, _extends2));\n    }\n\n    router.push(submitLocation);\n  },\n  render: function render() {\n    var _props2 = this.props,\n        component = _props2.component,\n        dataKey = _props2.dataKey,\n        extractFormData = _props2.extractFormData,\n        methodKey = _props2.methodKey,\n        onSubmit = _props2.onSubmit,\n        to = _props2.to,\n        props = _objectWithoutProperties(_props2, ['component', 'dataKey', 'extractFormData', 'methodKey', 'onSubmit', 'to']);\n\n    var router = this.context.router;\n\n\n    if (router) {\n      props.action = router.createHref(resolveToLocation(to, router));\n    }\n\n    return _react2.default.createElement(this.props.component, _extends({}, props, { onSubmit: this.handleSubmit }));\n  }\n});\n\nexports.default = Form;\nmodule.exports = exports['default'];"]}