var HaikuVueAdapter = (function () {
'use strict';

function unwrapExports (x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}

function createCommonjsModule(fn, module) {
	return module = { exports: {} }, fn(module, module.exports), module.exports;
}

var StringUtils = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.ALPHABET = 'abcdefghijklmnopqrstuvwxyz';
function randomString(len) {
    var str = '';
    while (str.length < len) {
        str += exports.ALPHABET[Math.floor(Math.random() * exports.ALPHABET.length)];
    }
    return str;
}
exports.randomString = randomString;

});

unwrapExports(StringUtils);
var StringUtils_1 = StringUtils.ALPHABET;
var StringUtils_2 = StringUtils.randomString;

var HaikuVueDOMAdapter_1 = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });

function HaikuVueDOMAdapter(haikuComponentFactory) {
    return {
        props: {
            haikuOptions: Object,
            haikuStates: Object,
            eventHandlers: Object,
            timelines: Object,
            vanities: Object,
            placeholder: Object,
        },
        mounted: function () {
            var _this = this;
            this.haiku = haikuComponentFactory(this.$el, {
                ref: this.$el,
                options: this.$props.haikuOptions,
                states: this.$props.haikuStates,
                eventHandlers: this.$props.eventHandlers,
                timelines: this.$props.timelines,
                vanities: this.$props.vanities,
                placeholder: this.$props.placeholder,
                onHaikuComponentWillInitialize: function (component) {
                    _this.$emit('haikuComponentWillInitialize', component);
                },
                onHaikuComponentDidMount: function (component) {
                    _this.$emit('haikuComponentDidMount', component);
                },
                onHaikuComponentWillMount: function (component) {
                    _this.$emit('haikuComponentWillMount', component);
                },
                onHaikuComponentDidInitialize: function (component) {
                    _this.$emit('haikuComponentDidInitialize', component);
                },
                onHaikuComponentWillUnmount: function (component) {
                    _this.$emit('haikuComponentWillUnmount', component);
                },
            });
        },
        updated: function () {
            this.haiku.assignConfig({
                options: this.$props.haikuOptions,
                states: this.$props.haikuStates,
                eventHandlers: this.$props.eventHandlers,
                timelines: this.$props.timelines,
                vanities: this.$props.vanities,
                placeholder: this.$props.placeholder,
            });
        },
        destroyed: function () {
            this.haiku.callUnmount();
        },
        render: function (createElement) {
            return createElement('div', {
                attrs: {
                    id: 'haiku-vueroot-' + StringUtils.randomString(24),
                },
                style: {
                    position: 'relative',
                    margin: 0,
                    padding: 0,
                    border: 0,
                    width: '100%',
                    height: '100%',
                    transform: 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)',
                },
            });
        },
    };
}
exports.default = HaikuVueDOMAdapter;

});

unwrapExports(HaikuVueDOMAdapter_1);

var vueDom = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });

exports.default = HaikuVueDOMAdapter_1.default;

});

unwrapExports(vueDom);

/**
 * Copyright (c) Haiku 2016-2018. All rights reserved.
 */

var vue = vueDom.default;

return vue;

}());
