/*
    *
    * Wijmo Library 5.20183.550
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
import*as wjcCore from"wijmo/wijmo";var __glob="undefined"!=typeof window?window:self;import*as wjcSelfRef from"wijmo/wijmo.vue2.base";var wjcSelf=wjcSelfRef||exports;__glob.wijmo=__glob.wijmo||{},__glob.wijmo.vue2=__glob.wijmo.vue2||{},__glob.wijmo.vue2.base=wjcSelf;import VueModuleDefault from"vue";import*as VueModule from"vue";export var Vue=VueModuleDefault||VueModule;export var WjVueBase=Vue.extend({beforeCreate:function(){let t=this.$options[WjComponentBehavior._behClassProp];t&&(this[WjComponentBehavior._behProp]=t._attach(this))},mounted:function(){this[WjComponentBehavior._behProp].lhMounted()},destroyed:function(){this[WjComponentBehavior._behProp].lhDestroyed()}});export class WjComponentBehavior{constructor(t){this._isMounted=!1,this._mountedCBs=[],this.component=t}static _attach(t){return new this(t)}static register(){let t={data:this.data,extends:WjVueBase,render:this.render,props:_getProps(this.className,this.extraProps),[WjComponentBehavior._behClassProp]:this};return Vue.component(this.tag,t)}lhMounted(){if(this._isChild()){let t=this.component.$parent;t&&(this.parent=t[WjComponentBehavior._behProp],this.parent._mountedCB(()=>{this._prepareControl(),this._initParent()}))}else this._prepareControl()}lhDestroyed(){this._siblingInsertedEH&&this._getElement().removeEventListener("DOMNodeInserted",this._siblingInsertedEH);let t=this.control;if(t)if(this._isChild()){let e=this._getParentProp();if(e){let o=this.parent.control[e];if(wjcCore.isArray(o)){let e=o.indexOf(t);e>-1&&o.splice(e,1)}}}else t instanceof wjcCore.Control&&t.dispose()}_createControl(){let t=this._isChild()?this._isParentInCtor()?this.parent.control:void 0:this._getElement();return new(this.constructor._getControlType())(t)}_initParent(){let t=this._getParentProp();if(t){let e=this.parent.control,o=e[t];if(wjcCore.isArray(o)){let t=this._getSiblingIndex();(t<0||t>=o.length)&&(t=o.length),o.splice(t,0,this.control),this._siblingInsertedEH=this._siblingInserted.bind(this),this._getElement().addEventListener("DOMNodeInserted",this._siblingInsertedEH)}else e[t]=this.control}}_updateControl(t,e){this.control[t]=e}_prepareControl(){let t=this.control=this._createControl(),e=this._getElement(),o=(wjcCore.Control,this.constructor);this._siblingId||(null==o.siblingId&&(o.siblingId=++o._siblingDirId+""),this._siblingId=o.siblingId),e.setAttribute(o._typeSiblingIdAttr,this._siblingId),this._isMounted=!0;let i=this._mountedCBs;this._mountedCBs=[];for(let t of i)t();_initialize(this.component,t)}_isChild(){let t=this.constructor;return null!=t.parentProp||null!=t.parentInCtor}_isParentInCtor(){return!0===this.constructor.parentInCtor}_getParentProp(){return this.component.$options.propsData.wjProperty||this.constructor.parentProp}_getSiblingIndex(){var t=this._getElement(),e=t.parentElement;if(!e)return-1;for(var o=e.childNodes,i=-1,r=this._siblingId,n=0;n<o.length;n++){var s=o[n];if(1==s.nodeType&&s.getAttribute(WjComponentBehavior._typeSiblingIdAttr)==r&&(++i,s===t))return i}return-1}_siblingInserted(t){if(t.target===this._getElement()){var e=this._getSiblingIndex(),o=this.control,i=this.parent.control[this._getParentProp()],r=i.indexOf(o);e>=0&&r>=0&&e!==r&&(i.splice(r,1),e=Math.min(e,i.length),i.splice(e,0,o))}}_getElement(){return this.component.$el}static _getControlType(){return this.classCtor()}_mountedCB(t){this._isMounted?t():this._mountedCBs.push(t)}};WjComponentBehavior.render=function(t){return t("div",[this.$slots.default])},WjComponentBehavior._typeSiblingIdAttr="_wjSiblingId",WjComponentBehavior._behClassProp="_wjBehCl",WjComponentBehavior._behProp="__wjBeh",WjComponentBehavior._siblingDirId=0;export function _getProps(t,e){for(var o=window,i=t.split("."),r=0;r<i.length&&null!=o;r++)o=o[i[r]];if(!o)return null;for(var n=["control","initialized","wjProperty"],s=o.prototype;s!=Object.prototype;s=Object.getPrototypeOf(s))for(var l=Object.getOwnPropertyNames(s),r=0;r<l.length;r++){var h=l[r],a=Object.getOwnPropertyDescriptor(s,h),p=h.match(/^on[A-Z]/);(a.set||p)&&(p&&(h=h[2].toLowerCase()+h.substr(3)),n.indexOf(h)<0&&!h.match(/disabled|required|style/)&&n.push(h))}return e&&Array.prototype.push.apply(n,e),n};export function _initialize(t,e){function o(t){this.cmp[WjComponentBehavior._behProp]._updateControl(this.prop,t)}var i=[];for(var r in t.$options.propsData)i.push(r);i.sort();let n=t[WjComponentBehavior._behProp].constructor.extraProps;return i.forEach(i=>{!(i in e||n&&n.indexOf(i)>-1)||e[i]instanceof wjcCore.Event||wjcCore.isUndefined(t[i])||(t[WjComponentBehavior._behProp]._updateControl(i,t[i]),t.$watch(i,o.bind({cmp:t,prop:i})))}),function(){var o=t.$el,i={};"style"in e&&o.style.cssText.length&&(o.style.cssText.split(";").forEach(t=>{var e=t.split(":");2==e.length&&(i[e[0].trim()]=e[1].trim())}),e.style=i)}(),i.forEach(o=>{if(e[o]instanceof wjcCore.Event){var i=e[o];wjcCore.isFunction(t[o])&&i.addHandler(t[o],e)}}),t.control&&t.$parent&&(t.$parent[t.control]=e),wjcCore.isFunction(t.initialized)&&t.initialized(e),e};