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K,EAAa,UAGJ,EAAa,WAClC,EAAgB,EAAa,WAAW,GAEhD,CATC,CASC,GAEK,CACX,CAEA,SAAS,oBAAoB,GACzB,IAAI,EAAS,SAAS,YAElB,EAAS,GAeb,OAbA,MAAM,UAAU,QAAQ,KAAK,GAAQ,SAAU,GAC3C,IAAI,EAAQ,EAAM,UAAY,EAAM,MAEpC,MAAM,UAAU,QAAQ,KAAK,GAAO,SAAU,GAEtC,EAAS,MAAK,SAAU,GACxB,OAAO,EAAK,aAAa,QAAQ,IAAO,CAC5C,KACI,EAAO,KAAK,EAEpB,GACJ,IAEO,CACX,CAEA,SAAS,gBAAgB,EAAU,EAAU,GACzC,IAAK,IAAI,KAAU,EACX,EAAS,KAAY,EAAS,IAC9B,EAAO,EAAQ,EAAS,GAGpC,CAjGA,eAAe,OAAO,YAAa,UAoGnC,IAAI,QAAU,QAAQ,QAAU","file":"/npm/vue-web-component@1.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vue-web-component@1.2.0/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\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.version = undefined;\nexports.default = VueWebComponent;\n\nvar _construct = require('babel-runtime/core-js/reflect/construct');\n\nvar _construct2 = _interopRequireDefault(_construct);\n\nvar _freeze = require('babel-runtime/core-js/object/freeze');\n\nvar _freeze2 = _interopRequireDefault(_freeze);\n\nvar _assign = require('babel-runtime/core-js/object/assign');\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _get2 = require('babel-runtime/helpers/get');\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _skatejs = require('skatejs');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _fixBabelExtend = function (O) {\n    var gOPD = O.getOwnPropertyDescriptor,\n        gPO = O.getPrototypeOf || function (o) {\n        return o.__proto__;\n    },\n        sPO = O.setPrototypeOf || function (o, p) {\n        o.__proto__ = p;\n        return o;\n    },\n        construct = typeof Reflect === 'object' ? _construct2.default : function (Parent, args, Class) {\n        var Constructor,\n            a = [null];\n        a.push.apply(a, args);\n        Constructor = Parent.bind.apply(Parent, a);\n        return sPO(new Constructor(), Class.prototype);\n    };\n\n    return function fixBabelExtend(Class) {\n        var Parent = gPO(Class);\n        return sPO(Class, sPO(function Super() {\n            return construct(Parent, arguments, gPO(this).constructor);\n        }, Parent));\n    };\n}(Object);\n\n// create a Custom Element class from a Vue component\nfunction VueWebComponent(vueComponent, ElementClass) {\n    ElementClass = ElementClass || _fixBabelExtend(function (_HTMLElement) {\n        (0, _inherits3.default)(_class, _HTMLElement);\n\n        function _class() {\n            (0, _classCallCheck3.default)(this, _class);\n\n            return (0, _possibleConstructorReturn3.default)(this, (_class.__proto__ || (0, _getPrototypeOf2.default)(_class)).apply(this, arguments));\n        }\n\n        return _class;\n    }(HTMLElement));\n\n    // NOTE! This mutates the given component spec, see\n    // https://github.com/vuejs/vue/issues/7494. We do this up front (instead of\n    // lazily in the element's renderer callback) so that when we're ready to\n    // work with the spec it has already been mutated and there won't be any\n    // surprises (or uglier code that conditionally checks for both forms of the\n    // spec).\n    var Component = _vue2.default.extend(vueComponent);\n\n    // map from Vue prop types to SkateJS prop types\n    var vuePropTypes = makeVuePropTypes(vueComponent.props);\n\n    // contains scope ID of this element's Vue component as well as sub component\n    // IDs\n    var scopeIds = getAllScopeIds(vueComponent);\n\n    // this will contain all CSS rules for this element's Vue component and\n    // sub-components\n    var matchingRules = null;\n\n    return function (_withUpdate) {\n        (0, _inherits3.default)(VueWebComponent, _withUpdate);\n\n        function VueWebComponent() {\n            var args = [],\n                len = arguments.length;\n            while (len--) args[len] = arguments[len];\n\n            (0, _classCallCheck3.default)(this, VueWebComponent);\n\n            var _this2 = (0, _possibleConstructorReturn3.default)(this, (ref = VueWebComponent.__proto__ || (0, _getPrototypeOf2.default)(VueWebComponent)).call.apply(ref, [this].concat(args)));\n\n            _this2.vue_instance = new Component();\n            _this2.vue_instancePromise = null;\n            _this2.vue_mounted = false;\n            return _this2;\n            var ref;\n        }\n\n        /**\n         * Define a renderer that mounts a Vue component in this element's shadow\n         * root.\n         */\n\n        (0, _createClass3.default)(VueWebComponent, [{\n            key: 'renderer',\n            value: function renderer(root, render) {\n                var this$1 = this;\n\n                if (this.vue_mounted) {\n                    return;\n                }\n\n                // mount the component\n                this.vue_mountComponent(root);\n\n                // bring in the global styling\n                requestAnimationFrame(function () {\n                    return this$1.vue_applyStyle(root);\n                });\n            }\n\n            /**\n             * mount a Vue `component` inside the given `container`. This is analgous\n             * to ReactDOM.render.\n             */\n\n        }, {\n            key: 'vue_mountComponent',\n            value: function vue_mountComponent(container) {\n\n                // `tmp` will get replaced by the DOM generated from the component\n                var tmp = document.createElement('tmp');\n                tmp.style.display = 'none';\n                container.appendChild(tmp);\n\n                this.vue_instance.$mount(tmp);\n\n                this.vue_mounted = true;\n            }\n\n            /**\n             * finds the global style that contains this element's Vue instance's style\n             * and style of its sub-components and copies the styles into this\n             * element's shadow root, otherwise the global style will not penetrate\n             * into the shadow root.\n             */\n\n        }, {\n            key: 'vue_applyStyle',\n            value: function vue_applyStyle(root) {\n\n                // if no components have scoped style\n                if (!scopeIds.length) {\n                    return;\n                }\n\n                var newStyle = document.createElement('style');\n\n                // WebKit hack, requires appending a text node\n                newStyle.appendChild(document.createTextNode('/* Vue styles are inside this element\\'s CSSStyleSheet */'));\n\n                // newStyle.sheet won't exist unless the element is first appended\n                root.appendChild(newStyle);\n                var newSheet = newStyle.sheet;\n                var newRules = newSheet.cssRules || newSheet.rules;\n\n                // we have to initialize this here (not outside the class) because global\n                // styles are added to DOM after the first Vue instance is created\n                if (!matchingRules) {\n                    matchingRules = getMatchingCSSRules(scopeIds);\n                }\n\n                for (var i = 0, list = matchingRules; i < list.length; i += 1) {\n                    var rule = list[i];\n\n                    newSheet.insertRule(rule.cssText, newRules.length);\n                }\n\n                // TODO: make sure this works with conditional content. Maybe\n                // conditional content that isn't rendered yet doesn't have it's\n                // styles inserted into DOM???\n            }\n        }, {\n            key: 'updated',\n            value: function updated(prevProps, prevState) {\n                var this$1 = this;\n\n                (0, _get3.default)(VueWebComponent.prototype.__proto__ || (0, _getPrototypeOf2.default)(VueWebComponent.prototype), 'updated', this).call(this, prevProps, prevState);\n\n                // pass this.props as first arg, whose keys are iterated on in\n                // forChangedProps, otherwise nothing happens the first time\n                // because prevProps is empty at first.\n                forChangedProps(this.props, prevProps, function (name, oldVal) {\n                    // pass the value along\n                    this$1.vue_instance[name] = this$1[name];\n                });\n            }\n        }], [{\n            key: 'props',\n            get: function () {\n                return vuePropTypes;\n            }\n        }]);\n\n        return VueWebComponent;\n    }((0, _skatejs.withUpdate)((0, _skatejs.withRenderer)(ElementClass)));\n}\n\n// a hack class used so we don't conflict with Vue's builtin <slot> component. Is there a better way?\n\nvar RealSlot = function (_withLifecycle) {\n    (0, _inherits3.default)(RealSlot, _withLifecycle);\n\n    function RealSlot() {\n        var args = [],\n            len = arguments.length;\n        while (len--) args[len] = arguments[len];\n\n        (0, _classCallCheck3.default)(this, RealSlot);\n\n        var _this3 = (0, _possibleConstructorReturn3.default)(this, (ref = RealSlot.__proto__ || (0, _getPrototypeOf2.default)(RealSlot)).call.apply(ref, [this].concat(args)));\n\n        _this3.style.display = 'contents';\n        return _this3;\n        var ref;\n    }\n\n    (0, _createClass3.default)(RealSlot, [{\n        key: 'connected',\n        value: function connected() {\n            if (this.actualSlot) {\n                return;\n            }\n            this.actualSlot = document.createElement('slot');\n            this.appendChild(this.actualSlot);\n        }\n    }, {\n        key: 'updated',\n        value: function updated(prevProps) {\n            if (this.name && this.name !== prevProps.name) {\n                this.actualSlot.setAttribute('name', this.name);\n            }\n        }\n    }], [{\n        key: 'props',\n        get: function () {\n            return {\n                name: (0, _assign2.default)({}, _skatejs.props.string, { attribute: true })\n            };\n        }\n    }]);\n\n    return RealSlot;\n}((0, _skatejs.withLifecycle)((0, _skatejs.withUpdate)(HTMLElement)));\n\ncustomElements.define('real-slot', RealSlot);\n\nfunction makeVuePropTypes(vueProps) {\n    if (!vueProps) {\n        return {};\n    }\n\n    var result = {};\n\n    var warn = function () {\n        return console.warn('vue-web-component: The Vue component that you converted into a custom element will receive only string values from the \"' + key + '\" attribute. If you\\'d like string values from attributes coerced into a certain type, define that type in your Vue component. For example: props: { \"' + key + '\": Number }');\n    };\n\n    function getDefault(vueProp) {\n        // TODO: calling the default value factory and using that single value\n        // causes all instanced of the element to use the same cached value for\n        // Objects and Arrays. How to fix?\n        if (typeof vueProp.default == 'function') {\n            return (0, _freeze2.default)(vueProp.default());\n        } else {\n            return vueProp.default;\n        }\n    }\n\n    for (var key$1 in vueProps) {\n        var prop = vueProps[key$1];\n        var defaultVal = getDefault(prop);\n\n        if (prop.type === null) {\n            result[key$1] = _skatejs.props.any;\n            warn();\n            console.warn('vue-web-component: You did not specify a prop type for the attribute mentioned in the previous warning. Any values for this attribute will be passed as a string value to the Vue component.');\n        } else if (prop.type === Number) {\n            result[key$1] = (0, _assign2.default)({}, _skatejs.props.number, { default: defaultVal });\n        } else if (prop.type === String) {\n            result[key$1] = (0, _assign2.default)({}, _skatejs.props.string, { default: defaultVal });\n        } else if (prop.type === Boolean) {\n            result[key$1] = (0, _assign2.default)({}, _skatejs.props.boolean, { default: defaultVal });\n        } else if (prop.type === Object) {\n            result[key$1] = (0, _assign2.default)({}, _skatejs.props.object, { default: defaultVal });\n        } else if (prop.type === Array) {\n            result[key$1] = (0, _assign2.default)({}, _skatejs.props.array, { default: defaultVal });\n        } else {\n            result[key$1] = _skatejs.props.any;\n            warn();\n            console.warn('vue-web-component: You specified a type in your Vue component that is currently is not supported by vue-web-component. Any values for the attribute mentioned in the previous warning will be passed as string value to the Vue component.');\n        }\n    }\n\n    return result;\n}\n\nfunction getAllScopeIds(vueComponent) {\n\n    var result = [];\n\n    ~function _getAllScopeIds(vueComponent) {\n\n        if (vueComponent._scopeId) {\n            result.push(vueComponent._scopeId);\n        }\n\n        for (var subComponent in vueComponent.components) {\n            _getAllScopeIds(vueComponent.components[subComponent]);\n        }\n    }(vueComponent);\n\n    return result;\n}\n\nfunction getMatchingCSSRules(scopeIds) {\n    var sheets = document.styleSheets;\n\n    var result = [];\n\n    Array.prototype.forEach.call(sheets, function (sheet) {\n        var rules = sheet.cssRules || sheet.rules;\n\n        Array.prototype.forEach.call(rules, function (rule) {\n\n            if (scopeIds.some(function (id) {\n                return rule.selectorText.indexOf(id) > -1;\n            })) {\n                result.push(rule);\n            }\n        });\n    });\n\n    return result;\n}\n\nfunction forChangedProps(oldProps, newProps, action) {\n    for (var oldKey in oldProps) {\n        if (oldProps[oldKey] !== newProps[oldKey]) {\n            action(oldKey, oldProps[oldKey]);\n        }\n    }\n}\n\n// IMPORTANT! keep this line as the last line, it is auto-generated from package.json version.\nvar version = exports.version = '1.2.0';"]}