{"version":3,"sources":["jsdelivr-header.js","/npm/vue-setstate@0.0.4/libs/vue-setstate.cjs.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,SAAS,gBAAiB,GAAM,OAAQ,GAAqB,iBAAP,GAAoB,YAAa,EAAM,EAAY,QAAI,CAAI,CAEjH,IAAI,OAAS,gBAAgB,QAAQ,uBAErC,SAAS,SAAS,GAChB,SAAS,EAAqB,EAAI,GAChC,IAAK,IAAI,KAAQ,EACf,EAAG,GAAQ,EAAM,EAErB,CAEA,SAAS,EAAc,GACR,MAAT,IAEA,OAAO,EAAO,WAChB,EAAqB,KAAM,GAGzB,OAAO,EAAO,aAChB,EAAqB,KAAM,EAAM,KAAK,KAAM,OAEhD,CAEA,EAAI,UAAU,SAAW,SAAU,GACjC,EAAc,KAAK,KAAM,GACzB,KAAK,UAAU,KAAK,aACtB,EAEA,EAAI,MAAM,CACR,aAAc,WACZ,EAAc,KAAK,KAAM,KAAK,SAAS,MACzC,GAEJ,CAEsB,oBAAX,QAA0B,OAAO,KAC1C,SAAS,OAAO,KAGlB,OAAO,QAAU","file":"/npm/vue-setstate@0.0.4/libs/vue-setstate.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vue-setstate@0.0.4/libs/vue-setstate.cjs.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\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar isType = _interopDefault(require('sewing/dist/isType'));\n\nfunction setState(Vue) {\n  function assignmentProp2State(vm, state) {\n    for (var prop in state) {\n      vm[prop] = state[prop];\n    }\n  }\n\n  function mountState2VM(state) {\n    if (state == null) return;\n\n    if (isType(state, 'Object')) {\n      assignmentProp2State(this, state);\n    }\n\n    if (isType(state, 'Function')) {\n      assignmentProp2State(this, state.call(this, this));\n    }\n  }\n\n  Vue.prototype.setState = function (state) {\n    mountState2VM.call(this, state);\n    this.$nextTick(this.$forceUpdate);\n  };\n\n  Vue.mixin({\n    beforeCreate: function () {\n      mountState2VM.call(this, this.$options.state);\n    }\n  });\n}\n\nif (typeof window !== 'undefined' && window.Vue) {\n  setState(window.Vue);\n}\n\nmodule.exports = setState;\n"]}