@chentt/vuereact-combined
Version:
Vue和React快捷集成的工具包,并且适合复杂的集成场景
2 lines (1 loc) • 42.4 kB
JavaScript
import React,{version,lazy}from"react";import Vue from"vue";import ReactDOM,{createPortal}from"react-dom";function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=Array(e);r<e;r++)o[r]=t[r];return o}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _callSuper(t,e,r){return e=_getPrototypeOf(e),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(e,r||[],_getPrototypeOf(t).constructor):e.apply(t,r))}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey(o.key),o)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _extends(){return(_extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r,o=arguments[e];for(r in o)!{}.hasOwnProperty.call(o,r)||(t[r]=o[r])}return t}).apply(null,arguments)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ownKeys(e,t){var r,o=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)),o}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _objectWithoutProperties(t,e){if(null==t)return{};var r,o=_objectWithoutPropertiesLoose(t,e);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),a=0;a<n.length;a++)r=n[a],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r]);return o}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};var r,o={};for(r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;o[r]=t[r]}return o}function _possibleConstructorReturn(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==typeof t?t:t+""}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _unsupportedIterableToArray(t,e){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}var originOptions={react:{componentWrap:"div",slotWrap:"div",componentWrapAttrs:{__use_react_component_wrap:"",style:{all:"unset"}},slotWrapAttrs:{__use_react_slot_wrap:"",style:{all:"unset"}}},vue:{componentWrapHOC:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return function(){var t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).portals,t=void 0===t?[]:t;return React.createElement("div",r,e,t.map(function(t){var e=t.Portal;return React.createElement(e,{key:t.key})}))}},componentWrapAttrs:{"data-use-vue-component-wrap":"",style:{all:"unset"}},slotWrapAttrs:{"data-use-vue-slot-wrap":"",style:{all:"unset"}}}};function setOptions(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{react:{},vue:{}},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:originOptions,r=2<arguments.length?arguments[2]:void 0,e=(t.vue||(t.vue={}),t.react||(t.react={}),[e,_objectSpread2({},t,{react:_objectSpread2({},e.react,{},t.react,{componentWrapAttrs:_objectSpread2({},e.react.componentWrapAttrs,{},t.react.componentWrapAttrs),slotWrapAttrs:_objectSpread2({},e.react.slotWrapAttrs,{},t.react.slotWrapAttrs)}),vue:_objectSpread2({},e.vue,{},t.vue,{componentWrapAttrs:_objectSpread2({},e.vue.componentWrapAttrs,{},t.vue.componentWrapAttrs),slotWrapAttrs:_objectSpread2({},e.vue.slotWrapAttrs,{},t.vue.slotWrapAttrs)})})]);return r&&e.unshift({}),Object.assign.apply(this,e)}var vueRootInfo={},_excluded=["ref"],_excluded2=["style"],_excluded3=["key","data-passed-props"],_excluded4=["data-passed-props","hashList"],_excluded5=["style"],_excluded6=["on","$slots","$scopedSlots","children"],ReactMajorVersion=Number.parseInt(version),domMethods=["getElementById","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","querySelector","querySelectorAll"],domTopObject={Document:{},Element:{}};function overwriteDomMethods(i){Object.keys(domTopObject).forEach(function(t){domMethods.forEach(function(a){var s=domTopObject[t][a]||window[t].prototype[a];s&&(domTopObject[t][a]=s,window[t].prototype[a]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=s.apply(this,e),n=e;return o&&(o.constructor!==NodeList||o.constructor===NodeList&&0<o.length)?o:("getElementById"===(o=a)&&(o="querySelector",n=["#".concat(e[0])]),(domTopObject.Element[o]||Element.prototype[o]).apply(i,n))})})})}function recoverDomMethods(){Object.keys(domTopObject).forEach(function(e){domMethods.forEach(function(t){window[e].prototype[t]=domTopObject[e][t]})})}var FunctionComponentWrap=(()=>{function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,React.Component),_createClass(t,[{key:"render",value:function(){var t=this.props.component,e=this.props.passedProps,e=(e.ref,_objectWithoutProperties(e,_excluded));return React.createElement(t,e,this.props.children)}}])})(),createReactContainer=function(f,h,m){var t=(()=>{function d(t){var e;return _classCallCheck(this,d),(e=_callSuper(this,d,[t])).state=_objectSpread2({},t,{},h.isSlots?{children:f}:{}),e.setRef=e.setRef.bind(e),e.vueInReactCall=e.vueInReactCall.bind(e),e.vueWrapperRef=m,e}return _inherits(d,React.Component),_createClass(d,[{key:"setRef",value:function(e){e&&(m.reactRef=e,Object.keys(e).forEach(function(t){m[t]||(m[t]=e[t])}),Promise.resolve().then(function(){Object.keys(e).forEach(function(t){m[t]||(m[t]=e[t])})}),(this.setRef.current=e).vueWrapperRef=m)}},{key:"createSlot",value:function(o){var t=h.react.slotWrapAttrs,n=t.style,a=_objectWithoutProperties(t,_excluded2);return{inheritAttrs:!1,__fromReactSlot:!0,render:function(t){var e,r=o instanceof Function?o(this):o;return 1===r?.length&&r[0]?.data&&((e=this.$attrs).key,e=_objectWithoutProperties(e,_excluded3),r[0].data.attrs=_objectSpread2({},e,{},r[0].data.attrs)),t(h.react.slotWrap,{attrs:a,style:n},r)}}}},{key:"componentWillUnmount",value:function(){m.reactRef&&(m.reactRef.vueWrapperRef=null,m.reactRef=null)}},{key:"vueInReactCall",value:function(t,r,e){var o=this;return e&&t?.[0]?t.map(function(t,e){return applyVueInReact(o.createSlot(t instanceof Function?t:[t]),_objectSpread2({},h,{},r,{isSlots:!0,wrapInstance:m})).render({key:t?.data?.key||e})}):applyVueInReact(this.createSlot(t),_objectSpread2({},h,{},r,{isSlots:!0,wrapInstance:m})).render()}},{key:"render",value:function(){var t,e,r,o,n=this,a=this.state,s=a["data-passed-props"],i=a.hashList,c=_objectWithoutProperties(a,_excluded4),u={},p={};for(e in c)r=e,o=void 0,Object.hasOwn(c,r)&&null!=c[r]&&(c[r].__slot?(c[r].reactSlot?c[r]=c[r].reactSlot:(o=c[r],h.defaultSlotsFormatter?(c[r].__top__=n.vueWrapperRef,c[r]=h.defaultSlotsFormatter(c[r],n.vueInReactCall,i),Array.isArray(c[r])?c[r]=_toConsumableArray(c[r]):-1<["string","number"].indexOf(_typeof(c[r]))?c[r]=[c[r]]:"object"===_typeof(c[r])&&(c[r]=_objectSpread2({},c[r]))):c[r]=_objectSpread2({},applyVueInReact(n.createSlot(c[r]),_objectSpread2({},h,{isSlots:!0,wrapInstance:m})).render()),c[r].vueSlot=o),u[r]=c[r]):c[r].__scopedSlot&&(c[r]=c[r](n.createSlot),p[r]=c[r]));c.children?.vueFunction||(t=c.children),u.default=t;var l,s=_objectSpread2({},s,{},{$slots:u,$scopedSlots:p},{children:t}),a={};return a.ref=this.setRef,h.isSlots?this.state.children||this.props.children:(l=c,l=_objectSpread2({},l=h.defaultPropsFormatter?h.defaultPropsFormatter(c,this.vueInReactCall,i):l,{},{"data-passed-props":s}),Object.getPrototypeOf(f)!==Function.prototype&&("object"!==_typeof(f)||f.render)||d.catchVueRefs()?React.createElement(f,_extends({},l,{"data-passed-props":s},a),t||l.children):React.createElement(FunctionComponentWrap,_extends({passedProps:l,component:f},a),t||l.children))}}],[{key:"catchVueRefs",value:function(){if(m.$parent)for(var t in m.$parent.$refs)if(m.$parent.$refs[t]===m)return!0;return!1}}])})();return _defineProperty(t,"displayName","useReact_".concat(f.displayName||f.name||"Component")),t};function applyReactInVue(t){var w=t,O=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return w.__esModule&&w.default&&(w=w.default),O.isSlots&&(w=w()),O=setOptions(O,void 0,!0),{originReactComponent:w,data:function(){return{portals:[],portalKeyPool:[],maxPortalCount:0}},created:function(){this.cleanVnodeStyleClass(),this.$root.$options.router&&(vueRootInfo.router=this.$root.$options.router),this.$root.$options.router&&(vueRootInfo.store=this.$root.$options.store)},props:["dataPassedProps"],render:function(e){this.slotsInit();var t=O.react.componentWrapAttrs,r=t.style,t=_objectWithoutProperties(t,_excluded5);return e(O.react.componentWrap,{ref:"react",attrs:t,style:r},this.portals.map(function(t){return(0,t.Portal)(e,t.key)}))},methods:{pushVuePortal:function(t){var e=this.portalKeyPool.shift()||this.maxPortalCount++;this.portals.push({Portal:t,key:e})},removeVuePortal:function(r){var o,t=this.portals.find(function(t,e){if(t.Portal===r)return o=e,!0});this.portalKeyPool.push(t.key),this.portals.splice(o,1)},slotsInit:function(e){var r=this;if(e)return e.componentOptions?.Ctor?.options&&!e.componentOptions?.Ctor?.options.originReactComponent?void 0:(e.data?.scopedSlots&&Object.keys(e.data?.scopedSlots).forEach(function(t){if("function"==typeof e.data.scopedSlots[t])try{e.data.scopedSlots[t]()}catch(t){}}),void(e.children||e.componentOptions?.children||[]).forEach(function(t){r.slotsInit(t)}));Object.keys(this.$slots).forEach(function(t){(r.$slots[t]||[]).forEach(function(t){r.slotsInit(t)})}),Object.keys(this.$scopedSlots).forEach(function(t){try{r.$scopedSlots[t]()}catch(t){}})},updateLastVnodeData:function(t){return this.lastVnodeData={style:_objectSpread2({},this.formatStyle(t.data.style),{},this.formatStyle(t.data.staticStyle)),class:Array.from(new Set([].concat(_toConsumableArray(this.formatClass(t.data.class)),_toConsumableArray(this.formatClass(t.data.staticClass))))).join(" ")},Object.assign(t.data,{staticStyle:null,style:null,staticClass:null,class:null}),t},cleanVnodeStyleClass:function(){var e=this,r=this.$vnode;this.updateLastVnodeData(r),Object.defineProperty(this,"$vnode",{get:function(){return r},set:function(t){return r=t!==r?e.updateLastVnodeData(t):r}})},toCamelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},formatStyle:function(t){var e,r=this,o=t;return o?"string"==typeof o?(o=o.trim()).split(/\s*;\s*/).reduce(function(t,e){return e&&2===(e=e.split(/\s*:\s*/)).length&&Object.assign(t,_defineProperty({},r.toCamelCase(e[0]),e[1])),t},{}):"object"===_typeof(o)?(e={},Object.keys(o).forEach(function(t){e[r.toCamelCase(t)]=o[t]}),e):{}:{}},formatClass:function(t){var e=t;return e?Array.isArray(e)?e:"string"==typeof e?(e=e.trim()).split(/\s+/):"object"===_typeof(e)?Object.keys(e).map(function(t){return e[t]||""}):[]:[]},getScopeSlot:function(a,s,e){var i=this;function t(n){function t(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return a.reactFunction?a.reactFunction.apply(this,r):O.defaultSlotsFormatter?((t=a.apply(this,r)).__top__=i,t=O.defaultSlotsFormatter(t,i.vueInReactCall,s),Array.isArray(t)||-1<_typeof(t).indexOf("string","number")?t=_toConsumableArray(t):"object"===_typeof(t)&&(t=_objectSpread2({},t)),t):applyVueInReact(n(a.apply(this,r)),_objectSpread2({},O,{isSlots:!0,wrapInstance:i})).render()}return O.pureTransformer&&e?t.vueFunction=e:t.vueFunction=a,t}return t.__scopedSlot=!0,t},__syncUpdateProps:function(t){this.reactInstance?.setState(t)},mountReactComponent:function(t,e){var r=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=null!=this.$props.dataPassedProps?this.$props.dataPassedProps:{},a=n.on,s=n.$slots,i=n.$scopedSlots,c=n.children,n=_objectWithoutProperties(n,_excluded6),u={},p=[],l=this.$vnode.context?.$vnode?.componentOptions?.Ctor?.extendOptions?._scopeId,d=(l&&(u[l]="",p.push(l)),{}),f={};if(!t||e?.slot){var h,m=_objectSpread2({},s,{},this.$slots);for(h in m)d[h]=m[h],d[h].__slot=!0;var y,_=_objectSpread2({},i,{},this.$scopedSlots);for(y in _)d[y]?this.$scopedSlots[y]&&(this.$scopedSlots[y].__slot=!0):_[y].__slot?(d[y]=_[y](),d[y].__slot=!0):f[y]=this.getScopeSlot(_[y],p,this.$vnode?.data?.scopedSlots?.[y])}var v,S=_objectSpread2({},n,{},_objectSpread2({},this.$attrs),{},!t||e?.slot?{$slots:d,$scopedSlots:f,children:c}:{},{on:_objectSpread2({},a,{},this.$listeners)}),b=(t&&!e?.slot||(v=_objectSpread2({},d),c=v.default,v.default=void 0),this.last=this.last||{},this.last.slot=this.last.slot||{},this.last.listeners=this.last.listeners||{},this.last.attrs=this.last.attrs||{},{slot:function(){r.last.slot=_objectSpread2({},c?{children:c}:{children:null},{},v,{},f)},listeners:function(){r.last.listeners=S.on},attrs:function(){r.last.attrs=r.$attrs}});if(e&&Object.keys(e).forEach(function(t){return b[t]()}),t){var R={},g=(Object.keys(this.last.listeners).forEach(function(t){R["on".concat(t.replace(/^(\w)/,function(t,e){return e.toUpperCase()}))]=r.$listeners[t]}),function(){r.reactInstance?.setState(function(e){return Object.keys(e).forEach(function(t){O.isSlots&&"children"===t||delete e[t]}),_objectSpread2({},r.cache,{},!O.isSlots&&r.last.slot,{},r.last.attrs,{},R)}),r.cache=null});!this.microTaskUpdate||this.cache||this.$nextTick(function(){g(),r.microTaskUpdate=!1}),this.macroTaskUpdate&&(clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){clearTimeout(r.updateTimer),g(),r.macroTaskUpdate=!1})),this.cache=_objectSpread2({},this.cache||{},{},_objectSpread2({},n,{},o,{},{"data-passed-props":S},{},this.lastVnodeData.class?{className:this.lastVnodeData.class}:{},{},_objectSpread2({},u),{hashList:p,style:this.lastVnodeData.style})),this.macroTaskUpdate||this.microTaskUpdate||g()}else{b.slot(),b.listeners(),b.attrs();var l=createReactContainer(w,O,this),P={},j=(Object.keys(S.on).forEach(function(t){P["on".concat(t.replace(/^(\w)/,function(t,e){return e.toUpperCase()}))]=S.on[t]}),React.createElement(l,_extends({},n,this.$attrs,P,{children:c},v,f,{"data-passed-props":S},this.lastVnodeData.class?{className:this.lastVnodeData.class}:{},u,{hashList:p,style:this.lastVnodeData.style,ref:function(t){return r.reactInstance=t}}))),C=(this.$redux?.store&&this.$redux.ReactReduxContext&&(s=this.$redux.ReactReduxContext,j=React.createElement(s.Provider,{value:{store:this.$redux.store}},j)),this.$refs.react),$=O.wrapInstance;if($)($=O.wrapInstance).vueWrapperRef=this;else for(var I=this.$parent;I;){if(I.parentReactWrapperRef){$=I.parentReactWrapperRef;break}if(I.reactWrapperRef){$=I.reactWrapperRef;break}I=I.$parent}$?(this.parentReactWrapperRef=$,this.reactPortal=function(){return createPortal(j,C)},$.pushReactPortal(this.reactPortal)):17<ReactMajorVersion?(void 0!==ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&(ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint=!0),this.__veauryReactApp__=ReactDOM.createRoot(C),this.__veauryReactApp__.render(j)):ReactDOM.render(j,C)}}},mounted:function(){clearTimeout(this.updateTimer),this.mountReactComponent()},beforeDestroy:function(){clearTimeout(this.updateTimer),this.reactPortal?(overwriteDomMethods(this.$refs.react),this.parentReactWrapperRef?.removeReactPortal(this.reactPortal)):(overwriteDomMethods(this.$refs.react),17<ReactMajorVersion?this.__veauryReactApp__.unmount():ReactDOM.unmountComponentAtNode(this.$refs.react)),recoverDomMethods()},updated:function(){this.mountReactComponent(!0,{slot:!0})},inheritAttrs:!1,watch:{$attrs:{handler:function(){this.mountReactComponent(!0,{attrs:!0})},deep:!0},$listeners:{handler:function(){this.mountReactComponent(!0,{listeners:!0})},deep:!0},"$props.dataPassedProps":{handler:function(){this.mountReactComponent(!0,{passedProps:!0})},deep:!0}}}}var reactRouterInfo={};function applyReactRouterInVue(t){return reactRouterInfo.withRouter||(reactRouterInfo.withRouter=t),reactRouterInfo.withRouter}function setReactRouterInVue(t){reactRouterInfo.vueInstance?updateReactRouterInVue(t):(reactRouterInfo.vueInstance=new Vue({data:_objectSpread2({},t)}),Vue.prototype.$reactRouter=reactRouterInfo.vueInstance.$data)}function updateReactRouterInVue(t){Object.assign(reactRouterInfo.vueInstance.$data,_objectSpread2({},t))}function _typeof$1(t){return(_typeof$1="function"==typeof Symbol&&"symbol"===_typeof(Symbol.iterator)?function(t){return _typeof(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof(t)})(t)}function _toConsumableArray$1(t){return _arrayWithoutHoles$1(t)||_iterableToArray$1(t)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function _iterableToArray$1(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var inBrowser="undefined"!=typeof window;function freeze(t){return Array.isArray(t)||"object"===_typeof$1(t)?Object.freeze(t):t}function combinePassengers(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return t.reduce(function(t,e){var r=e.passengers[0],r="function"==typeof r?r(o):e.passengers;return t.concat(r)},[])}function stableSort(t,r){return t.map(function(t,e){return[e,t]}).sort(function(t,e){return r(t[1],e[1])||t[0]-e[0]}).map(function(t){return t[1]})}function pick(r,t){return t.reduce(function(t,e){return r.hasOwnProperty(e)&&(t[e]=r[e]),t},{})}var transports={},targets={},sources={},Wormhole=Vue.extend({data:function(){return{transports:transports,targets:targets,sources:sources,trackInstances:inBrowser}},methods:{open:function(t){var e,r,o;inBrowser&&(e=t.to,r=t.from,o=t.passengers,t=void 0===(t=t.order)?1/0:t,e)&&r&&o&&(r={to:e,from:r,passengers:freeze(o),order:t},-1===Object.keys(this.transports).indexOf(e)&&Vue.set(this.transports,e,[]),o=this.$_getTransportIndex(r),t=this.transports[e].slice(0),-1===o?t.push(r):t[o]=r,this.transports[e]=stableSort(t,function(t,e){return t.order-e.order}))},close:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=t.to;r&&(t.from||!1!==e)&&this.transports[r]&&(e?this.transports[r]=[]:0<=(e=this.$_getTransportIndex(t))&&((t=this.transports[r].slice(0)).splice(e,1),this.transports[r]=t))},registerTarget:function(t,e,r){inBrowser&&(this.trackInstances&&!r&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,r){inBrowser&&(this.trackInstances&&!r&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e,r=t.to,o=t.from;for(e in this.transports[r])if(this.transports[r][e].from===o)return+e;return-1}}}),wormhole=new Wormhole(transports),_id=1,Portal=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(_id++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick(function(){wormhole.registerSource(t.name,t)})},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){wormhole.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){t={from:this.name,to:t||this.to};wormhole.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();t?(t={from:this.name,to:this.to,passengers:_toConsumableArray$1(t),order:this.order},wormhole.open(t)):this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],r=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(r,[this.normalizeOwnChildren(e)]):this.slim?t():t(r,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),PortalTarget=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:wormhole.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick(function(){wormhole.registerTarget(t.name,t)})},watch:{ownTransports:function(){this.$emit("change",0<this.children().length)},name:function(t,e){wormhole.unregisterTarget(e),wormhole.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick(function(){t.firstRender=!1})},beforeDestroy:function(){wormhole.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return combinePassengers(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t;return(t=this.slim&&!this.transition)&&1<this.children().length&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),r=this.children(),o=this.transition||this.tag;return e?r[0]:this.slim&&!o?t():t(o,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},r)}}),_id$1=0,portalProps=["disabled","name","order","slim","slotProps","tag","to"],targetProps=["multiple","transition"],MountingPortal=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(_id$1++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){var t,e;"undefined"!=typeof document&&((t=document.querySelector(this.mountTo))?(e=this.$props,wormhole.targets[e.name]?e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=wormhole.targets[e.name]:((e=e.append)&&(e=document.createElement("string"==typeof e?e:"DIV"),t.appendChild(e),t=e),(e=pick(this.$props,targetProps)).slim=this.targetSlim,e.tag=this.targetTag,e.slotProps=this.targetSlotProps,e.name=this.to,this.portalTarget=new PortalTarget({el:t,parent:this.$parent||this,propsData:e}))):console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document")))},beforeDestroy:function(){var t,e=this.portalTarget;this.append&&(t=e.$el).parentNode.removeChild(t),e.$destroy()},render:function(t){var e;return this.portalTarget?this.$scopedSlots.manual?(e=this.$scopedSlots.manual({to:this.to}),(e=Array.isArray(e)?e[0]:e)||t()):(e=pick(this.$props,portalProps),t(Portal,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)):(console.warn("[portal-vue] Target wasn't mounted"),t())}}),REACT_ALL_HANDLERS=new Set(["onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onChange","onInput","onInvalid","onReset","onSubmit","onError","onLoad","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onToggle"]),_excluded$1=["history","match","location"],_excluded2$1=["$model"],_excluded3$1=["$sync"],_excluded4$1=["$slots","$scopedSlots","children","on"],_excluded5$1=["component","on","$slots","$scopedSlots","children","class","style","data-passed-props"],_excluded6$1=["className","classname"],unsafePrefix=17<=parseFloat(version)?"UNSAFE_":"",optionsName="vuereact-combined-options";function filterVueComponent(t){return"string"==typeof t?Vue.component(t):t}function getOptions(t){return"function"==typeof t?t.options:t}var GetReactRouterPropsCom=(()=>{function r(t){var e;return _classCallCheck(this,r),e=_callSuper(this,r,[t]),setReactRouterInVue({history:t.history,match:t.match,location:t.location}),e}return _inherits(r,React.Component),_createClass(r,[{key:"".concat(unsafePrefix,"componentWillReceiveProps"),value:function(t){updateReactRouterInVue({history:t.history,match:t.match,location:t.location})}},{key:"render",value:function(){var t=this.props,t=(t.history,_objectWithoutProperties(t,_excluded$1));return React.createElement(VueComponentLoader,_extends({},t,{ref:this.props.forwardRef}))}}])})(),VueContainer=React.forwardRef(function(t,e){var r=setOptions(t[optionsName]||{},void 0,!0);return reactRouterInfo.withRouter?(VueContainer.RouterTargetComponent||(VueContainer.RouterTargetComponent=reactRouterInfo.withRouter(GetReactRouterPropsCom)),React.createElement(VueContainer.RouterTargetComponent,_extends({},_objectSpread2({},t,_defineProperty({},optionsName,r)),{forwardRef:e}))):React.createElement(VueComponentLoader,_extends({},_objectSpread2({},t,_defineProperty({},optionsName,r)),{ref:e}))}),VueComponentLoader=(()=>{function r(t){var e;return _classCallCheck(this,r),(e=_callSuper(this,r,[t])).state={portals:[]},e.portalKeyPool=[],e.maxPortalCount=0,e.currentVueComponent=filterVueComponent(t.component),e.createVueInstance=e.createVueInstance.bind(e),e.vueComponentContainer=e.createVueComponentContainer(),e}return _inherits(r,React.Component),_createClass(r,[{key:"pushReactPortal",value:function(t){var e=this.state.portals,r=this.portalKeyPool.shift()||this.maxPortalCount++;e.push({Portal:t,key:r}),this.setState({portals:e})}},{key:"removeReactPortal",value:function(r){var o,t=this.state.portals,e=t.find(function(t,e){if(t.Portal===r)return o=e,!0});this.portalKeyPool.push(e.key),t.splice(o,1),this.vueRef&&this.setState({portals:t})}},{key:"createVueComponentContainer",value:function(){var e=this,r={},t=this.props[optionsName];return t.isSlots?(Object.keys(this.props).forEach(function(t){REACT_ALL_HANDLERS.has(t)&&"function"==typeof e.props[t]&&(r[t]=e.props[t])}),t.vue.slotWrapAttrs&&(r=_objectSpread2({},r,{},t.vue.slotWrapAttrs))):t.vue.componentWrapAttrs&&(r=_objectSpread2({},r,{},t.vue.componentWrapAttrs)),t.vue.componentWrapHOC(React.createElement("div",{ref:this.createVueInstance,key:null}),r)}},{key:"".concat(unsafePrefix,"componentWillReceiveProps"),value:function(t){var e,r=this,o=t.component,n=t.children,a=t.$slots,t=_objectWithoutProperties(t,["component",optionsName,"children","$slots"].map(_toPropertyKey)),o=filterVueComponent(o);this.currentVueComponent!==o&&this.updateVueComponent(o),this.vueInstance&&(n=this.transferChildren(n),a=this.transferSlots(a),n&&(t.children=n),a&&(t.$slots=a),e=this.doSync(this.doVModel(t)),Object.keys(this.vueInstance.$data.reactProps).forEach(function(t){t in e||"data-passed-props"===t||r.vueInstance.$set(r.vueInstance.$data.reactProps,t,void 0)}),Object.keys(e).forEach(function(t){r.vueInstance.$set(r.vueInstance.$data.reactProps,t,e[t])}))}},{key:"componentWillUnmount",value:function(){this.vuePortal?this.parentVueWrapperRef.removeVuePortal(this.vuePortal):this.vueInstance&&this.vueInstance.$destroy()}},{key:"doVModel",value:function(t){var e,o,n=t.$model,r=_objectWithoutProperties(t,_excluded2$1);return void 0===n?t:(e=_defineProperty({},(t=_objectSpread2({},{prop:"value",event:"input"},{},getOptions(this.currentVueComponent).model)).prop,n.value),r.on||(r.on={}),r.on[t.event]?(o=r.on[t.event],r.on[t.event]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e),n.setter&&n.setter.apply(this,e)}):r.on=_objectSpread2({},r.on,{},_defineProperty({},t.event,n.setter||function(){})),_objectSpread2({},r,{},e))}},{key:"doSync",value:function(t){var a=t.$sync,e=_objectWithoutProperties(t,_excluded3$1);if(void 0===a)return t;var r,s={};for(r in a)(o=>{if(!a.hasOwnProperty(o)||!a[o]||null==a[o].value||null==a[o].setter)return;s[o]=a[o].value;var n,t="update:"+o;e.on||(e.on={}),e.on[t]?(n=e.on[t],e.on[t]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.apply(this,e),a[o].setter&&a[o].setter.apply(this,e)}):e.on=_objectSpread2({},e.on,{},_defineProperty({},t,a[o].setter||function(){}))})(r);return _objectSpread2({},e,{},s)}},{key:"transferSlots",value:function(r){if(r)return Object.keys(r).forEach(function(t){var e=r[t];r[t]=function(){return e}}),r}},{key:"transferChildren",value:function(t){var e;if(t)return e=t,function(){return e}}},{key:"createVueInstance",value:function(t){var m=this,c=this,e=this.props,r=e.component,o=e["data-passed-props"],o=void 0===o?{}:o,u=e[optionsName],n=e.children,a=e.$slots,e=_objectWithoutProperties(e,["component","data-passed-props",optionsName,"children","$slots"].map(_toPropertyKey)),n=this.transferChildren(n),a=this.transferSlots(a),r=(n&&(e.children=n),a&&(e.$slots=a),filterVueComponent(r));function s(t){this.vueInstance||(this.vueInstance=t)}s=s.bind(this);var i=_objectSpread2({},this.doSync(this.doVModel(e)),{"data-passed-props":o}),p=_objectSpread2({},vueRootInfo,{data:function(){return{reactProps:i}},created:function(){this.reactWrapperRef=c,s(this)},methods:{getNamespaceSlots:function(n,t){var e,a=this,s=(this.getNamespaceSlots.__namespaceSlots||(this.getNamespaceSlots.__namespaceSlots={}),Object.assign({},t));for(e in s)(t=>{if(!s.hasOwnProperty(t)||!s[t])return;var e,r,o;"function"==typeof s[t]&&(s[t]=s[t]()),s[t]=(e=s[t],r=t,e.vueSlot||(a.getNamespaceSlots.__namespaceSlots[t]?.[0]?.child?.reactInstance?(o=a.getNamespaceSlots.__namespaceSlots[t],a.$nextTick(function(){o[0].child.reactInstance.setState({children:e})})):(o=[n(applyReactInVue(function(){return e},_objectSpread2({},u,{isSlots:!0,wrapInstance:c})),{slot:r})],a.getNamespaceSlots.__namespaceSlots[t]=o),o.reactSlot=e,o))})(e);return s},getScopedSlots:function(s,t){var e,i=this,r=(this.getScopedSlots.__scopeSlots||(this.getScopedSlots.__scopeSlots={}),_objectSpread2({},t));for(e in r)(n=>{if(!r.hasOwnProperty(n))return;var a,t=r[n];r[n]=(a=t,function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return a.vueFunction?a.vueFunction.apply(i,r):(i.getScopedSlots.__scopeSlots[n]?.child?.reactInstance?(t=i.getScopedSlots.__scopeSlots[n],i.$nextTick(function(){t.child.reactInstance.setState({children:a.apply(i,r)})})):(t=s(applyReactInVue(function(){return a.apply(i,r)},_objectSpread2({},u,{isSlots:!0,wrapInstance:c}))),i.getScopedSlots.__scopeSlots[n]=t),t)}),r[n].reactFunction=t})(e);return r},getChildren:function(t,e){var r;if(null!=e)return(e="function"==typeof e?e():e).vueSlot?e.vueSlot:(this.getChildren.__vnode?.[0]?.child?.reactInstance?(r=this.getChildren.__vnode,this.$nextTick(function(){r[0].child.reactInstance.setState({children:e})})):(r=[t(applyReactInVue(function(){return e},_objectSpread2({},u,{isSlots:!0,wrapInstance:c})))],this.getChildren.__vnode=r),r.reactSlot=e,r)}},mounted:function(){c.vueRef=this.$children[0],this.$children[0].reactWrapperRef=c},beforeDestroy:function(){c.vueRef=null,this.$children[0].reactWrapperRef=null},render:function(t){var e=this.$data.reactProps,r=(e.component,e.on),o=e.$slots,n=e.$scopedSlots,a=e.class,a=void 0===a?"":a,s=e.style,s=void 0===s?"":s,i=e["data-passed-props"],c=i.$slots,u=i.$scopedSlots,p=i.children,l=i.on,i=_objectWithoutProperties(i,_excluded4$1),d=_objectWithoutProperties(e,_excluded5$1),e=(((t,e)=>{if(!t)return;if(e)for(var r in t)t.hasOwnProperty(r)&&e[r]&&delete t[r]})(u,c),this.getScopedSlots(t,_objectSpread2({},u,{},n))),u=this.getChildren(t,this.reactProps.children||p),f=this.getNamespaceSlots(t,_objectSpread2({},c,{},o)),n=(u&&(f.default=u),[u||[]].concat(_toConsumableArray(Object.keys(f).map(function(t){if("default"!==t)return f[t]})))),p=_objectSpread2({},l,{},r),h={},c=(Object.keys(d).forEach(function(t){REACT_ALL_HANDLERS.has(t)&&"function"==typeof d[t]&&(h[t.replace(/^on/,"").toLowerCase()]=d[t],delete d[t])}),_objectSpread2({},i,{},d,{"data-passed-props":_objectSpread2({},i,{},d,{on:p,children:u,$slots:f,$scopedSlots:e})})),o=(t=>{var e=[],r={},o=getOptions(m.currentVueComponent),n=(o.mixins&&o.mixins.forEach(function(t){t.props&&(t.props instanceof Array?e=_toConsumableArray(t.props):r=_objectSpread2({},t.props))}),Object.assign({},t));if(t=o.props)if(t instanceof Array)[].concat(_toConsumableArray(t),_toConsumableArray(e)).forEach(function(t){delete n[t]});else{var a,s=_objectSpread2({},t,{},r);for(a in s)s.hasOwnProperty(a)&&delete n[a]}return n})(_objectSpread2({},c)),l=o.className,r=o.classname,i=_objectWithoutProperties(o,_excluded6$1);return t("use_vue_wrapper",{props:c,on:p,nativeOn:h,attrs:i,class:a||l||r||"",style:s,scopedSlots:_objectSpread2({},e)},n)},components:{use_vue_wrapper:r}});if(t){var l="__vue_wrapper_container_"+(Math.random()+"").substr(2),d=(t.id=l,u.wrapInstance);if(d)(d=u.wrapInstance).reactWrapperRef=c;else for(var f=(this._reactInternals||this._reactInternalFiber).return;f;){if(f.stateNode?.parentVueWrapperRef){d=f.stateNode.parentVueWrapperRef;break}if(f.stateNode?.vueWrapperRef){d=f.stateNode.vueWrapperRef;break}f=f.return}d&&document.getElementById(l)?(this.parentVueWrapperRef=d,this.vuePortal=function(t,e){return t(MountingPortal,{props:{mountTo:"#"+l,slim:!0,targetSlim:!0},key:l},[t(Object.assign(p,{router:m._router}))])},d.pushVuePortal(this.vuePortal)):this.vueInstance=new Vue(_objectSpread2({},p,{el:t}))}}},{key:"updateVueComponent",value:function(t){this.currentVueComponent=t,this.vueInstance&&(t.__fromReactSlot?Object.assign(this.vueInstance.$options.components.use_vue_wrapper._Ctor[0].options,t):this.vueInstance.$options.components.use_vue_wrapper=t,this.vueInstance.$forceUpdate())}},{key:"render",value:function(){return React.createElement(this.vueComponentContainer,{portals:this.state.portals})}}])})();function applyVueInReact(r){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return r||console.warn("Component must be passed in applyVueInReact!"),r.__esModule&&r.default&&(r=r.default),React.forwardRef(function(t,e){return React.createElement(VueContainer,_extends({},t,{component:r,ref:e},_defineProperty({},optionsName,o)))})}function lazyVueInReact(t,e){return lazy(function(){return t().then(function(t){return{default:applyVueInReact(t.default,e)}})})}function lazyReactInVue(t,e){return function(){return t().then(function(t){return applyReactInVue(t.default,e)})}}var reduxInstance,vuexStore,ReduxLinkVue=(()=>_createClass(function t(e){var r=this;if(_classCallCheck(this,t),!e||!e.subscribe||!e.getState)throw Error("incorrect store passed in, please check the function applyRedux's parameter must contains redux store");(this.store=e).subscribe(function(){r._vm.state=e.getState()}),this._vm=new Vue({data:function(){return{state:e.getState()}}})},[{key:"state",get:function(){return this._vm.state}},{key:"dispatch",get:function(){return this.store.dispatch}}]))();function applyRedux(t){var e=t.store,t=t.ReactReduxContext;return reduxInstance||(reduxInstance=new ReduxLinkVue(e),t&&(reduxInstance.ReactReduxContext=t),Vue.prototype.$redux=reduxInstance),reduxInstance}function connectVuex(t){var e=t.mapStateToProps,o=void 0===e?function(t){}:e,e=t.mapGettersToProps,n=void 0===e?function(t){}:e,e=t.mapCommitToProps,a=void 0===e?function(t){}:e,e=t.mapDispatchToProps,s=void 0===e?function(t){}:e;return function(t){var r=(()=>{function e(t){if(_classCallCheck(this,e),t=_callSuper(this,e,[t]),(vuexStore=vueRootInfo.store?vueRootInfo.store:vuexStore)&&vuexStore.state&&vuexStore.subscribe&&vuexStore.dispatch&&vuexStore.commit)return t.state=_objectSpread2({},o(vuexStore.state),{},n(vuexStore.getters)),t;throw Error("[vuereact-combined warn]Error: incorrect store passed in, please check the function applyVuex's parameter must be vuex store")}return _inherits(e,React.Component),_createClass(e,[{key:"componentDidMount",value:function(){var e=this;this.watch=vuexStore.watch(function(){return _objectSpread2({},o(vuexStore.state),{},n(vuexStore.getters))},function(t){e.setState(t)},{deep:!0})}},{key:"componentWillUnmount",value:function(){this.watch()}},{key:"render",value:function(){return React.createElement(t,_extends({},this.props,_objectSpread2({},this.state,{},a(vuexStore.commit),{},s(vuexStore.dispatch)),{ref:this.props.forwardedRef}))}}])})();return React.forwardRef(function(t,e){return React.createElement(r,_extends({forwardedRef:e},t))})}}function applyVuex(t){vuexStore=t}var vueRouterInfo={};function widthVueRouter(t){var r=(()=>{function e(t){if(_classCallCheck(this,e),t=_callSuper(this,e,[t]),!vueRouterInfo.instance){if(!vueRootInfo.router)throw Error("Vue router does not exist! You must setting the Vue router in the Vue Instance options first.");vueRouterInfo.instance=new Vue({router:vueRootInfo.router})}return t.state={$vueRouter:vueRouterInfo.instance.$router,$vueRoute:vueRouterInfo.instance.$route},t}return _inherits(e,React.Component),_createClass(e,[{key:"componentDidMount",value:function(){var t=this;this.subscribe=vueRouterInfo.instance.$watch("$route",function(){t.setState({$vueRouter:vueRouterInfo.instance.$router,$vueRoute:vueRouterInfo.instance.$route})})}},{key:"componentWillUnmount",value:function(){this.subscribe()}},{key:"render",value:function(){return React.createElement(t,_extends({},this.props,this.state,{ref:this.props.forwardedRef}))}}])})();return React.forwardRef(function(t,e){return React.createElement(r,_extends({forwardedRef:e},t))})}var useReactInVue=applyReactInVue,useVueInReact=applyVueInReact,useRedux=applyRedux,useVuex=applyVuex;export{REACT_ALL_HANDLERS,VueContainer,applyReactInVue,applyReactRouterInVue,applyRedux,applyVueInReact,applyVuex,connectVuex,lazyReactInVue,lazyVueInReact,useReactInVue,useRedux,useVueInReact,useVuex,vueRootInfo,widthVueRouter as withVueRouter};