2019-10-29 07:20:54 +00:00
|
|
|
import Vue from 'vue';
|
2020-01-09 07:36:40 +00:00
|
|
|
import Vuelidate from 'vuelidate';
|
2020-04-02 06:58:38 +00:00
|
|
|
import VueI18n from 'vue-i18n';
|
2022-04-21 05:57:28 +00:00
|
|
|
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
2022-04-19 07:17:29 +00:00
|
|
|
import VueFormulate from '@braid/vue-formulate';
|
2019-10-29 07:20:54 +00:00
|
|
|
import store from '../widget/store';
|
|
|
|
import App from '../widget/App.vue';
|
|
|
|
import ActionCableConnector from '../widget/helpers/actionCable';
|
2020-04-02 06:58:38 +00:00
|
|
|
import i18n from '../widget/i18n';
|
2022-04-19 07:17:29 +00:00
|
|
|
import { isPhoneE164OrEmpty } from 'shared/helpers/Validators';
|
2022-01-12 10:55:27 +00:00
|
|
|
import router from '../widget/router';
|
2022-05-16 05:59:05 +00:00
|
|
|
import { domPurifyConfig } from '../shared/helpers/HTMLSanitizer';
|
2020-04-02 06:58:38 +00:00
|
|
|
Vue.use(VueI18n);
|
2020-01-09 07:36:40 +00:00
|
|
|
Vue.use(Vuelidate);
|
2022-05-16 05:59:05 +00:00
|
|
|
Vue.use(VueDOMPurifyHTML, domPurifyConfig);
|
2020-01-09 07:36:40 +00:00
|
|
|
|
2020-12-12 06:38:36 +00:00
|
|
|
const i18nConfig = new VueI18n({
|
|
|
|
locale: 'en',
|
|
|
|
messages: i18n,
|
2020-04-02 06:58:38 +00:00
|
|
|
});
|
2022-04-19 07:17:29 +00:00
|
|
|
Vue.use(VueFormulate, {
|
|
|
|
rules: {
|
|
|
|
isPhoneE164OrEmpty: ({ value }) => isPhoneE164OrEmpty(value),
|
|
|
|
},
|
|
|
|
classes: {
|
|
|
|
outer: 'mb-4 wrapper',
|
|
|
|
error: 'text-red-400 mt-2 text-xs font-medium',
|
|
|
|
},
|
|
|
|
});
|
2020-07-07 18:34:44 +00:00
|
|
|
// Event Bus
|
|
|
|
window.bus = new Vue();
|
|
|
|
|
2019-10-29 07:20:54 +00:00
|
|
|
Vue.config.productionTip = false;
|
2020-07-07 18:34:44 +00:00
|
|
|
|
2019-10-29 07:20:54 +00:00
|
|
|
window.onload = () => {
|
|
|
|
window.WOOT_WIDGET = new Vue({
|
2022-01-12 10:55:27 +00:00
|
|
|
router,
|
2019-10-29 07:20:54 +00:00
|
|
|
store,
|
2020-12-12 06:38:36 +00:00
|
|
|
i18n: i18nConfig,
|
2019-10-29 07:20:54 +00:00
|
|
|
render: h => h(App),
|
|
|
|
}).$mount('#app');
|
|
|
|
|
|
|
|
window.actionCable = new ActionCableConnector(
|
|
|
|
window.WOOT_WIDGET,
|
|
|
|
window.chatwootPubsubToken
|
|
|
|
);
|
|
|
|
};
|