/*
*
* Wijmo Library 3.20133.20
* http://wijmo.com/
*
* Copyright(c) GrapeCity, Inc. All rights reserved.
*
* Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
* licensing@wijmo.com
* http://wijmo.com/widgets/license/
*
*
*/
var wijmo;(function(e){e.expando=".wijmo";var t=function(){function e(e){this.message=e,this.stack="Wijmo"+(new Error).stack,this.name="WijmoError"}return e}();e.WijmoError=t;var n=t;n.prototype=new Error,n.prototype.constructor=n})(wijmo||(wijmo={}));var wijmo;(function(e){(function(t){var n=function(){function t(e){this.object=e}return t.getFrom=function(r,i){typeof i=="undefined"&&(i=!0);var s=e.expando,o;if(Object(r)!==r)return null;o=r[s],o&&o.object!==r&&(o=null);if(i&&!(o instanceof t&&Object.prototype.hasOwnProperty.call(r,s))){o=new t(r);try{Object.defineProperty(r,s,{value:o,configurable:!1,enumerable:!1,writable:!1})}catch(u){r[s]=o}}return o},t}();t.Expando=n})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var wijmo;(function(e){(function(e){(function(e){function t(e){return function(){var t=function(){return e.prototype._call.apply(t,arguments)};return $.extend(t,e.prototype),e.apply(t,arguments),t}}e.funcClass=t})(e.util||(e.util={}));var t=e.util})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(e){(function(e){function i(e){return t.isFunction(e.subscribe)}function l(e){return typeof e=="undefined"&&(e=null),new f(e)}function c(e){return typeof e=="undefined"&&(e=null),new f(e,!0)}function h(e){return t.isFunction(e)&&i(e)}var t=jQuery,n=function(){function e(e,t){this.handler=e,this.context=t}return e.prototype.trigger=function(e){return this.handler.apply(this.context,e)},e}();e.SubscriberEntry=n;var r=function(){function r(e){this.defaultContext=e,this._entries=[]}return r.prototype.subscribe=function(t,r){typeof r=="undefined"&&(r=this.defaultContext);var i=this,s=new n(t,r);return this._entries.push(s),{dispose:function(){return e.util.remove(i._entries,s)}}},r.prototype.trigger=function(){var t=[];for(var n=0;n0&&(!this.checkNewValue||e!==this.value)&&(this.value=e,this._trigger(e),this._readOnly&&this._readOnly._trigger(e)),this.value},t.prototype.read=function(){return this._readOnly=this._readOnly||new u(this),this._readOnly},t}(s);e._MutableObservable=a;var f=e.util.funcClass(a);e.observable=l,e.observableWithNewValueCheck=c,e.isObservable=h})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var wijmo;(function(e){(function(t){(function(n){function i(e,t){return typeof t=="undefined"&&(t=!1),r.isArray(e)?e=e.slice(0):r.isPlainObject(e)&&(e=r.extend(!!t,{},e)),e}function s(e){return typeof e=="string"||e instanceof String}function o(e){return typeof e=="number"}function u(t){return t===e.expando||t===r.expando}function a(e,t){var n=this;r.each(e,function(e,r){if(!u(e))return t.call(n,e,r)})}function f(t,n){var i=r.map(t,n);return delete i[e.expando],i}function l(e){var t;return e&&r.isFunction(e.toString)&&e.toString!==Object.prototype.toString?t=e.toString():t=JSON.stringify(e),t!=null&&t.length>2&&t[0]==='"'&&t[t.length-1]==='"'&&(t=t.substr(1,t.length-2)),t}function c(e){var t=[];for(var n=0;nt?1:0):(o=e-t,isNaN(o)?0:o)}function v(e,t){return r.inArray(t,e)>=0}function m(e,t){var n=0,r;for(r=0;r=0?(s=n.substring(r,o),r=o+1):r>0?s=n.substring(r):s=n,i=i[s],t.isObservable(i)&&(i=i());if(o<0)break}return i}function E(e,n,r){var i=0,s;for(;;){var o=n.indexOf(".",i);o>=0?(s=n.substring(i,o),i=o+1):i>0?s=n.substring(i):s=n;var u=e[s];if(!(o>=0)){t.isObservable(u)?u(r):e[s]=r;break}t.isObservable(u)&&(u=u()),e=u}}function S(e){return typeof e=="object"&&!r.isArray(e)&&!r.isPlainObject(e)&&e.constructor!==Object.prototype.constructor}function x(e){t.util.each(e,function(e,n){if(!n||typeof n!="object")return;t.util.each(n,function(e,r){var i;if(!t.util.isString(r))return;i=/\/Date\((-?\d+)\)\//.exec(r);if(!i)return;n[e]=new Date(parseInt(i[1],10))})})}var r=jQuery;n.clone=i,n.isString=s,n.isNumeric=o,n.isInternalProperty=u,n.each=a,n.map=f,n.toStr=l,n.format=c,n.every=h,n.some=p,n.compare=d,n.contains=v,n.remove=m,n.pageCount=g,n.executeDelayed=y,n.logError=b,n.getProperty=w,n.setProperty=E,n.isClassInstance=S,n.convertDateProperties=x;var T=function(){function e(e){this.key=e}return e}();n.HashMapEntry=T;var N=function(){function e(){this.hash={}}return e.prototype.getEntry=function(e,t){typeof t=="undefined"&&(t=!1);if(e===null)return!this.nullEntry&&t&&(this.nullEntry=new T(e)),this.nullEntry;var n=String(e),r=this.hash[n],i;if(r==null){if(!t)return null;r=[],this.hash[n]=r}for(var s=0;s0&&(n.unshift(r),r=t.util.format.apply(this,n)),r=$.trim(r),s=r[r.length-1],s!=="."&&s!=="!"&&s!=="?"&&(r+="."),new e.WijmoError(r)}t.errors[n]=function(){throw i.apply(this,arguments)},t.errors[n].create=i})},t.errors._register({indexOutOfBounds:"Index is outside the bounds of the array.",notImplemented:"The operation is not implemented",unsupportedOperation:"Unsupported operation",unsupportedFilterOperator:"Unsupported filter operator: {0}",unsupportedDataSource:"Unsupported data source",argument:function(e){var t="Unexpected argument value.";return e&&(t+="\nParameter name: "+e),t},argumentNull:"Argument '{0}' is null/undefined",noParser:"There is no parser for type '{0}'",noUrl:"Url is not specified",cantConvert:"Value can't be converted to type '{0}': '{1}'",noGlobalize:"Globalize is not defined. Make sure you include globalize.js",itemNotInView:"Item {0} is not in the data view",unsupportedFilterFormat:"The filter format is not supported",multiPropertyKeysNotSupported:"Entities with multiple properties in the primary key are not supported. Entity type: {0}",keyPropertyNotFound:"Key property not found in {0} entity type"})})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var wijmo;(function(e){(function(e){(function(t){function r(n,r){typeof r=="undefined"&&(r=!1),n=n.toLowerCase();var i=t.ops[n];if(!i){var s=t.opMap[n];s&&(i=t.ops[s])}return!i&&r&&e.errors.unsupportedFilterOperator(n),i}function i(i){var s;if(!n.isPlainObject(i))return{operator:"==",op:t.ops.equals,value:i};var o=i.operator||t.ops.equals;if(e.util.isString(i.operator)){if(i.operator.toLowerCase()==="nofilter")return null;o=r(i.operator,!0)}else n.isFunction(o.apply)||e.errors.unsupportedFilterOperator(o);return{operator:i.operator,op:o,value:i.value}}function s(t){var r={isEmpty:!1,original:t,func:null,normalized:null};if(n.isFunction(t))r.func=t;else if(n.isArray(t))e.errors.unsupportedFilterFormat(t);else if(t){r.normalized={};var s=!1;e.util.each(t,function(t,o){n.isArray(o)&&e.errors.unsupportedFilterFormat(),o=i(o),o&&(r.normalized[t]=o,s=!0)}),s?r.func=function(t){return e.util.every(r.normalized,function(n,r){var i=e.util.getProperty(t,r);return n.op.apply(i,n.value)})}:r.normalized=null}return!r.normalized&&!r.func&&(r.isEmpty=!0,r.func=function(e){return!0}),r}var n=jQuery;t.opMap={"==":"equals",doesnotcontain:"notcontain","!=":"notequal",">":"greater","<":"less",">=":"greaterorequal","<=":"lessorequal",isnotempty:"notisempty",isnotnull:"notisnull"},t.normalizeCondition=i,t.compile=s,t.ops=function(){function r(e,n,r,i,s){return t[e.toLowerCase()]={name:e,displayName:n,arity:r,applicableTo:i,apply:s}}function i(t){return t instanceof Date&&(t=t.getTime()),e.util.isString(t)&&(t=t.toLowerCase()),t}function s(e,t,n,s){r(e,t,2,n,function(e,t){return s(i(e),i(t))})}function o(e,t,n,i){r(e,t,1,n,i)}function u(e,t,r){s(e,t,n.prim,r)}function a(e,t,r){s(e,t,n.str,r)}var t={},n={str:["string"],prim:["string","number","datetime","currency","boolean"]};return u("Equals","Equals",function(e,t){return e==t}),u("NotEqual","Not equal",function(e,t){return e!=t}),u("Greater","Greater than",function(e,t){return e>t}),u("Less","Less than",function(e,t){return e=t}),u("LessOrEqual","Less or equal",function(e,t){return e<=t}),a("Contains","Contains",function(e,t){return e==t||e&&e.indexOf&&e.indexOf(t)>=0}),a("NotContain","Does not contain",function(e,t){return e!=t&&(!e||!e.indexOf||e.indexOf(t)<0)}),a("BeginsWith","Begins with",function(e,t){return e==t||e&&e.indexOf&&e.indexOf(t)==0}),a("EndsWith","Ends with",function(t,n){var r;return!e.util.isString(t)||!e.util.isString(n)?!1:(r=t.lastIndexOf(n),r>=0&&t.length-r===n.length)}),o("IsEmpty","Is empty",n.str,function(e){return!e&&e!==0&&e!==!1}),o("NotIsEmpty","Is not empty",n.str,function(e){return!!e||e===0||e===!1}),o("IsNull","Is null",n.prim,function(e){return e==null}),o("NotIsNull","Is not null",n.prim,function(e){return e!=null}),t}()})(e.filtering||(e.filtering={}));var t=e.filtering})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var wijmo;(function(e){(function(e){(function(t){function n(t){var n=[];return t=e.util.isString(t)?t.split(/,\s*/):$.isArray(t)?t.slice(0):[t],t=$.isArray(t)?t.slice(0):[t],e.util.each(t,function(t,r){var i=!0,s;if(r==null)return;if(!e.util.isString(r)){r.property!=null&&n.push(r);return}if(r[0]==="-")i=!1,r=r.substr(1);else{var o=/\s(asc|desc)\s*$/.exec(r);o&&(r=r.substr(0,o.index),i=o[1]!=="desc")}n.push({property:r,asc:i})}),n.length>0?n:null}function r(t,r){typeof r=="undefined"&&(r=e.util.compare);var i=n(t),s={isEmpty:!0,original:t,propertyCompareTo:r,compare:null,normalized:i};return i!=null&&(s.isEmpty=!1,s.compare=function(t,n){var s=0,o,u;for(s=0;s=this.array.length)&&e.errors.indexOutOfBounds(),this.currentItem(t<0?null:this.array[t])}),this)}return n.prototype.update=function(){var e=this.currentItem(),n=this.currentPosition(),r=t.inArray(e,this.array);r<0&&e==null&&this._recentlyRemovedItem!=null&&(r=t.inArray(this._recentlyRemovedItem,this.array)),r>=0?(e&&(this._recentlyRemovedItem=e),this.currentPosition(r)):n>=0&&n0?(n=this.array.length-1,this.currentPosition(n),this.currentItem(this.array[n])):(this.currentPosition(-1),this.currentItem(null))},n.prototype.updateDelayed=function(){e.util.executeDelayed(this.update,this)},n}();e.CurrencyManager=n})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var wijmo;(function(e){(function(e){var t=jQuery,n=function(){function t(t){function n(){this.pageSize()>0&&this.pageIndex()>=0?(this._skip=this.pageSize()*this.pageIndex(),this._take=this.pageSize()):(this._skip=0,this._take=-1),t(!0)}this.onChanged=t,this.filter=e.observable(),this._compiledFilter=e.filtering.compile(null),this.sort=e.observable(),this._compiledSort=e.sorting.compile(null),this.pageIndex=e.observable(0),this.pageSize=e.observable(0),this._skip=0,this._take=-1,this.filter.subscribe(function(e){this.onFilterChanged(e),t()},this),this.sort.subscribe(function(){this._compiledSort=e.sorting.compile(this.sort()),t()},this),this.pageIndex.subscribe(n,this),this.pageSize.subscribe(n,this)}return t.prototype.onFilterChanged=function(t){this._compiledFilter=e.filtering.compile(t)},t.prototype.setFilter=function(e){this.filter(e)},t.prototype.update=function(e){"filter"in e&&this.setFilter(e.filter),"sort"in e&&this.sort(e.sort),"pageSize"in e&&this.pageSize(e.pageSize),"pageIndex"in e&&this.pageIndex(e.pageIndex)},t.prototype.apply=function(e,t,n){typeof t=="undefined"&&(t=!0),typeof n=="undefined"&&(n=null);var r;if(!this._compiledFilter.isEmpty){n?n.length=0:n=[];for(r=0;r0&&(this._skip>0&&n.splice(0,Math.min(this._skip,n.length)),this._take=this.local.length)&&e.errors.indexOutOfBounds(),this.local[t]},r.prototype.indexOf=function(e){return t.inArray(e,this.local)},r.prototype.getSource=function(){return this.sourceArray},r.prototype.toObservableArray=function(){return this._koArray||(this._koArray=ko.observableArray(this.local)),this._koArray},r._getProps=function(r){var i=[];return e.util.each(r,function(e,n){e=String(e);if(e.match(/^_/))return;if(t.isFunction(n)&&!n.subscribe)return;i.push({name:e})}),i},r.prototype.getProperties=function(){return this.count()?r._getProps(this.item(0)):[]},r.prototype._readProperty=function(t,n){return e.util.getProperty(t,n)},r.prototype.getProperty=function(e,t){var n=this._getItem(e);return this._readProperty(n,t)},r.prototype._writeProperty=function(t,n,r){e.util.setProperty(t,n,r)},r.prototype.setProperty=function(e,t,n){var r=this._getItem(e);return r===this.currentEditItem()&&this._currentEditItemSnapshot&&!(t in this._currentEditItemSnapshot)&&(this._currentEditItemSnapshot[t]=this.getProperty(e,t)),this._writeProperty(r,t,n),this},r.prototype.subscribe=function(e,t){return this._changed.subscribe(e,t)},r.prototype.trigger=function(){this._currencyManager.update(),this._changed.trigger(this.local),this._koArray&&this._koArray.notifySubscribers(this.local)},r.prototype.canFilter=function(){return!0},r.prototype.canSort=function(){return!0},r.prototype._updateShape=function(e){this._updatingShape=!0;try{this._shape.update(e)}finally{this._updatingShape=!1}},r.prototype.prevPage=function(){return this.pageIndex()<1?!1:(this.pageIndex(this.pageIndex()-1),!0)},r.prototype.nextPage=function(){return this.pageCount()>0&&this.pageIndex()+1>=this.pageCount()?!1:(this.pageIndex(this.pageIndex()+1),!0)},r.prototype._createShape=function(e){return new n(e)},r.prototype._initShape=function(e){var t=this,n=function(e){typeof e=="undefined"&&(e=!1),t._updatingShape||t.refresh(null,e&&t.localPaging)};this._shape=this._createShape(n),e&&this._updateShape(e),this.filter=this._shape.filter,this.sort=this._shape.sort,this.pageIndex=this._shape.pageIndex,this.pageSize=this._shape.pageSize,this.pageCount=this._pageCount.read(),this.totalItemCount=this._totalItemCount.read()},r.prototype._localRefresh=function(n){typeof n=="undefined"&&(n=this.localPaging);var r=this._shape.apply(this.sourceArray,n,this.local);return n&&this._totalItemCount(r.totalCount),this._pageCount(e.util.pageCount(this.totalItemCount(),this.pageSize())),this.trigger(),t.Deferred().resolve().promise()},r.prototype._remoteRefresh=function(){return this._localRefresh()},r.prototype.refresh=function(e,t){typeof t=="undefined"&&(t=!1);var n=this;this.cancelRefresh(),e&&this._updateShape(e),this._isLoading(!0);var r=t?this._localRefresh():this._remoteRefresh();return r.then(function(){n._isLoaded(!0),n._isLoading(!1)})},r.prototype.cancelRefresh=function(){},r.prototype._initCurrency=function(){this._currencyManager=new e.CurrencyManager(this.local),this.currentItem=this._currencyManager.currentItem,this.currentPosition=this._currencyManager.currentPosition},r.prototype.isCurrentEditItemNew=function(){return this._isCurrentEditItemNew},r.prototype._beginEdit=function(e,t){this.commitEdit(),this._currentEditItemSnapshot={},this._isCurrentEditItemNew=t,this._currentEditItem(e)},r.prototype.canAdd=function(){return!0},r.prototype.add=function(t){t||e.errors.argument("item"),this.commitEdit(),this.local.push(t),this._beginEdit(t,!0),this.trigger()},r.prototype.canAddNew=function(){return!1},r.prototype.addNew=function(){return e.errors.unsupportedOperation()},r.prototype.editItem=function(e){typeof e=="undefined"&&(e=this.currentItem()),this.commitEdit(),e=this._getItem(e),e&&this._beginEdit(e,!1)},r.prototype.canRemove=function(){return!0},r.prototype._remove=function(t){this.local.splice(t.index,1),e.util.remove(this.sourceArray,t.item),this.trigger()},r.prototype.remove=function(e){typeof e=="undefined"&&(e=this.currentItem()),this.commitEdit();var t=this._resolve(e);return t?(this._remove(t),!0):!1},r.prototype.canCancelEdit=function(){return!0},r.prototype.cancelEdit=function(){var n=this,r;if(!this.currentEditItem())return;var i=this.currentEditItem();this._currentEditItem(null),this._isCurrentEditItemNew?e.util.remove(this.local,this.item):this._currentEditItemSnapshot&&t.each(this._currentEditItemSnapshot,function(e,t){return n._writeProperty(i,e,t)}),this.trigger()},r.prototype.canCommitEdit=function(){return!0},r.prototype.commitEdit=function(){if(!this.currentEditItem())return;var t=this.currentEditItem();this._currentEditItem(null),this._isCurrentEditItemNew&&this.sourceArray.push(t);var n=this._shape._compiledFilter;!n.isEmpty&&!n.func(t)&&e.util.remove(this.local,t),this.trigger()},r.prototype._getItem=function(t){var n;return e.util.isNumeric(t)?this.item(t):t},r.prototype._resolve=function(t,n){typeof n=="undefined"&&(n=!1);var r;return e.util.isNumeric(t)?{index:t,item:this.item(t)}:(r=this.indexOf(t),r<0?(n&&e.errors.itemNotInView(t),null):{index:r,item:t})},r}();e.ArrayDataViewBase=r;var i=function(e){function t(t,n){e.call(this,n),this.sourceArray=t,this.refresh()}return __extends(t,e),t}(r);e.ArrayDataView=i})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));var wijmo;(function(e){(function(e){var t=jQuery,n=function(e){function n(t){e.call(this),this.isRemote=!0,this.sourceArray=[],t&&this._construct(t)}return __extends(n,e),n.prototype._construct=function(e){this.options=e=t.extend({localPaging:!1},e),this.localPaging=e.localPaging,this._updateShape(e)},n}(e.ArrayDataViewBase);e.RemoteDataView=n})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));;
var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(e){(function(e){var t=jQuery,n=function(){function e(e){this._originalReader=e}return e.prototype.read=function(e){e.items=null,this._originalReader&&t.isFunction(this._originalReader.read)&&this._originalReader.read(e),t.isArray(e.items)||(t.isArray(e.data)?e.items=e.data:e.data&&t.isArray(e.data.rows)?e.items=e.data.rows:e.items=[]);if(e.dynamic)if(!e.data||isNaN(e.data.totalRows))throw"totalRows value is missing"},e}(),r=function(r){function i(e){var i=this;r.call(this),this.dataSource=e,this.isRemote=!0,this.localPaging=!0,this._origLoaded=e.loaded,this._origReader=e.reader,e.loaded=function(e,n){i._loaded(),t.isFunction(i._origLoaded)&&i._origLoaded.apply(i,arguments)},e.reader=new n(e.reader);var s=e.items&&e.items.length>0;t.isArray(e.data)&&!s&&e.read(),e.items&&this._loaded()}return __extends(i,r),i.prototype.dispose=function(){this.dataSource.loaded=this._origLoaded,this.dataSource.reader=this._origReader,r.prototype.dispose.call(this)},i.prototype.getProperties=function(){return this.sourceArray&&this.sourceArray.length?e.ArrayDataViewBase._getProps(this.sourceArray[0]):[]},i.prototype._loaded=function(){this.sourceArray=this.dataSource.items,this.dataSource.data&&e.util.isNumeric(this.dataSource.data.totalRows)&&this._totalItemCount(this.dataSource.data.totalRows);var t=r.prototype._localRefresh.call(this,!this.dataSource.dynamic);this._currentDeferred&&t.then(this._currentDeferred.resolve)},i.prototype._remoteRefresh=function(){this._currentDeferred&&this._currentDeferred.state()==="pending"&&this._currentDeferred.fail(),this._currentDeferred=t.Deferred();var e={},n=!1;return this.dataSource.dynamic&&(n=!0,e.data=this._prepareRequest(),this.dataSource.proxy&&(this._origDataOption||(this._origDataOption=t.extend({},this.dataSource.proxy.options.data)),this.dataSource.proxy.options.data=t.extend({},this._origDataOption,e.data))),this.dataSource.load(e,n),this._currentDeferred},i.prototype._prepareRequest=function(){return{filtering:this._prepareFilterRequest(),paging:this._preparePageRequest(),sorting:this._prepareSortRequest()}},i.prototype._prepareFilterRequest=function(){var e=[];return!this._shape._compiledFilter.isEmpty&&this._shape._compiledFilter.normalized&&t.each(this._shape._compiledFilter.normalized,function(t,n){e.push({dataKey:t,filterOperator:n.op.Name,filterValue:n.value})}),e},i.prototype._preparePageRequest=function(){return{pageIndex:this._shape.pageIndex(),pageSize:this._shape.pageSize()}},i.prototype._prepareSortRequest=function(){return this._shape._compiledSort.isEmpty||!this._shape._compiledSort.normalized||this._shape._compiledSort.normalized.length==0?[]:t.map(this._shape._compiledSort.normalized,function(e){return{dataKey:e.property,sortDirection:e.asc?"ascending":"descending"}})},i}(e.ArrayDataViewBase);e.registerDataViewFactory(function(e){if(typeof wijdatasource=="function"&&e instanceof wijdatasource)return new r(e);return})})(e.data||(e.data={}));var t=e.data})(wijmo||(wijmo={}));;
var wijmo;(function(e){(function(e){"use strict";var t=jQuery,n,r,i;n=function(e){var t=this;t.data={},t.reader=null,t.proxy=null,t.items=[],t.loading=null,t.loaded=null,t._constructor(e)},window.wijdatasource=n,t.extend(n.prototype,{_constructor:function(e){t.extend(this,e)},load:function(e,n){var r=this,i=r.proxy;if(t.isFunction(r.loading)&&r.loading(r,e)===!1)return;i?i.request(r,r.loaded,e):((r.items.length===0||n)&&this.read(),t.isFunction(r.loaded)&&r.loaded(r,e))},read:function(){var e=this,t=e.data;t&&e.reader?e.reader.read(e):e.items=e.data}}),r=function(e){t.isFunction(window.wijmoASPNetParseOptions)&&wijmoASPNetParseOptions(e),t.isArray(e)&&(this.fields=e)},window.wijarrayreader=r,t.extend(r.prototype,{read:function(e){t.isArray(e.data)?e.items=this._map(e.data):e.items=[]},_map:function(e){var n=this,r=[];return n.fields===undefined||n.fields.length===0?(t.extend(!0,r,e),r):(t.each(e,function(e,i){var s={};t.each(n.fields,function(e,n){n.mapping&&typeof n.mapping&&window[n.mapping]&&(n.mapping=window[n.mapping]);if(t.isFunction(n.mapping))return s[n.name]=n.mapping(i),!0;var r=n.mapping!==undefined?n.mapping:n.name,o=i[r];o===undefined&&(n.defaultValue!==undefined?o=n.defaultValue:o=i),s[n.name]=o}),r.push(s)}),r)}}),i=function(e){this.options=e,t.isFunction(window.wijmoASPNetParseOptions)&&wijmoASPNetParseOptions(e)},window.wijhttpproxy=i,t.extend(i.prototype,{request:function(e,n,r){var i=this,s,o;s=t.extend({},this.options),o=s.success,s.success=function(u){t.isFunction(o)&&o(u),i._complete(u,e,n,s,r)},t.ajax(s)},_complete:function(e,n,r,i,s){n.data=i.key!==undefined?e[i.key]:e,n.read(),t.isFunction(r)&&r(n,s)}})})(e.checkbox||(e.checkbox={}));var t=e.checkbox})(wijmo||(wijmo={}));;
var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(wijmo){(function(input){"use strict";var $=jQuery,jqKeyCode=wijmo.getKeyCodeEnum(),wijinputcore=function(e){function t(){e.apply(this,arguments),this._boundMouseWheel=!1,this._wasPopupShowing=!1,this._blockNextTriggerClickedEvent=!1}return __extends(t,e),t.prototype._elemWithClasses=function(e,t){return typeof t=="undefined"&&(t=[]),$(e).addClass(t.join(" "))},t.prototype._divWithClasses=function(){var e=[];for(var t=0;t ",e)},t.prototype._spanWithClasses=function(){var e=[];for(var t=0;t ",e)},t.prototype._horizontalBorderWidth=function(e){return e.leftBorderWidth()+e.rightBorderWidth()},t.prototype._verticalBorderWidth=function(e){return e.topBorderWidth()+e.bottomBorderWidth()},t.prototype._create=function(){var e=this;try{var t=document.activeElement==this.element[0]}catch(n){}var r=this._horizontalBorderWidth(this.element),i=this._verticalBorderWidth(this.element);if(this.element[0].tagName.toLowerCase()!=="input"&&this.element[0].tagName.toLowerCase()!=="textarea")throw"Target element is not a INPUT";this._creationDate=new Date,window.wijmoApplyWijTouchUtilEvents&&($=window.wijmoApplyWijTouchUtilEvents($)),this.element.is(":hidden")&&this.element.wijAddVisibilityObserver&&this.element.wijAddVisibilityObserver(function(){e._destroy(),e._create(),e.element.wijRemoveVisibilityObserver&&e.element.wijRemoveVisibilityObserver()},"wijinput"),this.element.data("widgetName",this.widgetName),$.effects&&$.effects.save?$.effects.save(this.element,["width","height"]):$.save&&$.save(this.element,["width","height"]);var s=this.options.wijCSS;this.element.wrap("
0,!1)&&t.preventDefault()}),this._boundMouseWheel=!0)},t.prototype._isPopupShowing=function(){return!!this._comboDiv&&this._comboDiv.wijpopup("isVisible")},t.prototype._onTriggerMouseDown=function(e){this._wasPopupShowing&&(this._blockNextTriggerClickedEvent=!0)},t.prototype._onTriggerMouseUp=function(e){},t.prototype._onTriggerClicked=function(){if(this._blockNextTriggerClickedEvent){this._blockNextTriggerClickedEvent=!1;return}this._popupVisible()?this._hidePopup():this._showPopup()},t.prototype._showPopup=function(){return this._popupComboList()},t.prototype._hidePopup=function(){this._comboDiv.wijpopup("hide")},t.prototype._initialize=function(){var e=this;this.element.data("initializing",!0),this._trigger("initializing"),this.element.data("preText",this.element.val()),this.element.data("elementValue",this.element.val()),this.element.data("errorstate",!1),this.element.data("breakSpinner",!0),this.element.data("prevCursorPos",-1),this.element.data("simulating",!1),this._createTextProvider(),this._beginUpdate();var t=this.options,n=function(e){return(e.which?e.which:e.button)===1},r=function(t){if(e.options.disabled)return;if(!n(t))return;if(e.options.disableUserInput)return;e._trySetFocus(),Utility.IsFireFox4OrLater()&&e._stopEvent(t),e.element.data("breakSpinner",!1),e._addState("active",$(e)),e._doSpin($(t.currentTarget).attr("role")=="upbutton",!0)},i=function(t){if(e.options.disabled)return;if(!n(t))return;if(e.options.disableUserInput)return;e._stopSpin(),e._removeState("active",$(e))};this.triggerBtn&&!t.disabledState&&this.triggerBtn.bind({mouseover:function(){if(e.options.disabled)return;e._addState("hover",$(e))},mouseout:function(){if(e.options.disabled)return;e._removeState("hover",$(e))},mousedown:function(t){if(e.options.disabled)return;if(!n(t))return;e._stopEvent(t),e._addState("active",$(e)),e._trigger("triggerMouseDown"),e._trigger("dropDownButtonMouseDown"),e._onTriggerMouseDown(t)},mouseup:function(t){e._onTriggerMouseUp(t)},click:function(t){if(e.options.disabled)return;e._stopEvent(t),e._stopSpin(),e._removeState("active",$(e)),e._trigger("triggerMouseUp"),e._trigger("dropDownButtonMouseUp"),e._onTriggerClicked(),e._trySetFocus()}}),this.spinUpElement&&!t.disabledState&&this.spinUpElement.bind({mouseover:function(){if(e.options.disabled)return;e._addState("hover",$(e))},mouseout:function(){if(e.options.disabled)return;e._removeState("hover",$(e)),e._removeState("active",$(e)),e._stopSpin()},mousedown:r,mouseup:i}),this.spinDownElement&&!t.disabledState&&this.spinDownElement.bind({mouseover:function(){if(e.options.disabled)return;e._addState("hover",$(e))},mouseout:function(){if(e.options.disabled)return;e._removeState("hover",$(e)),e._removeState("active",$(e)),e._stopSpin()},mousedown:r,mouseup:i}),this._attachInputEvent(),this.element.data("initializing",!1),this._resetData(),this._endUpdate(),this._updateText();if(this.options.disabledState){var s=t.disabled;this.disable(),t.disabled=s}this.options.disabled&&this.disable(),this.options.imeMode&&this.element.css("ime-mode",this.options.imeMode),this.element.data("initialized",!0),this._trigger("initialized")},t.prototype._attachInputEvent=function(){this.element.bind({"focus.wijinput":$.proxy(this._onFocus,this),"beforedeactivate.wijinput":$.proxy(this._onBeforeDeactivate,this),"blur.wijinput":$.proxy(this._onBlur,this),"mousedown.wijinput":$.proxy(this._onMouseDown,this),"mouseup.wijinput":$.proxy(this._onMouseUp,this),"keypress.wijinput":$.proxy(this._onKeyPress,this),"keydown.wijinput":$.proxy(this._onKeyDown,this),"keyup.wijinput":$.proxy(this._onKeyUp,this),"compositionstart.wijinput":$.proxy(this._onCompositionStart,this),"compositionend.wijinput":$.proxy(this._onCompositionEnd,this),"change.wijinput":$.proxy(this._onChange,this),"paste.wijinput":$.proxy(this._onPaste,this),"drop.wijinput":$.proxy(this._onDrop,this)}),this.element.bind("propertychange.wijinput input.wijinput",$.proxy(this._onInput,this))},t.prototype._detachInputEvent=function(){this.element.unbind(".wijinput")},t.prototype._init=function(){this.element.attr("readOnly")&&(this.options.readonly=!0),this.options.readonly===!0&&(this.options.disableUserInput=!0),(this.options.readonly===!0||this.options.disableUserInput===!0)&&this.element.attr("readOnly",!0),this.options.placeholder!=null&&(this.options.nullText=this.options.placeholder),this.options.showTrigger!=undefined&&this._setOption("showDropDownButton",this.options.showTrigger)},t.prototype._showNullText=function(){return!!this.options.nullText||this.options.nullText===""},t.prototype._setOption=function(e,t){switch(e){case"readonly":this._super(e,t),e="disableUserInput";break;case"placeholder":this._super(e,t),e="nullText";break;case"showTrigger":this.options.showDropDownButton=t}this._super(e,t);switch(e){case"spinnerAlign":case"dropDownButtonAlign":case"showDropDownButton":case"buttonAlign":case"showTrigger":case"showSpinner":this._destroy(),this._create();break;case"showNullText":case"nullText":this._updateText();break;case"imeMode":this.element.css("ime-mode",this.options.imeMode);break;case"disabled":this.element.attr("disabled",t);var n=t?"addClass":"removeClass",r=this.options.wijCSS.stateDisabled;this.element[n](r),this.triggerBtn&&this.triggerBtn[n](r),this.spinUpElement&&this.spinUpElement[n](r),this.spinDownElement&&this.spinDownElement[n](r);break;case"disableUserInput":this.element.attr("readOnly",t)}},t.prototype.destroy=function(){this._super(),this._comboDiv&&this._comboDiv.remove(),this._destroy()},t.prototype.drop=function(){this._onTriggerClicked()},t.prototype.isDestroyed=function(){return!this.outerDiv},t.prototype._destroy=function(){if(this.isDestroyed())return;this.wrapper=undefined,this.outerDiv=undefined,this._detachInputEvent(),this.element.removeData("errorstate").removeData("breakSpinner").removeData("prevCursorPos").removeData("simulating").removeData("isPassword").removeClass(this.options.wijCSS.wijinputInput).removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeAttr("aria-expanded"),this.element.parent().replaceWith(this.element),this.element.parent().replaceWith(this.element),$.effects&&$.effects.restore?$.effects.restore(this.element,["width","height"]):$.restore&&$.restore(this.element,["width","height"])},t.prototype.widget=function(){return this.outerDiv||this._super()},t.prototype._getCulture=function(e){return typeof e=="undefined"&&(e=this.options.culture),Globalize.findClosestCulture(e||this.options.culture)},t.prototype._addState=function(e,t){t.is(":not(.ui-state-disabled)")&&t.addClass(this.options.wijCSS.getState(e))},t.prototype._removeState=function(e,t){t.removeClass(this.options.wijCSS.getState(e))},t.prototype._isInitialized=function(){return!this.element.data("initializing")},t.prototype._setData=function(e){this.setText(e)},t.prototype._resetData=function(){},t.prototype._validateData=function(){},t.prototype.getText=function(){return this._isInitialized()?this._textProvider.toString(!0,!1,!1):this.element.val()},t.prototype.setText=function(e){this._isInitialized()?(this._textProvider.setText(e),this._updateText()):this.element.val(e)},t.prototype.getPostValue=function(){return this._isInitialized()?this._textProvider.toString(!0,!1,!0):this.element.val()},t.prototype.selectText=function(e,t){typeof e=="undefined"&&(e=0),typeof t=="undefined"&&(t=this.getText().length),isNaN(e)&&(e=0),isNaN(t)&&(t=0),Utility.IsFireFox4OrLater()&&this.focus();if(this.element.is(":disabled"))return;this.element.wijtextselection(e,t)},t.prototype.focus=function(){if(this.element.is(":disabled"))return;this.element.get(0).focus()},t.prototype.isFocused=function(){return this.outerDiv?this.outerDiv.hasClass(this.options.wijCSS.stateFocus):!1},t.prototype._raiseTextChanged=function(){var e=this.element.val(),t=this.element.data("preText");!!this.element.data("initialized")&&t!==e&&(this._trigger("textChanged",null,{text:e}),this.element.data("changed",!0)),this.element.data("preText",e)},t.prototype._raiseDataChanged=function(){},t.prototype._allowEdit=function(){return!this.element.is(":disabled")},t.prototype._updateText=function(e){typeof e=="undefined"&&(e=!1);if(!this._isInitialized())return;e=!!e;var t;this.element.data("selectionbeforeblur")!==undefined?(t=this.element.data("selectionbeforeblur"),this.element.removeData("selectionbeforeblur")):t=this.element.wijtextselection();var n=this.options;this.isDeleteAll&&this._showNullText()?(this.isDeleteAll=!1,n.date=null,this.element.val(n.nullText)):(this.element.val(this._textProvider.toString()),this.options.text=this._textProvider.toString(!0,!1,!1));if(this.element.is(":disabled"))return;e&&this.selectText(t.start,t.end),this.element.data("prevCursorPos",t.start),this._raiseTextChanged(),this._raiseDataChanged()},t.prototype._trySetFocus=function(){if(document.activeElement!==this.element[0])try{this.options.disableUserInput||this.element.focus()}catch(e){}},t.prototype._deleteSelText=function(e){typeof e=="undefined"&&(e=!1);if(!this._allowEdit())return;var t=this.element.wijtextselection();if(e){if(t.end<1)return;t.end===t.start&&t.start--}t.end--,t.end=i&&(n=this.element.val().substring(i,s))}n&&window.setTimeout(function(){if(t._isLastValueNull())return;t.element.val(t.element.data("lastValue"));var e=t.element.data("lastSelection");t.element.wijtextselection(e),t.element.data("batchKeyPress",!0),t.element.data("simulating",!1);var r=jQuery.Event("keypress");r.ctrlKey=r.altKey=!1;for(var i=0;i0&&(t.element.data("appendChar",""),r.which=r.charCode=r.keyCode=s.charCodeAt(i),t._onKeyPress(r)),t.element.data("skipNextChar")&&(i++,t.element.data("skipNextChar",!1))}t.element.data("batchKeyPress",!1),t._endSimulate()},1)},t.prototype._isLastValueNull=function(){return!this.element.data("lastValue")},t.prototype._endSimulate=function(){this._simulateIfPending(),this.element.removeData("ime"),this.element.removeData("lastSelection"),this.element.removeData("lastValue")},t.prototype._processKeyForDropDownList=function(e){var t=this._getKeyCode(e);if(!(!e.altKey||t!==jqKeyCode.UP&&t!==jqKeyCode.DOWN))return this._onTriggerClicked(),this._stopEvent(e),!0;if(t===jqKeyCode.ESCAPE&&this._wasPopupShowing)return this._hidePopup(),this._stopEvent(e),!0;if(this._wasPopupShowing&&this._comboDiv!==undefined){if(t===jqKeyCode.DOWN){try{this._comboDiv.wijlist("next")}catch(n){}return this._stopEvent(e),!0}if(t===jqKeyCode.UP){try{this._comboDiv.wijlist("previous")}catch(n){}return this._stopEvent(e),!0}if(t===jqKeyCode.ENTER)return this._comboDiv.wijlist("select"),this._stopEvent(e),!0;if(t===jqKeyCode.PAGE_DOWN){try{this._comboDiv.wijlist("nextPage")}catch(n){}return this._stopEvent(e),!0}if(t===jqKeyCode.PAGE_UP){try{this._comboDiv.wijlist("previousPage")}catch(n){}return this._stopEvent(e),!0}}},t.prototype._processKeyOnNoMask=function(e){var t=this._getKeyCode(e);t===jqKeyCode.Enter&&this._onEnterDown(e);if(t===jqKeyCode.LEFT||t===jqKeyCode.RIGHT)if(this._processLeftRightKey(t===jqKeyCode.LEFT)){this._stopEvent(e);return}this._processKeyForDropDownList(e)},t.prototype._onKeyDown=function(e){this.element.data("prevCursorPos",-1),this._deleteKeyDown=!1;if(!this._isInitialized())return;if(this._textProvider&&!!this._textProvider.noMask){this._processKeyOnNoMask(e);return}var t=this._getKeyCode(e);if(t===229){this._onDoubleByteCharacter();return}this._onCompositionEnd();if(this.options.disableUserInput){t===jqKeyCode.TAB?this._processTabKey(e)&&this._stopEvent(e):this._stopEvent(e);return}if(this._keyDownPreview(e)){this._stopEvent(e);return}if(this._processKeyForDropDownList(e))return;switch(t){case jqKeyCode.UP:this._doSpin(!0,!1),this._stopEvent(e);return;case jqKeyCode.DOWN:this._doSpin(!1,!1),this._stopEvent(e);return;case jqKeyCode.LEFT:case jqKeyCode.RIGHT:this._processLeftRightKey(t===jqKeyCode.LEFT)&&this._stopEvent(e);return;case jqKeyCode.TAB:this._processTabKey(e)&&this._stopEvent(e);return}if(e.ctrlKey)switch(t){case jqKeyCode.INSERT:case 67:return;default:}if(e.ctrlKey||e.altKey)return;switch(t){case 112:case 113:case 114:case 115:case 116:case 117:case jqKeyCode.TAB:case jqKeyCode.CAPSLOCK:case jqKeyCode.END:case jqKeyCode.HOME:case jqKeyCode.CTRL:case jqKeyCode.SHIFT:return;case jqKeyCode.BACKSPACE:this._deleteSelText(!0),this._stopEvent(e);return;case jqKeyCode.DELETE:this._deleteSelText(!1),this._stopEvent(e),this._deleteKeyDown=!0;return;case jqKeyCode.ENTER:this._onEnterDown(e);break;case jqKeyCode.ESCAPE:this._stopEvent(e),window.setTimeout($.proxy(this._resetData,this),1);return;case jqKeyCode.PAGE_UP:case jqKeyCode.PAGE_DOWN:case jqKeyCode.ALT:this._stopEvent(e);return}},t.prototype._onEnterDown=function(e){this.options.hideEnter&&this._stopEvent(e)},t.prototype._onKeyUp=function(e){if(this._textProvider&&!!this._textProvider.noMask)return;var t=this._getKeyCode(e);if(this._isSimulating()){t===jqKeyCode.ENTER&&this._onCompositionEnd();return}if(!this._isInitialized())return;if(t===jqKeyCode.ENTER||t===jqKeyCode.ESCAPE)return;if(this.options.disableUserInput){this._raiseTextChanged(),this._raiseDataChanged();return}this._stopEvent(e)},t.prototype._getKeyCode=function(e){var t=window.navigator.userAgent;return t.indexOf("iPod")===-1&&t.indexOf("iPhone")===-1||e.which!==127?e.keyCode||e.which:8},t.prototype._keyPressPreview=function(e){return!1},t.prototype._onKeyPress=function(e){if(this._isSimulating()||this._textProvider&&!!this._textProvider.noMask)return;this.element.data("prevCursorPos",-1);if(this.options.disableUserInput)return;if(!this._allowEdit())return;if(e.ctrlKey&&e.keyCode===119){this._onPaste(e);return}var t=e.keyCode||e.which;if(Utility.IsFireFox4OrLater())switch(e.keyCode){case jqKeyCode.UP:case jqKeyCode.DOWN:case jqKeyCode.LEFT:case jqKeyCode.RIGHT:case jqKeyCode.HOME:case jqKeyCode.END:return}switch(t){case 0:case jqKeyCode.TAB:return;case jqKeyCode.BACKSPACE:this._stopEvent(e);return;case jqKeyCode.DELETE:if(this._deleteKeyDown){this._stopEvent(e);return}break;case jqKeyCode.ENTER:this.options.hideEnter&&this._stopEvent(e);return}if(e.ctrlKey||e.altKey)if(t!==jqKeyCode.SPACE)return;if(this._keyPressPreview(e))return;var n=String.fromCharCode(t),r=this._textProvider.replaceWith(this.element.wijtextselection(),n);r?(this._updateText(),this.selectText(r.testPosition+1,r.testPosition+1),this.element.data("prevCursorPos",r.testPosition+1)):this._fireIvalidInputEvent(n),this.element.data("batchKeyPress")||this._stopEvent(e)},t.prototype._isNullText=function(e){return e=e||this.element.val(),this._showNullText()&&e===this.options.nullText},t.prototype._doFocus=function(){var e=this.element.wijtextselection(),t=e.start;this._updateText();var n=this.element.val();n.length===t&&(t=0),$.browser.safari||this.selectText(t,t)},t.prototype._afterFocused=function(){this._isNullText()&&this._doFocus()},t.prototype._onFocus=function(e){if(this.options.disableUserInput)return;this._addState("focus",this.outerDiv);if(!this.element.data("breakSpinner"))return;if(!this._isInitialized())return;if(!this._allowEdit())return;this.element.data("focusNotCalledFirstTime")||this.element.data("focusNotCalledFirstTime",(new Date).getTime()),this._afterFocused()},t.prototype._onBeforeDeactivate=function(e){if(this.options.disableUserInput)return;if(!this.element.data("breakSpinner"))return;if(!this._isInitialized())return;if(!this._allowEdit())return;this.element.data("selectionbeforeblur",this.element.wijtextselection())},t.prototype._onBlur=function(e){if(this.options.disableUserInput)return;this._onCompositionEnd();if(this._isComboListVisible())return;var t=this.isFocused();this._removeState("focus",this.outerDiv);if(!this.element.data("breakSpinner")){this.element.get(0).focus();var n=this.element.data("prevCursorPos");n!==undefined&&n!==-1&&this.selectText(n,n);return}if(!this._isInitialized()||!t)return;this.element.data("value",this.element.val()),this._updateTextOnLostFocus()},t.prototype._updateTextOnLostFocus=function(){var e=this;window.setTimeout(function(){e._onChange(),e._updateText(),e._validateData(),e.element.data("changed")&&(e.element.data("changed",!1),e._popupVisible()||(e._trigger("change"),e.element.change()))},100)},t.prototype._popupVisible=function(){return this._wasPopupShowing},t.prototype._onMouseDown=function(e){if(!this._isInitialized())return;if(this.element.is(":disabled"))return;if(Utility.IsMouseDownOnClearButton(e)){var t=!1;try{t=document.activeElement===e.target}catch(n){}this.element.data("focusedWhenMouseDown",t),this.element.data("mouseDownOnClearButton",!0);return}},t.prototype._onMouseUp=function(e){if(!this._isInitialized())return;if(this.element.is(":disabled"))return;if(Utility.IsMouseDownOnClearButton(e)&&this.element.data("mouseDownOnClearButton")&&this.element.data("focusedWhenMouseDown")===!0){if(!this.options.disableUserInput){var t=this;setTimeout(function(){t._processClearButton()},0)}this.element.data("mouseDownOnClearButton",!1);return}this.element.data("mouseDownOnClearButton",!1),this.element.data("focusedWhenMouseDown",!1);var n=this.element.wijtextselection();this.element.data("prevCursorPos",n.start);if(this.element.val()=="")return;var t=this;setTimeout(function(){t.element.val()==""&&t.setText("")},5)},t.prototype._onChange=function(){if(!this.element)return;var e=this.element.val(),t=this.getText();t!==e&&this.setText(e)},t.prototype._onPaste=function(e){if(this._textProvider&&!!this._textProvider.noMask)return;this._beforeSimulate();var t=this;window.setTimeout(function(){t._simulate()},1)},t.prototype._onDrop=function(e){this._beforeSimulate();if(e.originalEvent&&e.originalEvent.dataTransfer){var t=e.originalEvent.dataTransfer.getData("Text");t&&this._simulate(t)}},t.prototype._stopEvent=function(e){e.stopPropagation(),e.preventDefault()},t.prototype._calcSpinInterval=function(){return this._repeatingCount++,this._repeatingCount>10?50:this._repeatingCount>4?100:this._repeatingCount>2?200:400},t.prototype._doSpin=function(e,t){return!1},t.prototype._stopSpin=function(){this.element.data("breakSpinner",!0),this._repeatingCount=0;var e=this.element.data("spintimer");e&&(clearTimeout(e),this.element.data("spintimer",undefined))},t.prototype._hasComboItems=function(){return!!this._getcomboItems()&&this._getcomboItems().length},t.prototype._getcomboItems=function(){return!!this.options.comboItems&&this.options.comboItems.length>0?this.options.comboItems:this.options.pickers.list},t.prototype._getcomboWidth=function(){return this.options.comboWidth||this.options.pickers.width},t.prototype._getcomboHeight=function(){return this.options.comboHeight||this.options.pickers.height},t.prototype._isComboListVisible=function(){return this._comboDiv?this._comboDiv.wijpopup("isVisible"):!1},t.prototype._createComboDiv=function(){var e=this;if(this._comboDiv===undefined){this._comboDiv=$("
").appendTo(document.body).css("position","absolute");var t=this._normalize(this._getcomboItems());this._comboDiv.wijlist({maxItemsCount:5,selected:function(t,n){e.options.disableUserInput||e._setData(n.item.value),e._comboDiv.wijpopup("hide"),e._trySetFocus()}}),this._comboDiv.wijlist("setItems",t),this._comboDiv.wijlist("renderList")}},t.prototype._popupComboList=function(){var e=this;return this._hasComboItems()?this._allowEdit()?(this._createComboDiv(),this._comboDiv.width(this.outerDiv.width()),this._comboDiv.wijlist("option","autoSize",!this._getcomboHeight()),this._getcomboHeight()&&this._comboDiv.height(this._getcomboHeight()),this._getcomboWidth()&&parseInt(this._getcomboWidth())!==this._comboDiv.width()&&(this._comboDiv.wijlist("destroy"),this._comboDiv.remove(),delete this._comboDiv,this._createComboDiv(),this._comboDiv.width(this._getcomboWidth()),this._comboDiv.wijlist("option","autoSize",!this._getcomboHeight()),this._getcomboHeight()&&this._comboDiv.height(this._getcomboHeight())),this._comboDiv.wijlist("refreshSuperPanel"),this._comboDiv.wijpopup({autoHide:!0,hidden:function(){e._trigger("dropDownClose"),e._wasPopupShowing=!1,e._comboDiv.wijlist("unselectItems"),e._comboDiv.wijlist("deactivate")},shown:function(){e._trigger("dropDownOpen"),e._wasPopupShowing=!0}}),this.outerDiv.attr("aria-expanded",!0),this._comboDiv.wijpopup("show",{of:this.outerDiv,offset:"0 4",hidden:function(){e.outerDiv.attr("aria-expanded",!1)}}),!0):!1:!1},t.prototype._normalize=function(e){return e.length&&e[0].label&&e[0].value?e:$.map(e,function(e){return typeof e=="string"?{label:e,value:e}:$.extend({label:e.label||e.value,value:e.value||e.label},e)})},t.prototype._processLeftRightKey=function(e){return!1},t.prototype._processTabKey=function(e){return!1},t.prototype._moveControl=function(e,t,n){var r=Utility.GetElements(),i=null,s={};if(r.length<2)return null;var o=Utility.GetNextFocusableControl(e,r,t);setTimeout(function(){Utility.SetElementFocus(o)},0)},t.prototype._processClearButton=function(){},t}(wijmo.wijmoWidget);input.wijinputcore=wijinputcore;var wijinputClass="wijmo-wijinput",classPrefix=wijinputClass+"-",wijinputcore_options=function(){function e(){this.wijCSS={wijinput:wijinputClass,wijinputInput:classPrefix+"input",wijinputWrapper:classPrefix+"wrapper",wijinputWrapperSpinnerLeft:classPrefix+"wrapper-spinner-left",wijinputWrapperSpinnerRight:classPrefix+"wrapper-spinner-right",wijinputTrigger:classPrefix+"trigger",wijinputSpinnerLeft:classPrefix+"spinner-left",wijinputSpinnerRight:classPrefix+"spinner-right",wijinputButton:classPrefix+"button",wijinputSpin:classPrefix+"spin",wijinputSpinUp:classPrefix+"spinup",wijinputSpinDown:classPrefix+"spindown",iconPlus:"ui-icon-plus",iconMinus:"ui-icon-minus"},this.imeMode="",this.culture="",this.invalidClass=$.wijmo.wijCSS.stateError,this.nullText=undefined,this.placeholder=undefined,this.showNullText=!1,this.hideEnter=!1,this.disableUserInput=!1,this.readonly=!1,this.buttonAlign=null,this.dropDownButtonAlign="right",this.showDropDownButton=!1,this.showTrigger=undefined,this.showSpinner=!1,this.comboItems=undefined,this.comboWidth=undefined,this.comboHeight=undefined,this.blurOnLeftRightKey="none",this.spinnerAlign="verticalRight",this.allowSpinLoop=!1,this.pickers={list:undefined,width:undefined,height:undefined},this.dropDownOpen=null,this.dropDownClose=null,this.initializing=null,this.initialized=null,this.triggerMouseDown=null,this.triggerMouseUp=null,this.dropDownButtonMouseDown=null,this.dropDownButtonMouseUp=null,this.textChanged=null,this.invalidInput=null}return e}();wijinputcore.prototype.options=$.extend(!0,{},wijmo.wijmoWidget.prototype.options,new wijinputcore_options);var wijInputResult=function(){function e(){this.characterEscaped=1,this.noEffect=2,this.sideEffect=3,this.success=4,this.unknown=0,this.hint=0,this.alphanumericCharacterExpected=-2,this.asciiCharacterExpected=-1,this.digitExpected=-3,this.invalidInput=-51,this.letterExpected=-4,this.nonEditPosition=-54,this.positionOutOfRange=-55,this.promptCharNotAllowed=-52,this.signedDigitExpected=-5,this.unavailableEditPosition=-53,this.testPosition=-1,this.binaryExpected=-6}return e.prototype.clone=function(){var t=new e;return t.hint=this.hint,t.testPosition=this.testPosition,t},e}();input.wijInputResult=wijInputResult;var wijTextProvider=function(){function e(){}return e.prototype.setText=function(e,t){},e.prototype.toString=function(e,t,n,r,i){return""},e.prototype.insertAt=function(e,t,n){return!1},e.prototype.removeAt=function(e,t,n,r){},e.prototype.replaceWith=function(e,t){var n=e.start,r=new wijInputResult;return e.startn&&(n=i),n}return Utility.GetSelectionStartPosition(t)+document.selection.createRange().text.GetLength()},Utility.GetSelectionStartPosition=function(t){if(t.selectionStart!=null){var n=0;n=t.selectionStart;if(t.value){var r=t.value.substring(0,n);n=r.GetLength()}var i=0;i=t.selectionEnd;if(t.value){var r=t.value.substring(0,i);i=r.GetLength()}return io.offsetTop)f=l;else if(s.offsetTopo.offsetLeft)f=l;else{if(!(s.offsetLeftr)throw t+" is out of range, should between "+n+" and "+r;return i},Utility.CheckFloat=function(t,n,r){var i=parseFloat(t);if(isNaN(i))throw"value is invalid";if(tr)throw t+" is out of range, should between "+n+" and "+r;return i},Utility.CheckDate=function(t,n,r){if(!(t instanceof Date))throw"Type is invalid";if(isNaN(t))throw"Date is a invalid date";if(r!=undefined)if(tr)throw t+" is out of range, should between "+n+" and "+r},Utility.CheckBool=function(t){return typeof t=="string"&&t.toLowerCase()==="true"?!0:t==1},Utility.CheckFunction=function CheckFunction(fun){if(fun===undefined||fun===null)return null;if(typeof fun=="string"){fun=Utility.Trim(fun);if(fun.length==0)return null;try{eval("fun ="+fun)}catch(e){}}if(typeof fun=="function")return fun;throw"The value is not a valid function"},Utility.GetCheckElement=function(){if(Utility.CheckElement==null){var t=document.createElement("div");Utility.CheckElement=t,t.style.display="none"}return Utility.CheckElement},Utility.CheckString=function(t){if(t!==undefined&&(typeof t=="string"||t instanceof String))return t==null&&(t=""),t.toString();throw t+" type is not a string."},Utility.GetCSSLength=function(t){var n=parseInt(t);return isNaN(n)?0:n},Utility.CheckCSSLength=function(t){return t=Utility.CheckInt(t,0,Math.pow(2,31)),parseInt(t)==t&&(t+="px"),Utility.GetCheckElement().style.width="",Utility.GetCheckElement().style.width=t,Utility.GetCheckElement().style.width},Utility.CheckFontSizeValue=function(t){return parseInt(t)==t&&(t+="px"),Utility.GetCheckElement().style.fontSize="",Utility.GetCheckElement().style.fontSize=t,Utility.GetCheckElement().style.fontSize},Utility.CheckColor=function(t){return Utility.GetCheckElement().style.backgroundColor="",Utility.GetCheckElement().style.backgroundColor=t,Utility.GetCheckElement().style.backgroundColor},Utility.CheckImageUrl=function(t){return Utility.CheckString(t)},Utility.GetCssImageUrl=function(t){return t.startWith('url("')?t=t.substring(5,t.length-2):t.startWith("url(")&&(t=t.substring(4,t.length-1)),t},Utility.CheckCssImageUrl=function(t){return t.length>0&&!t.startWith("url(")&&(t="url("+t+")"),Utility.GetCheckElement().style.backgroundImage="",Utility.GetCheckElement().style.backgroundImage=t,Utility.GetCheckElement().style.backgroundImage},Utility.CheckEnum=function(t,n){for(var r in t)if(t[r]==n||t[r]==n.toLowerCase())return t[r];throw"Enum value is invalid"},Utility.CheckChar=function(t){t=Utility.CheckString(t);if(t.length!==1)throw"Invalid value";return t},Utility.GetMultipleStringEnum=function(t){var n=t.split(" ");return n.sort(),n.join(",")},Utility.CheckMultipleStringEnum=function(t,n){var r=n.split(","),i=[];for(var s=0;s")!=-1)t=t.replace(">",">");return t},Utility.DecodingFromHTML=function(t){while(t.IndexOf(" ")!=-1)t=t.replace(" "," ");while(t.IndexOf("<")!=-1)t=t.replace("<","<");while(t.IndexOf(">")!=-1)t=t.replace(">",">");if(t.IndexOf("&")!=-1){var n=t,r="";while(n.IndexOf("&")!=-1){var i=n.IndexOf("&");n=n.replace("&","&"),r+=n.Substring(0,i+1),n=n.Substring(i+1,n.GetLength())}n.IndexOf("&")==-1&&n!=""&&(r+=n),t=r}return t},Utility.IsStandCompliantModeOn=function(){return Utility.IsIE()?document.compatMode=="CSS1Compat":document.compatMode=="CSS1Compat"||document.compatMode=="BackCompat"},Utility.GetPageZoomRate=function(){if(Utility.IsIE()&&Utility.engine===8)return screen.deviceXDPI/screen.logicalXDPI;var t=document.getElementById("gcsh_standard_control_for_get_normal_position");if(typeof t!="undefined"&&t!=null)return document.getElementById("gcsh_standard_control_for_get_normal_position").offsetLeft/100;var n=document.createElement("div");return document.body.appendChild(n),n.id="gcsh_standard_control_for_get_normal_position",n.style.visibility="hidden",n.style.left="100px",n.style.top="1px",n.style.width="1px",n.style.height="1px",n.style.position="absolute",document.getElementById("gcsh_standard_control_for_get_normal_position").offsetLeft/100},Utility.GetElementPosition=function(t){if(Utility.IsIE()||Utility.chrome||Utility.safari){if(Utility.engine>=8){var n=Utility.GetElementPositionForIE8(t);if(n.Left==0&&n.Top==0){var r=Utility.GetElementPositionForFireFox(t);return r}return n}var i=Utility.GetElementPositionForIE(t);return{Left:i.Left,Top:i.Top}}return Utility.GetElementPositionForFireFox(t)},Utility.GetElementPositionForIE8=function(t){var n=t;typeof t=="string"&&(n=document.getElementById(t));var r=0,i=0;if(n==null||n.self||n.nodeType===9)return{Left:i,Top:r};var s=n.getBoundingClientRect();if(!s)return{Left:i,Top:r};var o=n.ownerDocument.documentElement,i=s.left+o.scrollLeft,r=s.top+o.scrollTop;try{var u=n.ownerDocument.parentWindow.frameElement||null;if(u){var a=u.frameBorder==="0"||u.frameBorder==="no"?2:0;i+=a,r+=a}}catch(f){}return{Left:i,Top:r}},Utility.GetElementPositionForIE=function(t){var n=t;typeof t=="string"&&(n=document.getElementById(t));var r=0,i=0;if(n==null)return{Left:i,Top:r};if(n.offsetParent)while(n.offsetParent!=null){var s=n.offsetParent,o=s.tagName.toLowerCase();o!="table"&&o!="body"&&o!="html"&&s.clientTop&&s.clientLeft&&(i+=s.clientLeft,r+=s.clientTop);if(Utility.engine==7&&s.style.position.toLowerCase()=="relative"){i+=n.offsetLeft-n.scrollLeft,r+=n.offsetTop;var u=Utility.GetPageZoomRate();if(u==1){var a=n.offsetTop;for(var f=0;fh&&s<=a&&o>=0&&o=0;i--)if(t.CharAt(i)!=" "&&t.CharAt(i)!="\u00a1\u00a1"){r=i+1;break}try{var s=t.Substring(n,r);return s}catch(o){return t}},Utility.GetBrowserType=function(){var t=navigator.userAgent.toLowerCase();if(t.indexOf("msie")!=-1)Utility.ie=t.match(/msie ([\d.]+)/)[1];else if(t.indexOf("chrome")!=-1)Utility.chrome=t.match(/chrome\/([\d.]+)/)[1];else if(t.indexOf("safari")!=-1){var n=t.match(/version\/([\d.]+)/);n&&(Utility.safari=n[1])}else t.indexOf("firefox")!=-1?Utility.firefox=t.match(/firefox\/([\d.]+)/)[1]:t.indexOf("opera")!=-1&&(Utility.opera=t.match(/opera.([\d.]+)/)[1]);t.indexOf("ipad")!=-1&&(Utility.IPad=!0),Utility.engine=null,window.navigator.appName=="Microsoft Internet Explorer"&&(document.documentMode?Utility.engine=document.documentMode:(Utility.engine=5,document.compatMode&&document.compatMode=="CSS1Compat"&&(Utility.engine=7),Utility.ie&&Utility.ie.indexOf("6")==0&&(Utility.engine=6))),t.indexOf("rv:")!==-1&&t.indexOf("firefox")===-1&&(Utility.ie=Utility.engine=t.match(/rv:([\d.]+)/)[1])},Utility.GetTouchPath=function(t,n){return t===-1||n===-1?"Error":t>n?t-n>20?"ToTop":"NotMove":t20?"ToBottom":"NotMove":"NotMove"},Utility.IsPad=function(){var t=Utility.IPad||Utility.GetClientOS().toLowerCase()=="android";return t},Utility.IsJapan=function(){return navigator.userLanguage?navigator.userLanguage.indexOf("ja")!=-1:navigator.language?navigator["language"].indexOf("ja")!=-1:!1},Utility.IsFireFox4OrLater=function(){return Utility.firefox!=null&&parseFloat(Utility.firefox)>=4},Utility.IsIE11OrLater=function(){return Utility.IsIE()&&Utility.engine>=11},Utility.IsIE10OrLater=function(){return Utility.IsIE()&&Utility.engine>=10},Utility.IsIE9OrLater=function(){return Utility.IsIE()&&Utility.engine>=9},Utility.IsIE8OrLater=function(){return Utility.IsIE()&&Utility.engine>=8},Utility.IsIE8OrBelow=function(){return Utility.IsIE()&&Utility.engine<=8},Utility.IsIE8=function(){return Utility.IsIE()&&Utility.engine==8},Utility.IsIE7=function(){return Utility.IsIE()&&Utility.engine==7},Utility.IsIE7OrLater=function(){return Utility.IsIE()&&Utility.engine>=7},Utility.IsIE=function(){return Utility.ie!==undefined},Utility.IsIE9=function(){return Utility.IsIE()&&Utility.engine==9},Utility.GetClientOS=function(){var t;if(!Utility.IsIE()){var n=navigator.userAgent,r=n.indexOf("("),i=n.indexOf(")");t=n.substring(r+1,i)}else t=navigator.appVersion;return t.indexOf("NT 6.0")!=-1?"vista":t.indexOf("NT 5.2")!=-1?"win2003":t.indexOf("NT 5.1")!=-1?"winxp":t.indexOf("NT 5.0")!=-1?"win2000":t.indexOf("NT 6.1")!=-1?"Win7":t.indexOf("NT 6.2")!=-1?"Win8":t.indexOf("NT 6.3")!=-1?"Win8":t.indexOf("Android")!=-1?"Android":"unknow"},Utility.CreateStyleElement=function(t){var n=document.createElement("style");return n.id=t,n.type="text/css",n},Utility.CreateClassStyle=function(t){return Utility.CreateSelectorStyle("."+t)},Utility.CreateSelectorStyle=function(t){var n=document.getElementById("tableStyle");n==null&&(n=this.CreateStyleElement("tableStyle"),document.body.appendChild(n));var r=n.sheet||n.styleSheet,i=r.cssRules||r.rules;return r.insertRule?r.insertRule(t+"{ }",i.length):r.addRule(t,"{ }",i.length),i.item(i.length-1)},Utility.SetSelection=function(t,n,r,i){$(t).wijtextselection(Math.min(n,r),Math.max(n,r))},Utility.PreventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},Utility.CancelBubble=function(t){t.cancelBubble!==undefined?t.cancelBubble=!0:t.stopPropagation()},Utility.DragDrop=function(t){try{t.dragDrop(!0)}catch(n){}},Utility.GetMouseButton=function(t){var n=MouseButton.Default,r=Utility.IsIE8OrBelow()?1:0;return t.button==r?n=MouseButton.Left:t.button==1?n=MouseButton.Middle:t.button==2&&(n=MouseButton.Right),n},Utility.GetMouseWheelValue=function(t,n){return Utility.IsFireFox4OrLater()?-n.detail/3:(n.wheelDelta>=120?t++:n.wheelDelta<=-120&&t--,t)},Utility.SetCopy=function(t,n){var r;try{if(t==null||t==""){document.selection&&(r=document.selection.createRange().text);if(r=="")return}}catch(i){}t!=null&&(r=t),Utility.CopyDataToClipBoard(r,n)},Utility.CopyDataToClipBoard=function(t,n){if(n==0){Utility.SavedText=t;return}window.clipboardData?setTimeout(function(){try{window.clipboardData.setData("Text",t)}catch(e){}},0):Utility.CutCopyPasteEventObject!==null&&Utility.CutCopyPasteEventObject.clipboardData!==undefined&&Utility.CutCopyPasteEventObject.clipboardData.setData("text",t)},Utility.SetZoomStyle=function(t,n,r){if(t===undefined||t===null)return;var i="top left";r===DropDownAlign.Right&&(i="top right"),Utility.firefox?(t.style.MozTransformOrigin=n===""?"":i,t.style.MozTransform=n===""?"":"scale("+n+")",t.setAttribute("ZoomValue",n)):Utility.chrome||Utility.safari?n!==""?(t.style.MozTransform="scale("+n+")",t.style.WebkitTransform="scale("+n+")",t.style.webkitTransformOrigin=i):(t.style.MozTransform="",t.style.WebkitTransform="",t.style.WebkitTransformOrigin=""):Utility.IsIE9OrLater()?n!==""?(t.style.msTransform="scale("+n+")",t.style.msTransformOrigin=i):(t.style.msTransform="",t.style.msTransformOrigin=""):t.style.zoom=n},Utility.FilterText=function(t,n){if(n.GetLength()==0)return"";var r="",i=0,s=0;for(i=0;i=t.length)return-1;for(var i=r;i","?","@","[","]","^","_","`","{","|","}","\uff61","\uff62","\uff63","\uff64","\uff65","\u00a1","\u00a4","\u00a5"],e.CharEx=new e,e.prototype.ToHalfKatakana=function(e){var t="";if(this.IsFullWidth(e)){if(this.IsKatakana(e)){var n=e,r=n.charCodeAt(0)-(this.CharCategory._charstarts[62].charCodeAt(0)+1);if(r<0||r>91)return n;n=this.CharCategory._fullkana[r];var i=this.CharCategory._accentkana[r];i>0&&(n+=String.fromCharCode(i==1?this.CharCategory.KATAKANA_VOICED.charCodeAt(0):this.CharCategory.KATAKANA_SEMIVOICED.charCodeAt(0))),t=n}else if(this.IsHiragana(e)){var n=String.fromCharCode(e.charCodeAt(0)-this.CharCategory._charstarts[61].charCodeAt(0)+this.CharCategory._charstarts[62].charCodeAt(0)),r=n.charCodeAt(0)-(this.CharCategory._charstarts[62].charCodeAt(0)+1);if(r<0||r>91)return n;n=this.CharCategory._fullkana[r];var i=this.CharCategory._accentkana[r];i>0&&(n+=String.fromCharCode(i==1?this.CharCategory.KATAKANA_VOICED.charCodeAt(0):this.CharCategory.KATAKANA_SEMIVOICED.charCodeAt(0))),t=n}}else this.IsKatakana(e)&&(t=e);return t},e.prototype.GetCharType=function(e){var t=this.Ctype.OtherChar,n=this.BelongTo(e);if(e==""||"\0"<=e&&e<=""||"\u0080"<=e&&e<="\u009f")return this.Ctype.Control;if("A"<=e&&e<="Z")return this.Ctype.UpperCase;if("a"<=e&&e<="z")return this.Ctype.LowerCase;if("0"<=e&&e<="9")return this.Ctype.Numeric;if(this.IsFullWidthSymbol(e)||this.IsHalfWidthSymbol(e))t=this.Ctype.Symbol;if(e.charCodeAt(0)==8216||e.charCodeAt(0)==8217||e.charCodeAt(0)==8220||e.charCodeAt(0)==8221)t=this.Ctype.Punctuation;e.charCodeAt(0)==12288&&(t=this.Ctype.Space);switch(this.CharCategory.Blocks[n]){case"HALFWIDTH_AND_FULLWIDTH_FORMS":return this.MultiWidthDetails(e);case"KATAKANA":return this.Ctype.Katakana|this.Ctype.FullWidth;case"HIRAGANA":return this.Ctype.Hiragana|this.Ctype.FullWidth}return this.IsFarEastBlock(n,e)&&(t|=this.Ctype.FullWidth),t},e.prototype.IsCharOfType=function(e,t){return this.GetCharType(e)==t},e.prototype.IsMultiWidth=function(e){var t=this.BelongTo(e),n=this.CharCategory.Blocks[t];return n=="KATAKANA"||n=="CJK_SYMBOLS_AND_PUNCTUATION"||n=="HALFWIDTH_AND_FULLWIDTH_FORMS"||n=="BASIC_LATIN"&&e>=" "},e.prototype.IsFullWidthSymbol=function(t){for(var n=0;n="\ud800".charCodeAt(0)&&e.charCodeAt(0)<="\udbff".charCodeAt(0)&&e.charCodeAt(1)>="\udc00".charCodeAt(0)&&e.charCodeAt(1)<="\udfff".charCodeAt(0)?!0:!1},e.prototype.IsSurrogate=function(e){return e!=null&&e.charCodeAt(0)>="\ud800".charCodeAt(0)&&e.charCodeAt(0)<="\udfff".charCodeAt(0)},e.prototype.IsOther=function(e){return(this.GetCharType(e)&~this.Ctype.FullWidth)==this.Ctype.OtherChar},e.prototype.IsControl=function(e){return(this.GetCharType(e)&~this.Ctype.FullWidth)==this.Ctype.Control},e.prototype.IsKatakana=function(e){return(this.GetCharType(e)&~this.Ctype.FullWidth)==this.Ctype.Katakana},e.prototype.IsSmallHalfKatakana=function(e){var t=new Array("\u30a1","\u30a3","\u30a5","\u30a7","\u30a9","\u30e3","\u30e5","\u30e7","\u30c3","\u30ee"),n=e;e.charCodeAt(0)>this.CharCategory.KANAHALFSTART&&(n=this.CharCategory._halfkana[e.charCodeAt(0)-this.CharCategory.KANAHALFSTART]);for(var r=0;r=e.UpperKana.length-4&&n91)return e;e=this.CharCategory._fullkana[s];var o=this.CharCategory._accentkana[s];if(o>0)return e+=String.fromCharCode(o==1?this.CharCategory.KATAKANA_VOICED.charCodeAt(0):this.CharCategory.KATAKANA_SEMIVOICED.charCodeAt(0)),e;break;case this.Ctype.Space:e=" ";break;case this.Ctype.Hangul:}return e},e.prototype.ToKatakana=function(e){if(!this.IsCharOfType(e,this.Ctype.Hiragana|this.Ctype.FullWidth))return e;var t=this.GetFullHalfWidthSpecialChar(e,!1);return t!==""?t:String.fromCharCode(e.charCodeAt(0)-this.CharCategory._charstarts[61].charCodeAt(0)+this.CharCategory._charstarts[62].charCodeAt(0))},e.prototype.ToHiragana=function(e){return this.IsKatakana(e)?(this.IsFullWidth(e)||(e=this.ToFullWidth(e).text),this.IsCharOfType(e,this.Ctype.Katakana|this.Ctype.FullWidth)?e>="\u30f7"&&e<="\u30ff"?e:e=="\u30f5"?"\u304b":e=="\u30f6"?"\u3051":String.fromCharCode(e.charCodeAt(0)+this.CharCategory._charstarts[61].charCodeAt(0)-this.CharCategory._charstarts[62].charCodeAt(0)):e):e},e.prototype.ToBigHalfKatakana=function(e){if(!this.IsSmallHalfKatakana(e))return e;var t=this.CharCategory._halfkana[e.charCodeAt(0)-this.CharCategory.KANAHALFSTART];return t=String.fromCharCode(t.charCodeAt(0)+1),t},e.prototype.BelongTo=function(e){var t=0,n=83,r=n>>1;while(n-t>1)e>=this.CharCategory._charstarts[r]?t=r:n=r,r=n+t>>1;return r},e.prototype.MultiWidthDetails=function(e){var t=0,n=this.CharCategory._fullhalfblocks.length,r=n>>1;while(n-t>1)e>=this.CharCategory._fullhalfblocks[r]?t=r:n=r,r=n+t>>1;return this.CharCategory._mwtable[r]},e.prototype.IsFarEastBlock=function(e,t){switch(this.CharCategory.Blocks[e]){case"CJK_COMPATIBILITY":case"CJK_COMPATIBILITY_FORMS":case"CJK_COMPATIBILITY_IDEOGRAPHS":case"CJK_RADICALS_SUPPLEMENT":case"CJK_SYMBOLS_AND_PUNCTUATION":case"CJK_UNIFIED_IDEOGRAPHS":case"CJK_UNIFIED_IDEOGRAPHS_EXTENSION":case"HALFWIDTH_AND_FULLWIDTH_FORMS":case"BOPOMOFO":case"BOPOMOFO_EXTENDED":case"HIRAGANA":case"KATAKANA":case"KANBUN":case"HANGUL_COMPATIBILITY_JAMO":case"HANGUL_JAMO":case"HANGUL_SYLLABLES":return!0;default:for(var n=0;n255)return!0;if(t.charCodeAt(0)==8216||t.charCodeAt(0)==8217||t.charCodeAt(0)==8220||t.charCodeAt(0)==8221)return!0}return!1},e.prototype.GetFullHalfWidthSpecialChar=function(e,t){if(t==1)var n=this.CharCategory._jpnSpecialHalf,r=this.CharCategory._jpnSpecialFull;else var n=this.CharCategory._jpnSpecialFull,r=this.CharCategory._jpnSpecialHalf;var i=-1,s=0;while(su.Text.GetLength()?(u.SelectionStart=u.Text.GetLength(),u.SelectionEnd=u.Text.GetLength()):u.SelectionStart==n.GetLength()&&(u.SelectionStart=u.Text.GetLength(),u.SelectionEnd=u.Text.GetLength()),r==FocusType.Left&&o==DateCursorPosition.Default?(u.SelectionStart=0,u.SelectionEnd=0):r==FocusType.Right&&o==DateCursorPosition.Default&&(u.SelectionStart=u.Text.GetLength(),u.SelectionEnd=u.Text.GetLength());if(s==HighlightText.None&&o==DateCursorPosition.Default)return u;if(r==FocusType.ContextMenu)return u;var a=u.SelectionStart==null?e.SelectionStart:u.SelectionStart,f=this.SetCursorPositionAndSelection(s,u.Text,o,a);return f!=null&&(u.SelectionStart=f.SelectionStart,u.SelectionEnd=f.SelectionEnd,u.IsSelectionDeterminedByHighlightText=!0),u},e.prototype.LoseFocus=function(e){},e.prototype.MouseDown=function(e){var t={};return this.isTriClick=!1,this.isDblClick&&!Utility.GrapeCityTimeout&&e==MouseButton.Left&&(this.isTriClick=!0,t=this.SelectAll()),this.isDblClick=!1,t},e.prototype.MouseUp=function(e,t,n,r,i){var s={};return this.isTriClick?(Utility.SetSelection(e,t,n),null):i?(s=this.SelectAll(),Utility.SetSelection(e,s.SelectionStart,s.SelectionEnd),s):(s.SelectionStart=t,s.SelectionEnd=n,r==MouseButton.Left&&(s.SelectionStart=Utility.GetSelectionStartPosition(e),s.SelectionEnd=Utility.GetSelectionEndPosition(e)),s.SelectionStart!=s.SelectionEnd?this.isMulSelected=!0:this.isMulSelected=!1,s)},e.prototype.ProcessShortcutKey=function(e,t,n,r){var i={};switch(e){case"Clear":if(t)return i.System=!1,i;return this.Clear();case"NextControl":var s=this.MoveControl(this.GetInputElement(),!0,!1,"NextControl");return s!=null&&(i.EventInfo=s.EventInfo,i.FocusType=s.FocusType,i.FocusExit=!0),i.System=!1,i;case"PreviousControl":var s=this.MoveControl(this.GetInputElement(),!1,!1,"PreviousControl");return s!=null&&(i.EventInfo=s.EventInfo,i.FocusType=s.FocusType,i.FocusExit=!0),i.System=!1,i;case"NextField":return i=this.MoveField(n,!0),i;case"PreviousField":return i=this.MoveField(n,!1),i;case"NextField/NextControl":var i=this.MoveFieldAndControl(n,!0);return i;case"PreviousField/PreviousControl":var i=this.MoveFieldAndControl(n,!1);return i}},e.prototype.ProcessCharKeyInput=function(e,t,n,r,i){return null},e.prototype.ProcessNavigatorKeyInput=function(e,t,n,r,i,s,o,u){var a={};switch(e){case 45:return t==EditMode.FixedInsert?this.isOverWrite=!1:t==EditMode.FixedOverwrite?this.isOverWrite=!0:this.isOverWrite=!this.isOverWrite,a.Overwrite=this.isOverWrite,a.System=!1,this.Format.Fields.fieldCount==0&&(a.System=!0),a;case 8:a=this.ProcessBackSpace(i,s,r),a.System=!1;break;case 46:a=this.ProcessDelete(i,s,r),a.System=!1;break;case 196643:case 196644:case 196645:case 196647:case 65569:case 196641:case 65570:case 196642:if(e==65569||e==196641)e=196644;else if(e==65570||e==196642)e=196643;a.SelectionEnd=this.GetCaretPosition(s,e),this.isMulSelected=!0,a.System=!1;break;case 65582:case 65544:if(this.isMulSelected){if(!this.Owner._isSupportClipBoard()){a.System=!0;break}a=this.Cut(n,i,s)}else a=this.ProcessBackSpace(i,s);a.System=!1;break;case 65581:case 131158:if(this.Owner._isSupportClipBoard()){var f=Utility.GetPasteData(this.Owner?this.Owner.GetUseClipboard():!0);a=this.Paste(i,s,f,u),a.System=!1}else a.System=!0;break;case 65571:case 65572:case 65573:case 65575:case 65574:case 65576:this.isMulSelected=!0,a.SelectionEnd=this.GetCaretPosition(s,e),a.System=!1;break;case 131139:case 131117:this.Owner._isSupportClipBoard()?(this.Copy(n,i,s),a.System=!1):a.System=!0;break;case 131118:this.isMulSelected||(s=this.GetCaretPosition(s,e)),a=this.ProcessDelete(i,s),a.System=!1;break;case 131080:case 196616:this.isMulSelected||(s=this.GetCaretPosition(s,e)),a=this.ProcessBackSpace(i,s),a.System=!1;break;case 131137:a=this.SelectAll(),a.System=!1;break;case 131160:this.Owner._isSupportClipBoard()?(a=this.Cut(n,i,s),a.System=!1):a.System=!0;break;case 131162:a=this.Undo(),a.System=!1;break;case 131109:case 37:if(i==0&&(o==ExitOnLeftRightKey.Both||o==ExitOnLeftRightKey.Left)){var l=e==37?"Left":"CtrlLeft",c=this.MoveControl(this.GetInputElement(),!1,!0,l);return c!=null&&(a.EventInfo=c.EventInfo,a.FocusType=c.FocusType,a.FocusExit=!0),a};case 131108:case 131110:case 36:case 33:case 131105:if(e==33||e==131105)e=131108;a=this.ProcessLeftDirection(i,s,e),a.System=!1;break;case 131111:case 39:if(i==r.GetLength()&&(o==ExitOnLeftRightKey.Both||o==ExitOnLeftRightKey.Right)){var l=e==39?"Right":"CtrlRight",c=this.MoveControl(this.GetInputElement(),!0,!0,l);return c!=null&&(a.EventInfo=c.EventInfo,a.FocusType=c.FocusType,a.FocusExit=!0),a};case 131107:case 131112:case 35:case 34:case 131106:if(e==34||e==131106)e=131107;a=this.ProcessRightDirection(i,s,e),a.System=!1;break;default:a=null}return a},e.prototype.ProcessLeftDirection=function(e,t,n){},e.prototype.ProcessRightDirection=function(e,t,n){},e.prototype.KeyDown=function(e){var t=e.KeyCode,n=e.SelectionStart,r=e.SelectionEnd,i=e.Text,s=e.EditMode,o=e.KeyAction,u=e.ReadOnly,a=e.ClipContent,f=e.ExitOnLastChar,l=e.ExitOnLeftRightKey,c=e.TabAction,h={};switch(s){case EditMode.Insert:this.isOverWrite=!1;break;case EditMode.Overwrite:this.isOverWrite=!0;break;case EditMode.FixedInsert:this.isOverWrite=!1;break;case EditMode.FixedOverwrite:this.isOverWrite=!0}n!=r?this.isMulSelected=!0:this.isMulSelected=!1;switch(t){case 9:return h=this.ProcessTabKey(r,!0,c),h;case 65545:return h=this.ProcessTabKey(r,!1,c),h}if(o!=null)return this.ProcessShortcutKey(o,u,r,n);if(u){if(t==27||t==262182||t==262184||t==38||t==40)return null;if(t!=131117&&t!=131139&&t!=9&&t!=65545&&t!=131081&&t!=196617&&t!=131137&&t!=37&&t!=39&&t!=38&&t!=40)return h}if(this.Format.Fields.fieldCount==0){switch(t){case 45:return s==EditMode.FixedInsert?this.isOverWrite=!1:s==EditMode.FixedOverwrite?this.isOverWrite=!0:this.isOverWrite=!this.isOverWrite,h.Overwrite=this.isOverWrite,this.Format.Fields.fieldCount==0&&(h.System=!0),h;case 37:case 131109:if(n==0&&(l==ExitOnLeftRightKey.Both||l==ExitOnLeftRightKey.Left)){var p=t==37?"Left":"CtrlLeft",d=this.MoveControl(this.GetInputElement(),!1,!0,p);return d!=null&&(h.EventInfo=d.EventInfo,h.FocusType=d.FocusType,h.FocusExit=!0),h}break;case 39:case 131111:if(n==i.GetLength()&&(l==ExitOnLeftRightKey.Both||l==ExitOnLeftRightKey.Right)){var p=t==39?"Right":"CtrlRight",d=this.MoveControl(this.GetInputElement(),!0,!0,p);return d!=null&&(h.EventInfo=d.EventInfo,h.FocusType=d.FocusType,h.FocusExit=!0),h}}return null}var v=this.ProcessCharKeyInput(t,n,r,f,i);return v!=null?v:(h=this.ProcessNavigatorKeyInput(t,s,a,i,n,r,l,f),h)},e.prototype.KeyPress=function(e){},e.prototype.KeyUp=function(e){},e.prototype.ShowContextMenu=function(e,t){var n={};return t==""&&(n.SelectionStart=Utility.GetCursorPosition(e),n.SelectionEnd=n.SelectionStart),n},e.prototype.SelectStart=function(e,t,n){var r={};return t==""&&!this.isTriClick&&!this.isDblClick&&n!=MouseButton.Default&&(r.SelectionStart=Utility.GetCursorPosition(e),r.SetFalse=!0),r},e.prototype.DoubleClick=function(e){var t={},n=this.Format.Fields.GetFieldIndexByPos(e),r=this.Format.Fields.GetFieldRange(n.index);return t.SelectionStart=r.start,t.SelectionEnd=r.length+r.start,Utility.GrapeCityTimeout=!1,this.isDblClick=!0,this.isMulSelect=!0,setTimeout(function(){Utility.GrapeCityTimeout=!0},300),t},e.prototype.Undo=function(){},e.prototype.Cut=function(e,t,n){var r={};return t==n?r:(this.FireClientEvent("OnBeforeCut"),this.Copy(e,t,n),r=this.ProcessDelete(t,n),this.FireClientEvent("OnCut"),r)},e.prototype.Copy=function(t,n,r){var i=null,s=!0;if(t==ClipContent.ExcludeLiterals){var o=Math.abs(n-r),n=Math.min(n,r);if(o==0)return;i=this.Format.Fields.GetNonLiteralsText(n,o)}else!Utility.IsIE()||Utility.IsIE11OrLater()?i=Utility.GetSelectionText(this.Owner.GetInputElement()):i=document.selection.createRange().text;this.Owner&&(i=e.UpdateCrLfString(i,this.Owner.GetAcceptsCrlf()),s=this.Owner.GetUseClipboard()),Utility.IsIE()?setTimeout(function(){Utility.SetCopy(i,s)}):Utility.SetCopy(i,s)},e.prototype.Paste=function(e,t,n,r){},e.prototype.SelectAll=function(){var e={SelectionStart:0,SelectionEnd:0};e.SelectionStart=0;var t;return this.ID&&(t=this.GetShowLiterals()),t=="PostDisplay"||t=="PreDisplay"?e.SelectionEnd=Utility.FindIMControl(this.ID).GetText().GetLength():e.SelectionEnd=this.Format.Fields.GetLength(),this.isMulSelected=!0,e},e.prototype.FireEvent=function(e,t,n,r){if(Utility.FireEvent(e,t,n,r))return FocusType.ClientEvent},e.prototype.ProcessCharKey=function(e,t,n,r){var i={},s=Math.min(e,t),o=Math.abs(t-e),u={};i.start=s,i.success=!1;if(this.Format.Fields.GetFieldIndex(s).index==-1){var a={};return a.Name=this.Owner.InvalidInputEvent,a.Args=null,a.Type="invalidInput",i.EventInfo=a,i}var f=n.toString();if(o==0&&!this.isOverWrite)u=this.Format.Fields.Insert(s,f,!1);else if(o==0)if(s==this.Format.Fields.GetLength())u=this.Format.Fields.Insert(s,f,!1);else{var l=!1,c=this.Format.Fields.GetFieldIndexByPos(s),h=c.index,p=c.offset,d=this.Format.Fields.GetFieldRange(h);this.Format.Fields.GetFieldByIndex(h).fieldLabel=="PromptField"?s-p+d.length==this.Format.Fields.GetLength()?l=!1:(l=!0,o=d.length-p+1):(l=!0,o=n.GetLength());if(this.Format.Fields.GetFieldIndexByPos(s+o).index==-1){var a={};return a.Name=this.Owner.InvalidInputEvent,a.Args=null,a.Type="invalidInput",i.EventInfo=a,i}l?u=this.Format.Fields.Replace(s,o,f,!1):u=this.Format.Fields.Insert(s,f,!1)}else u=this.Format.Fields.Replace(s,o,f,!1);s=u.cursorPos;if(u.text!=""){var a={};return a.Name=this.Owner.InvalidInputEvent,a.Args=null,a.Type="invalidInput",i.EventInfo=a,i.start=s,i.success=!1,i}if(r==1)if(s==this.Format.Fields.GetLength())this.moveFocusExitOnLastChar=!0;else{var c=this.Format.Fields.GetFieldIndexByPos(s),h=c.index,p=c.offset;h==this.Format.Fields.fieldCount-1&&p==0&&this.Format.Fields.GetFieldByIndex(h).fieldLabel=="PromptField"&&(this.moveFocusExitOnLastChar=!0)}return i.start=s,i.success=!0,i},e.prototype.ProcessDeleteKey=function(e,t){var n=Math.min(e,t),r=Math.abs(e-t),i={};if(n==this.Format.Fields.GetLength()&&r==0)return i;var s,o=this.Format.Fields.GetFieldIndexByPos(n);s=o.index;if(s==-1)return i;if(r==0){if(this.Format.Fields.GetFieldByIndex(s).fieldLabel=="PromptField")return i;n=this.Format.Fields.Delete(n,1).cursorPos,i.SelectionStart=n,i.SelectionEnd=i.SelectionStart}else{var u,a;o=this.Format.Fields.GetFieldIndexByPos(n+r),u=o.offset,a=o.index;if(a==-1)return i;u==0&&a--;if(s==a&&this.Format.Fields.GetFieldByIndex(s).fieldLabel=="PromptField")return i;var f=this.Format.Fields.Delete(n,r);if(!f.isSucceed)return i;i.SelectionStart=f.cursorPos,i.SelectionStart==0&&this.Format.Fields.GetFieldByIndex(0).fieldLabel=="PromptField"&&(i.SelectionStart=this.Format.Fields.GetFieldByIndex(0).GetLength()),i.SelectionEnd=i.SelectionStart;var l,c,h=this.Format.Fields.GetFieldIndexByPos(i.SelectionStart);c=h.index,l=h.offset,l!=0&&this.Format.Fields.GetFieldByIndex(c).fieldLabel=="PromptField"&&(i.SelectionStart=i.SelectionStart-l+this.Format.Fields.GetFieldByIndex(c).GetLength(),i.SelectionEnd=i.SelectionStart)}return i},e.prototype.ProcessBackSpace=function(e,t,n){},e.prototype.ProcessDelete=function(e,t,n){},e.prototype.GetCaretPosition=function(e,t,n,r,i){var s=this.Format.Fields,o=s.GetFieldIndexByPos(e),u=o.index,a=o.offset,f,n,r,l=0;switch(t){case 36:case 65572:case 65574:return e<=n?0:n;case 35:case 65571:case 65576:return e>=r?s.GetLength():r;case 37:if(e==0)return 0;s.GetFieldByIndex(u).fieldLabel==i?a>0?e-=a:e--:a==0&&s.GetFieldByIndex(u-1).fieldLabel==i?e-=s.GetFieldRange(u-1).length:e--;break;case 39:if(e==s.GetLength())return e;if(s.GetFieldByIndex(u).fieldLabel==i){f=s.GetFieldRange(u),n=f.start,r=n+f.length;if(e=0;l--)if(s.GetFieldByIndex(l).fieldLabel!=i)return f=s.GetFieldRange(l),f.start;return 0}e-=a}break;case 196645:if(e==0||u==0)return 0;a==0?(f=s.GetFieldRange(u-1),e=f.start):e-=a;break;case 131111:if(e==s.GetLength()||u==s.fieldCount-1)return s.GetLength();if(s.GetFieldByIndex(u).fieldLabel!=i){for(l=u+1;l=0;l--)if(s.GetFieldByIndex(l).fieldLabel!=i)return f=s.GetFieldRange(l),f.start;return e}e-=a;break;case 196643:case 131107:case 131112:return s.GetLength();case 196644:case 131108:case 131110:return 0;case 65573:return e==0?0:--e;case 65575:return e==s.GetLength()?e:++e}return e},e.prototype.CompareShortcut=function(e,t){if(t.toString().IndexOf("|")==-1)return t==e?!0:!1;var n=null;while(n!=-1){n=t.toString().IndexOf("|");var r=t.toString().GetLength();if(t.Substring(0,n==-1?r:n)==e)return!0;t=t.Substring(n+1,r)}return!1},e.prototype.MoveControl=function(e,t,n,r){var i=Utility.GetElements(),s=null,o={};if(i.length<2)return null;var u=Utility.GetNextFocusableControl(e,i,t);r=="CharInput"||!Utility.IsIE()?(Utility.NextID=u,setTimeout(function(){Utility.SetElementFocus(u)},0)):Utility.SetElementFocus(u);if(n){var a=document.getElementById(u);if(a!=null&&(a.tagName.toLowerCase()=="textarea"||a.type=="text")&&Utility.IsIE()){var f=a.createTextRange();if(r=="Left"||r=="CtrlLeft")f.moveStart("character",a.value.length),f.select()}}var l={Key:ExitKeys.CharInput};switch(r){case"NextControl":l.Key=ExitKeys.NextControl;break;case"PreviousControl":l.Key=ExitKeys.PreviousControl;break;case"Right":l.Key=ExitKeys.Right;break;case"Left":l.Key=ExitKeys.Left;break;case"CtrlRight":l.Key=ExitKeys.CtrlRight;break;case"CtrlLeft":l.Key=ExitKeys.CtrlLeft;break;case"CharInput":l.Key=ExitKeys.CharInput}return s={},s.Name=this.Owner.KeyExitEvent,s.Args=l,s.Type="KeyExit",s!=null&&(o.EventInfo=s),o},e.prototype.MoveField=function(e,t){var n=this.Format.Fields.MoveField(e,t),r={};return n==-1?(r.NextPos=n,r):(r.SelectionStart=n,r.SelectionEnd=n,r)},e.prototype.ProcessTabKey=function(e,t,n){var r={Key:ExitKeys.Tab},i={};t?r.Key=ExitKeys.Tab:r.Key=ExitKeys.ShiftTab;var s={};return s.Name=this.Owner.KeyExitEvent,s.Args=r,s.Type="KeyExit",i.EventInfo=s,i.FocusType=FocusType.KeyExit,i.System=!0,i},e.prototype.MoveFieldAndControl=function(e,t){var n=this.MoveField(e,t);if(n.NextPos!=-1)return n;var r=t?"NextControl":"PreviousControl",i=this.MoveControl(this.GetInputElement(),t,!1,r);return i!=null&&(n.EventInfo=i.EventInfo,n.FocusType=i.FocusType,n.FocusExit=!0),n},e.prototype.DragStart=function(){},e.prototype.DragEnd=function(){},e.prototype.Drop=function(){},e.prototype.DragOver=function(){},e.prototype.GetKeyActionName=function(e,t){if(t==null)return null;var n=t,r=new Array,i=n.IndexOf(","),s=0;if(t!=""){while(i!=-1)r[s++]=n.Substring(0,i),n=n.Substring(i+1,n.GetLength()),i=n.IndexOf(",");r[s++]=n;for(var o=0;o0?r=i[0]:r=""}return r},e.FilterReturnChar=function(t){return t!=null&&(t=t.replace(new RegExp("[\r]","g"),"")),t},e}();input.BaseUIProcess=BaseUIProcess;var InputUIUpdate=function(){function e(e){this.Owner=e}return e.prototype.SetLastClientValues=function(e){},e.prototype.GetText=function(){if(this.Owner.GetInputElement()!=null)return this.Owner.GetInputElement().value},e.prototype.SetText=function(e){if(this.GetText()==null)return;if(this.GetText().replace(/\r\n/g,"\n")==e.replace(/\r\n/g,"\n"))return;this.Owner.GetInputElement()!=null&&(this.Owner.GetInputElement().value=e)},e.prototype.SetFocus=function(){try{this.Owner.GetInputElement()!=null&&this.Owner.GetInputElement().focus()}catch(e){}},e.prototype.GetTextHAlign=function(){return this.Owner.GetInputElement()!==null?this.Owner.GetInputElement().style.textAlign:""},e.prototype.SetTextHAlign=function(e){if(this.Owner.GetInputElement()!==null){this.Owner.GetInputElement().style.textAlign=e;if(Utility.IsIE()){var t=this.Owner.GetInputElement().style.width,n=parseInt(t);isNaN(n)&&(n=120),this.Owner.GetInputElement().style.width=n+1+"px";var r=this;setTimeout(function(){r.InputElement.style.width=t},0)}}},e.prototype.SetForeColor=function(e){this.Owner.GetInputElement()!=null&&(this.Owner.GetInputElement().style.color=e)},e.prototype.WriteCssStyle=function(e){try{var t=document.getElementById("gcsh_InputManWeb_Style_Container");if(Utility.IsIE())t.styleSheet.cssText=e;else{var n=t.sheet;for(var r=n.cssRules.length-1;r>=0;r--)n.deleteRule(r);var i=e.split("}");for(var s=0;s256)return;if(n.keyCode==46&&n.shiftKey)return;if(t.ImeMode===!0)return;var r=t;if(!Utility.IsIE()&&(n.charCode==0||!Utility.ShouldInvokeKeyPress)){if(!Utility.ShouldInvokeKeyPress||(n.keyCode==38||n.keyCode==40)&&r.Type!="Edit"){Utility.ShouldInvokeKeyPress=!0,Utility.PreventDefault(n),r!=null&&r.Type=="Edit"&&r.DropDownObj!=null&&r.DropDownObj.IsKeyFromDropDown&&(r.DropDownObj.IsKeyFromDropDown=!1);return}if(n.keyCode!=13||r.Type!="Edit")return}var i=n.keyCode||n.charCode;if(i!=13||r.Type=="Edit"){var s=String.fromCharCode(i);try{if(CharProcess.CharEx.IsSurrogate(s.charAt(0))){r.IsSurrogateKeyPressing=!0;return}}catch(o){}if(s!=null){var u=null;try{u=t.KeyPress(s,n)}catch(o){}}if(!u){Utility.PreventDefault(n);return}}},e.OnKeyUp=function(t,n){if(t.ImeMode===!0&&!Utility.IsIE8OrBelow())return;try{var r=t;if(r.IsSurrogateKeyPressing)try{if(r.InputElement!=null){var i=r.InputElement.value,s=r.InputElement.selectionStart,o=i.substr(s-2,s);r.KeyPress(o,n)}}finally{r.IsSurrogateKeyPressing=!1}Utility.FuncKeysPressed={Shift:n.shiftKey,Ctrl:n.ctrlKey,Alt:n.altKey},r.KeyUp(n)}catch(u){}},e.OnCompositionStart=function(t,n){try{t.CompositionStart(n)}catch(r){}},e.OnCompositionUpdate=function(t,n){try{t.CompositionUpdate(n)}catch(r){}},e.OnCompositionEnd=function(t,n){try{t.CompositionEnd(n)}catch(r){}},e.OnWebkitEditableContentChanged=function(t,n){try{t.WebkitEditableContentChanged(n)}catch(r){}},e.OnMouseOver=function(t,n){try{t.MouseOver&&t.MouseOver()}catch(r){}},e.OnMouseOut=function(t,n){try{t.MouseOut()}catch(r){}},e.OnMouseMove=function(t,n){try{t.MouseMove&&t.MouseMove(n)}catch(r){}},e.OnMouseDown=function(t,n){if(t.ImeMode&&t.ImeMode===!0&&!Utility.IsIE8OrBelow())return;try{t.MouseDown(n),Utility.IsIE()||(Utility.DragStartElementID=t)}catch(r){}},e.OnMouseUp=function(t,n){if(t.ImeMode&&t.ImeMode===!0&&!Utility.IsIE8OrBelow())return;try{if(t.MouseUpPointerType!=null&&t.MouseUpPointerType!==4&&t.MouseUpPointerType!=="mouse"){var r={};for(var i in n)r[i]=n[i];setTimeout(function(e){t.MouseUp(r)},300)}else t.MouseUp(n);Utility.IsIE()||(Utility.DragStartElementID="")}catch(s){}},e.OnSelectStart=function(t,n){Utility.InnerSelect===!0&&Utility.ShouldFireOnSelectStart==0&&Utility.CancelBubble(n);var r=Utility.GetSelectionText(t.GetInputElement());if(typeof r=="undefined"||r==null)r="";var i=null;try{i=t.SelectStart(r)}catch(s){}i==0&&Utility.PreventDefault(n)},e.OnDblClick=function(t,n){var r=null;try{r=t.DoubleClick()}catch(i){}r||Utility.PreventDefault(n)},e.OnHTML5BeforeCopy=function(t,n){try{Utility.CutCopyPasteEventObject=n?n.originalEvent:n,t.Copy(n)}catch(r){}finally{Utility.CutCopyPasteEventObject=null}},e.OnHTML5Cut=function(t,n){try{var r=t.GetInputElement(),i=r.value,s=r.selectionStart,o=r.selectionEnd;setTimeout(function(){r.value=i,r.selectionStart=s,r.selectionEnd=o,t.Cut(n)},0)}catch(u){}},e.OnHTML5Paste=function(t,n){try{if(Utility.chrome&&Utility.GetClientOS().toLowerCase()!=="android")Utility.CutCopyPasteEventObject=n?n.originalEvent:n,t.Paste(Utility.GetDataFromClipboard(!0)),Utility.PreventDefault(n);else{var r=t.SelectionStart,i=t.SelectionEnd;setTimeout(function(){Utility.GetClientOS().toLowerCase()==="android"&&(t.SelectionStart=r,t.SelectionEnd=i),t.isPasting=!0,t.ImeInput("DirectInput")},0)}}catch(s){}finally{Utility.CutCopyPasteEventObject=null}},e.OnMouseWheel=function(t,n){try{t.MouseWheel(n),t.ShouldCancelMouseWheelDefaultBehavior()&&Utility.PreventDefault(n)}catch(r){}},e.OnDragStart=function(t,n){try{t.DragStart()}catch(r){}},e.OnDragEnd=function(t,n){try{t.DragEnd(n)}catch(r){}},e.OnDrop=function(t,n){try{var r=n.originalEvent.dataTransfer.getData("Text");t.DragDrop(r,n)}catch(i){}},e.OnTouchStart=function(t,n){Utility.TouchStartTime=new Date,Utility.TouchStartEvt=n},e.OnTouchEnd=function(t,n){if(Utility.TouchStartTime!==undefined){Utility.TouchEndTime=new Date;var r=Utility.TouchEndTime.valueOf()-Utility.TouchStartTime.valueOf();if(r>1e3){var i="";try{i=Utility.GetSelectionText(t.GetInputElement())}catch(s){}t.ShowContextMenu(i,Utility.TouchStartEvt),t.GetEnabled()&&Utility.PreventDefault(n)}Utility.TouchStartTime=undefined,Utility.TouchEndTime=undefined}},e.OnDragEnter=function(t,n){try{t.DragEnter()}catch(r){}},e.OnDragLeave=function(t,n){try{t.DragLeave()}catch(r){}},e.OnSelect=function(t,n){try{t&&t.Focused&&t.Select()}catch(r){}},e.OnPropertyChanged=function(t,n){try{t.PropertyChange(n)}catch(r){}},e.OnMSPointerUp=function(t,n){t.MSPointerUp(n)},e.OnMSPointerDown=function(t,n){try{t.MSPointerDown(n)}catch(r){}},e.OnMSGestureTap=function(t,n){try{t.MSGestureTap(n)}catch(r){}},e.OnEditFieldFocus=function(t,n){if(Utility.IsFocusFromIMControl(t._id,n))if(Utility.IsIE()||Utility.HasGetFocus)return;Utility.IsOnFocus=!0,Utility.IsIE()||(Utility.HasGetFocus=!0),this.OnFocus(t,n)},e.OnEditFieldLoseFocus=function(n,r){try{var i=n;if(i!=null&&i.Type=="Edit"&&i.IsFocusToDropDownEdit){i.IsFocusToDropDownEdit=!1;return}if(Utility.IsFocusToIMControl(n._id,r))return;if(Utility.firefox){if(Utility.IsOnFocus&&Utility.IsIE()&&Utility.IsOnActivate&&Utility.IsOnActivateControlID==n._id){Utility.FocusToBorder!=null&&Utility.FocusToBorder==1&&(Utility.FocusToBorder=!1,i.SetInnerFocus());return}Utility.FocusToBorder=!1,Utility.IsIE()?Utility.IsOnFocus=!1:Utility.HasGetFocus=!1}e.OnLostFocus(n,r),Utility.FuncKeysPressed={Shift:!1,Ctrl:!1,Alt:!1}}catch(s){}},e.OnFocusOut=function(t,n){Utility.FocusToBorder=!1;if(Utility.IsIE()&&n.toElement){var r=n.toElement.id;r==t._id+"_Inside_Div_Container"&&(Utility.FocusToBorder=!0)}if(Utility.IsFocusToIMControl(t._id,n)){Utility.IsIE()&&Utility.engine>=9&&(Utility.IsOnActivate=!0,Utility.IsOnActivateControlID=t._id,Utility.IsOnFocus=!0);return}Utility.IsIE()&&Utility.IsOnActivate&&(Utility.IsOnActivate=!1,Utility.IsOnActivateControlID=""),Utility.IsOnFocus&&(Utility.IsOnFocus=!1)},e.OnActivate=function(t,n){Utility.IsOnActivate=!0,Utility.IsOnActivateControlID=t._id;if(Utility.IsFocusFromIMControl(t._id,n))return;Utility.IsOnActivate=!0,Utility.IsOnActivateControlID=t._id},e.OnDeActivate=function(t,n){if(Utility.IsFocusToIMControl(t._id,n))return;Utility.IsOnActivate=!1,Utility.IsOnActivateControlID="",Utility.IsOnFocus=!1},e.OnFocus=function(t,n){try{var r=function(){t.Focus(),t.Focused=!0,Utility.IsPad()&&(t.IPadSelectionRefreshTimer=setInterval(function(){t.Select()},400))};Utility.IsIE()?r.call(this):setTimeout(r,0)}catch(i){}},e.OnLostFocus=function(t,n){try{t.LoseFocus(n),t.Focused=!1,Utility.IsPad()&&clearInterval(t.IPadSelectionRefreshTimer)}catch(r){}},e}();input.GlobalEventHandler=GlobalEventHandler,String.prototype.GetLength=function(){return this.length},String.prototype.Substring=function(e,t){return this.substring(e,t)},String.prototype.IndexOf=function(e,t){return this.indexOf(e,t)},String.prototype.LastIndexOf=function(e){return this.lastIndexOf(e)},String.prototype.CharAt=function(e){return this.charAt(e)}})(wijmo.input||(wijmo.input={}));var input=wijmo.input})(wijmo||(wijmo={}));;
var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(e){(function(t){"use strict";var n=jQuery;(function(e){e._map=[],e.editOptional=1,e.editRequired=2,e.separator=4,e.literal=8})(t.wijchartype||(t.wijchartype={}));var r=t.wijchartype,i=function(e){function r(){e.apply(this,arguments),this._imMask=null,this._advanceMode=!1}return __extends(r,e),r._imMaskAssociatedoptions=["disabled","disableUserInput","blurOnLastChar","imeMode","blurOnLeftRightKey","tabAction","nullText","placeholder","readonly","promptChar","autoConvert","showNullText","hideEnter","hidePromptOnLeave"],r.prototype._createTextProvider=function(){this._textProvider=new o(this,this.options.mask,!1)},r.prototype._checkMaskAndPassword=function(){var e=!this.options.mask||this.options.mask.length<0;if(e&&this._isPassword())throw'Option "passwordChar" requires a mask'},r.prototype._updateIsPassword=function(){var e=this.options.passwordChar.length>0&&this.element.attr("type")!=="password";this.element.data("isPassword",e),this._checkMaskAndPassword()},r.prototype._beginUpdate=function(){this.element.addClass(this.options.wijCSS.wijinputmask),this._updateIsPassword(),this.element.data("defaultText",this.options.text)},r.prototype._setOption=function(t,n){switch(t){case"maskFormat":this._super(t,n),t="mask"}e.prototype._setOption.call(this,t,n);if(this._advanceMode)if(r._imMaskAssociatedoptions.indexOf)r._imMaskAssociatedoptions.indexOf(t)!==-1&&this._syncProperties();else for(var i=0;i0&&r>t[t.length-1].end&&(i=t.length);if(i===-1)for(var s=0;s=t[s].start&&r<=t[s].end){i=s;break}if(r":e="upper";continue}f||(n=r.literal,f=!0)}if(!f){if(c<="\\"){switch(c){case s.FK_K:case s.FK_H:case"L":l=this.getPromtChar(),n=r.editRequired,f=!0;break;case"\\":t=!0,n=r.literal;continue}f||(n=r.literal,f=!0)}if(!f){c==="a"&&(l=this.getPromtChar(),n=r.editOptional,f=!0);switch(c){case s.FK_DB_K:case s.FK_DB_J:case s.FK_DB_9:case s.FK_DB_Z:l=this.getPromtChar(),n=r.editRequired,f=!0}if(!f){c!=="|"&&(n=r.literal,f=!0);if(!f){e="none";continue}}}}}if(f){var h=new u(a,n);this.isEditDesc(h)&&(h.caseConversion=e),n!==r.separator&&(i=l);for(var p=0;p1?e.charAt(0):e},s.prototype.isPassword=function(){return this.inputWidget?this.inputWidget._isPassword():!1},s.prototype.getResetOnPrompt=function(){return this.inputWidget?this.inputWidget.options.resetOnPrompt:!0},s.prototype.getResetOnSpace=function(){return this.inputWidget?this.inputWidget.options.resetOnSpace:!0},s.prototype.getSkipLiterals=function(){return this.inputWidget?this.inputWidget.options.skipLiterals:!0},s.prototype.getHidePromptOnLeave=function(){return this.inputWidget?this.inputWidget.options.hidePromptOnLeave:!1},s.prototype._trueOR=function(e,t){return(e>>>1|t>>>1)*2+(e&1|t&1)},s.prototype.setValue=function(e){return!1},s.prototype.getValue=function(){return null},s.prototype.getPromtChar=function(){var e=this.inputWidget?this.inputWidget.options.promptChar:"_";return e===""&&(e="_"),e.length>1?e.charAt(0):e},s.prototype.getAutoConvert=function(){return this.inputWidget?this.inputWidget.options.autoConvert:!0},s.prototype.updatePromptChar=function(){if(this.noMask)return;for(var e=0;e=this.descriptors.length&&e--,Math.max(0,e)},s.prototype.findNonEditPositionInRange=function(e,t,n){var i=this._trueOR(r.literal,r.separator);return this.findPositionInRange(e,t,n,i)},s.prototype.findPositionInRange=function(e,t,n,r){e=Math.max(0,e),t=Math.min(t,this.testString.length-1);if(e<=t)while(e<=t){var i=n?e++:t--,s=this.descriptors[i];if((s.charType&4294967295&(r&4294967295))===s.charType)return i}return-1},s.prototype.findAssignedEditPositionInRange=function(e,t,n){return this.assignedCharCount===0?-1:this.findEditPositionInRange(e,t,n,r.editRequired)},s.prototype.findEditPositionInRange=function(e,t,n,i){do{var s=this._trueOR(r.editRequired,r.editOptional),o=this.findPositionInRange(e,t,n,s);if(o===-1)break;var u=this.descriptors[o];switch(i){case r.editOptional:if(!u.isAssigned)return o;break;case r.editRequired:if(u.isAssigned)return o;break;default:return o}n?e++:t--}while(e<=t);return-1},s.prototype.findAssignedEditPositionFrom=function(e,t){if(!this.assignedCharCount)return-1;var n,r;return t?(n=e,r=this.testString.length-1):(n=0,r=e),this.findAssignedEditPositionInRange(n,r,t)},s.prototype.findEditPositionFrom=function(e,t){var n,r;return t?(n=e,r=this.testString.length-1):(n=0,r=e),this.findEditPositionInRange(n,r,t,0)},s.prototype.setChar=function(t,i,s){if(this.getAutoConvert()){var o=new e.input.wijInputResult,u=this.testInternal(t,i,o);if(!u){var a=this._convert(t,0);if(t.length===0)debugger;t=a.strValue.charAt(0),a.strValue.length>1&&this.inputWidget.element.data("appendChar",a.strValue.charAt(1)),a.index===2&&this.inputWidget.element.data("skipNextChar",!0)}}i=Math.max(0,i),s||(s=this.descriptors[i]),this.testEscapeChar(t,i,s)?this.resetChar(i):(n.wij.charValidator.isLetter(t)&&(n.wij.charValidator.isUpper(t)?s.caseConversion==="lower"&&(t=t.toLowerCase()):s.caseConversion==="upper"&&(t=t.toUpperCase())),this.testString=n.wij.charValidator.setChar(this.testString,t,i),s.isAssigned||(s.isAssigned=!0,this.assignedCharCount++,s.charType===r.editRequired&&this.requiredCharCount++))},s.prototype.internalInsertAt=function(e,n,r,i){if(e.length===0)return r.testPosition=n,r.hint=r.noEffect,!0;if(!this._testString(e,n,r))return!1;var s=this.findEditPositionFrom(n,!0),o=this.findAssignedEditPositionInRange(s,r.testPosition,!0)!==-1;if(o&&r.testPosition===this.testString.length-1)return r.hint=r.unavailableEditPosition,r.testPosition=this.testString.length,!1;var u=this.findEditPositionFrom(r.testPosition+1,!0);if(o){var a=new t.wijInputResult;a.hint=a.unknown;var f=!0,l=this.findAssignedEditPositionFrom(this.testString.length-1,!1);while(f){f=!1;if(u===-1)return r.hint=r.unavailableEditPosition,r.testPosition=this.testString.length,!1;var c=this.testChar(this.testString.charAt(s),u,a);if(this.descriptors[s].isAssigned&&!c)return r.hint=a.hint,r.testPosition=u,!1;if(s!==l){s=this.findEditPositionFrom(s+1,!0),u=this.findEditPositionFrom(u+1,!0),f=!0;continue}}r.hint=Math.max(r.hint,a.hint)}if(!i){if(o)while(s>=n)this.descriptors[s].isAssigned?this.setChar(this.testString.charAt(s),u):this.resetChar(u),u=this.findEditPositionFrom(u-1,!1),s=this.findEditPositionFrom(s-1,!1);this.setString(e,n)}return!0},s.prototype.insertAt=function(e,n,r){typeof r=="undefined"&&(r=new t.wijInputResult);if(e===undefined)throw"InsertAt: input";return this.noMask?(this.testString=this.testString.substring(0,n)+e+this.testString.substring(n,this.testString.length),r.testPosition=n+e.length-1,!0):n>=0&&n0,i.strValue.length>1&&this.inputWidget.element.data("appendChar",i.strValue.charAt(1)),i.index===2&&this.inputWidget.element.data("skipNextChar",!0)}return r},s.prototype.testInternal=function(e,r,i){if(!n.wij.charValidator.isPrintableChar(e))return i.hint=i.invalidInput,!1;var o=this.descriptors[r];if(!o)return!1;if(this.isLiteral(o))return this.getSkipLiterals()&&e===this.testString.charAt(r)?(i.hint=i.characterEscaped,!0):(i.hint=i.nonEditPosition,!1);if(e===this.getPromtChar()){if(this.getResetOnPrompt())return this.isEditDesc(o)&&o.isAssigned?i.hint=i.sideEffect:i.hint=i.characterEscaped,!0;if(!this.getAllowPromptAsInput())return i.hint=i.promptCharNotAllowed,!1}if(e===" "&&this.getResetOnSpace())return this.isEditDesc(o)&&o.isAssigned?i.hint=i.sideEffect:i.hint=i.characterEscaped,!0;switch(this.mask.charAt(o.maskPosition)){case"L":if(!n.wij.charValidator.isLetter(e))return i.hint=i.letterExpected,!1;if(!n.wij.charValidator.isAsciiLetter(e)&&this.asciiOnly)return i.hint=i.asciiCharacterExpected,!1;break;case"?":if(!n.wij.charValidator.isLetter(e)&&e!==" ")return i.hint=i.letterExpected,!1;if(!n.wij.charValidator.isAsciiLetter(e)&&this.asciiOnly)return i.hint=i.asciiCharacterExpected,!1;break;case"A":if(!n.wij.charValidator.isAlphanumeric(e))return i.hint=i.alphanumericCharacterExpected,!1;if(!n.wij.charValidator.isAciiAlphanumeric(e)&&this.asciiOnly)return i.hint=i.asciiCharacterExpected,!1;break;case"a":if(!n.wij.charValidator.isAlphanumeric(e)&&e!==" ")return i.hint=i.alphanumericCharacterExpected,!1;if(!n.wij.charValidator.isAciiAlphanumeric(e)&&this.asciiOnly)return i.hint=i.asciiCharacterExpected,!1;break;case"&":if(!n.wij.charValidator.isAscii(e)&&this.asciiOnly)return i.hint=i.asciiCharacterExpected,!1;break;case"C":if(!n.wij.charValidator.isAscii(e)&&this.asciiOnly&&e!==" ")return i.hint=i.asciiCharacterExpected,!1;break;case"0":if(!n.wij.charValidator.isDigit(e))return i.hint=i.digitExpected,!1;break;case"9":if(!n.wij.charValidator.isDigit(e)&&e!==" ")return i.hint=i.digitExpected,!1;break;case s.FK_DB_9:if(!(e>=s.DBCS_0&&e<=s.DBCS_9)&&e!==" ")return!1;break;case"#":if(!n.wij.charValidator.isDigit(e)&&e!=="-"&&e!=="+"&&e!==" ")return i.hint=i.digitExpected,!1;break;case s.FK_K:if(!!t.CharProcess.CharEx.IsFullWidth(e)||!t.CharProcess.CharEx.IsKatakana(e))return!1;break;case s.FK_H:if(t.CharProcess.CharEx.IsFullWidth(e))return!1;break;case s.FK_DB_K:if(!t.CharProcess.CharEx.IsFullWidth(e)||!t.CharProcess.CharEx.IsKatakana(e))return!1;break;case s.FK_DB_J:if(!t.CharProcess.CharEx.IsHiragana(e))return!1;break;case s.FK_DB_Z:if(!t.CharProcess.CharEx.IsFullWidth(e))return!1}return e===this.testString.charAt(r)&&o.isAssigned?i.hint=i.noEffect:i.hint=i.success,!0},s.prototype._convert=function(e,n){var r={};r.success=!0,r.strValue="",r.index=n;var i=e.Substring(n,n+1),s,o=t.CharProcess.CharEx,u=!0;if(o.IsAlphabet(i)){var a=o.IsLower(i)?i.toUpperCase():i.toLowerCase();return s=this._isValid(a),s&&u||!s&&!u?(n++,r.index=n,r.strValue=a,r):(i=o.IsFullWidth(i)?o.ToHalfWidth(i):o.ToFullWidth(i).text,s=this._isValid(i),s&&u||!s&&!u?(n++,r.index=n,r.strValue=i,r):(a=o.IsFullWidth(a)?o.ToHalfWidth(a):o.ToFullWidth(a).text,s=this._isValid(a),s&&u||!s&&!u?(n++,r.index=n,r.strValue=a,r):(r.success=!1,r)))}if(o.IsHiragana(i)){if(o.IsLowerKana(i)){var f=o.ToUpperKana(i);s=this._isValid(f);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=f,r}else if(o.HasLowerKana(i)){var l=o.ToLowerKana(i);s=this._isValid(l);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=l,r}i=o.ToKatakana(i),s=this._isValid(i);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=i,r;if(o.IsLowerKana(i)){var f=o.ToUpperKana(i);s=this._isValid(f);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=f,r}else if(o.HasLowerKana(i)){var l=o.ToLowerKana(i);s=this._isValid(l);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=l,r}var c=o.ToHalfWidthEx(i);s=this._isValid(c);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=c,r;if(o.IsLowerKana(c)){c=o.ToUpperKana(c),s=this._isValid(c);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=c,r}else if(o.HasLowerKana(c)){c=o.ToLowerKana(c),s=this._isValid(c);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=c,r}return r.success=!1,r}if(o.IsKatakana(i)){if(o.IsLowerKana(i)){var f=o.ToUpperKana(i);s=this._isValid(f);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=f,r}else if(o.HasLowerKana(i)){var l=o.ToLowerKana(i);s=this._isValid(l);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=l,r}var a=i,h=!1;if(o.IsFullWidth(i)){var p=o.ToHalfWidthEx(i);if(p.GetLength()>0){s=this._isValid(p);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=p,r}if(o.IsLowerKana(p)){p=o.ToUpperKana(p),s=this._isValid(p);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=p,r}else if(o.HasLowerKana(p)){p=o.ToLowerKana(p),s=this._isValid(p);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=p,r}}else{if(n==null){a=o.ToFullWidth(i).text;if(!o.IsKatakana(a))return r;s=this._isValid(a);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=a,r}else{var d=this.inputWidget.element.data("nextChar");if(this._needCheckNextChar&&d&&d.length>0){var v=o.ToFullWidth(e+d);a=v.text,h=v.processedAll}else a=o.ToFullWidth(i).text;if(!o.IsKatakana(a))return r;s=this._isValid(a);if(s&&u||!s&&!u)return n++,h&&n++,r.index=n,r.strValue=a,r}if(o.IsLowerKana(a)){var f=o.ToUpperKana(a);s=this._isValid(f);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=f,r}else if(o.HasLowerKana(a)){var l=o.ToLowerKana(a);s=this._isValid(l);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=l,r}}a=o.ToHiragana(a),s=this._isValid(a);if(s&&u||!s&&!u)return n++,h&&n++,r.index=n,r.strValue=a,a=="\u3094"&&(h?r.strValue="\u3046\u309b":(n--,r.index=n,r.strValue="",r.success=!1)),r;if(o.IsLowerKana(a)){var f=o.ToUpperKana(a);s=this._isValid(f);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=f,r}else if(o.HasLowerKana(a)){var l=o.ToLowerKana(a);s=this._isValid(l);if(s&&u||!s&&!u)return n++,r.index=n,r.strValue=l,r}}return i=o.IsFullWidth(i)?o.ToHalfWidth(i):o.ToFullWidth(i).text,s=this._isValid(i),s&&u||!s&&!u?(n++,r.index=n,r.strValue=i,r):(r.success=!1,r)},s.prototype._isValid=function(t){var n=new e.input.wijInputResult;return this.testInternal(t,this._autoConvertPosition,n)},s.prototype._testString=function(e,n,r){r.hint=r.unknown,r.testPosition=n;if(e.length){var i=new t.wijInputResult;i.testPosition=r.testPosition,i.hint=r.hint;for(var s=0;sthis.testString.length)return r.hint=r.unavailableEditPosition,!1;var o=e.charAt(s);if(!this.testEscapeChar(o,r.testPosition)){r.testPosition=this.findEditPositionFrom(r.testPosition,!0);if(r.testPosition===-1)return r.testPosition=this.testString.length,r.hint=r.unavailableEditPosition,!1}this._needCheckNextChar=!0,this.inputWidget.element.data("batchKeyPress")||this.inputWidget.element.data("nextChar",s===e.length-1?"":e.charAt(s+1));if(!this.testChar(o,r.testPosition,i))return r.hint=i.hint,this._needCheckNextChar=!1,this.inputWidget.element.data("batchKeyPress")||this.inputWidget.element.data("nextChar",""),!1;this._needCheckNextChar=!1;if(!this.inputWidget.element.data("batchKeyPress")){this.inputWidget.element.data("nextChar","");var u=this.inputWidget.element.data("appendChar");if(u&&u.length>0){this.inputWidget.element.data("appendChar",""),r.testPosition++;if(!this.testChar(u,r.testPosition,i))return r.hint=i.hint,this._needCheckNextChar=!1,!1}this.inputWidget.element.data("skipNextChar")&&(s++,this.inputWidget.element.data("skipNextChar",!1))}r.hint=Math.max(i.hint,r.hint),r.testPosition++;if(r.testPosition===this.testString.length)break}r.testPosition--}return!0},s.prototype.setText=function(e,n){typeof n=="undefined"&&(n=new t.wijInputResult);if(e===undefined)throw"SetFromPos: input parameter is null or undefined.";n.hint=n.unknown,n.testPosition=0;if(!e.length)return this.clear(n),!0;if(this.noMask)return this.testString=e,!0;if(!this.testSetString(e,n.testPosition,n))return!1;var r=this.findAssignedEditPositionFrom(n.testPosition+1,!0);return r!==-1&&this.resetString(r,this.testString.length-1),!0},s.prototype.resetString=function(e,t){if(this.noMask){this.testString="";return}e=this.findAssignedEditPositionFrom(e,!0);if(e!==-1){t=this.findAssignedEditPositionFrom(t,!1);while(e<=t)e=this.findAssignedEditPositionFrom(e,!0),this.resetChar(e),e++}},s.prototype.setString=function(e,t){for(var n=0;n=this.testString.length)return;this.inputWidget.element.data("batchKeyPress")||this.inputWidget.element.data("nextChar",n===e.length-1?"":e.charAt(n+1)),this._needCheckNextChar=!0,this.setChar(r,t),t++,this._needCheckNextChar=!1;if(!this.inputWidget.element.data("batchKeyPress")){this.inputWidget.element.data("nextChar","");var i=this.inputWidget.element.data("appendChar");i&&i.length>0&&(this.inputWidget.element.data("appendChar",""),this.inputWidget.element.data("nextChar",""),this.testEscapeChar(i,t)||(t=this.findEditPositionFrom(t,!0)),this.setChar(i,t),t++),this.inputWidget.element.data("skipNextChar")&&(n++,this.inputWidget.element.data("skipNextChar",!1))}}},s.prototype.testSetString=function(e,t,n){return e.length>this.testString.length&&(e=e.substring(0,this.testString.length)),this._testString(e,t,n)?(this.setString(e,t),!0):!1},s.prototype.isAllDecriptorUnAssigned=function(){for(var e=0;e=this.testString.length)return"";var h=this.testString.length-i;s=Math.min(s,h),o=!this.isPassword()||e,u=t&&n;if(o&&u)return this.testString.substring(i,s-i);var p="",d=i+s-1;for(var v=i;v<=d;v++){var m=this.testString.charAt(v),g=this.descriptors[v];switch(g.charType){case r.editOptional:case r.editRequired:if(!g.isAssigned)break;if(!this.isPassword()||e){p+=m;continue}p+=this.getPasswordChar();continue;case r.editRequired|r.editOptional:p+=m;continue;case r.separator:case r.literal:if(!n)continue;p+=m;continue;default:p+=m;continue}if(t){p+=m;continue}p+=" ";continue}return p},s.prototype.isEditDesc=function(e){return this.noMask?!0:e.charType===r.editRequired||e.charType===r.editOptional},s.prototype.isEditPos=function(e){if(this.noMask)return!0;if(e<0||e>=this.testString.length)return!1;var t=this.descriptors[e];return this.isEditDesc(t)},s.prototype.internalRemoveAt=function(e,n,r,i){typeof i=="undefined"&&(i=!1);if(this.noMask){try{this.testString=this.testString.substring(0,e)+this.testString.substring(n+1,this.testString.length),r.testPosition=e}catch(s){}return!0}var o=this.findAssignedEditPositionFrom(this.testString.length-1,!1),u=this.findEditPositionInRange(e,n,!0,0);r.hint=r.noEffect;if(u===-1||u>o)return r.testPosition=e,!0;r.testPosition=e,this.findAssignedEditPositionInRange(e,n,!0)!==-1&&(r.hint=r.success);if(nr.hint&&(r.hint=r.sideEffect);if(i)return!0;a=f,u=e,l=!0;while(l){l=!1;var m=this.testString.charAt(a),g=this.descriptors[a];m===this.getPromtChar()&&!g.isAssigned?this.resetChar(u):(this.setChar(m,u),this.resetChar(a));if(a!==o){a=this.findEditPositionFrom(a+1,!0),u=this.findEditPositionFrom(u+1,!0),l=!0;continue}}e=u+1}return e<=n&&this.resetString(e,n),!0},s.prototype.removeAt=function(e,n,r){return typeof n=="undefined"&&(n=e),typeof r=="undefined"&&(r=new t.wijInputResult),n>=this.testString.length?(r.testPosition=n,r.hint=r.positionOutOfRange,!1):e>=0&&e<=n?this.internalRemoveAt(e,n,r,!1):(r.testPosition=e,r.hint=r.positionOutOfRange,!1)},s.prototype._isLastCharAssigned=function(){var e=this.findEditPositionFrom(this.testString.length,!1);return e>=0&&e=0&&t0){var r=e[0],i=1,s=r;while(in&&this._toPrevField():i.start=0&&this._stringFormat.checkDigitsLimits(this.inputWidget.options.decimalPlaces),r},r.prototype._countSubstring=function(e,t){var n=0,r=e.indexOf(t);while(r!==-1)n++,r=e.indexOf(t,r+1);return n},r.prototype._getAdjustedPositionFromLeft=function(e){var t=this._stringFormat._strippedText,r,i;for(r=0;rm.length+v.length&&(r=m.length+v.length),r-=m.length,i||(i=new t.wijInputResult),this.setNullValue(!1);if(e.length===1){if(e==="+"){var y=this._stringFormat.isNegative();this._stringFormat.setPositiveSign(),this.checkAndRepairBounds(!0,!1);var b=y!==this._stringFormat.isNegative();return b?i.testPosition=g.length+r-1:i.testPosition=m.length+r-1,!0}if(e==="-"||e===")"||e==="("){var w=this._stringFormat.isNegative();return this._stringFormat.invertSign(),this.checkAndRepairBounds(!0,!1),this._stringFormat.isNegative()===w?(i.testPosition=m.length+r-1,!0):(i.testPosition=g.length+r-1,!0)}if(!n.wij.charValidator.isDigit(e)){if(e===this.getDecimalSeparator()){o=this._getDecimalSeparatorPos()+m.length;if(o>=0)return i.testPosition=o,!0}if(e!==this.getGroupSeparator()&&e!==this.getDecimalSeparator()&&e!==")"&&e!=="+"&&e!=="-"&&e!=="("&&e!==this.getDecimalSeparator())return this._type==="percent"&&e===s.percent.symbol?(i.testPosition=r,!0):this._type==="currency"&&e===this.inputWidget.options.currencySymbol?(i.testPosition=r,!0):!1}}r=this._getAdjustedPositionFromLeft(r),u=r,u>v.length&&(u=v.length-1),a=this._removeLeadingZero(v.substring(0,u)),f=v.substring(u,v.length),this._stringFormat.isZero()&&(f=f.replace(/0/,""));var E=e,S="";while(E.charAt(0)==="+"||E.charAt(0)==="-"||E.charAt(0)===")"||E.charAt(0)==="(")S=E.charAt(0),E=E.substring(1);E=E.replace(/[^0-9\.]/gi,"");var x=E.indexOf(".");if(x!==-1){var T=E.split("."),N,C;N=T.shift();var k=T;C=k.join(""),E=N+"."+C}else E=E;S==="+"&&(this._stringFormat.setPositiveSign(),this.checkAndRepairBounds(!0,!1));if(S==="-"||S===")"||S==="(")this._stringFormat.invertSign(),this.checkAndRepairBounds(!0,!1);i.testPosition=m.length+a.length+E.length-1,this._stringFormat.deFormatValue((this._stringFormat.isNegative()?"-":"")+a+E+f),l=this._stringFormat._strippedText;try{this.inputWidget.options.showGroup?(c=this._countSubstring(a,this._stringFormat._groupSeparator),h=this._countSubstring(l.substring(0,a.length+E.length),this._stringFormat._groupSeparator),i.testPosition+=h-c):E.length===1&&(p=a.charAt(a.length-1),d=l.charAt(a.length-1),d!==p&&i.testPosition--)}catch(L){}return!0},r.prototype.removeAt=function(e,n,r,i){typeof r=="undefined"&&(r=new t.wijInputResult),typeof i=="undefined"&&(i=!1);var s=this._getCulture().numberFormat,o,u,a,f,l,c;r.testPosition=e;try{o=this._stringFormat._currentText;if(e===n&&o.substring(e,n+1)===this.getDecimalSeparator())return!1;u=o.slice(0,e),a=u,f=o.slice(e,n+1).indexOf(this.getDecimalSeparator())>=0,f&&(a+=this.getDecimalSeparator()),a+=o.slice(n+1),a=a||"0",this._stringFormat.deFormatValue(a),a=this._stringFormat._currentText,this.setNullValue(!1);if(this.inputWidget.options.showGroup)if(f)r.testPosition=a.indexOf(this.getDecimalSeparator());else try{l=this._countSubstring(u,this._stringFormat._groupSeparator),c=this._countSubstring(a.substring(0,Math.max(0,e-1)),this._stringFormat._groupSeparator),r.testPosition-=l-c,(o.indexOf(this.inputWidget.options.currencySymbol)===r.testPosition||o.indexOf(s.percent.symbol)===r.testPosition)&&r.testPosition++}catch(h){}return!0}catch(p){}return!0},r.prototype.replaceWith=function(t,n){var r=!1;this._stringFormat.isNegative()&&n==="-"&&t.text.length===this._stringFormat._currentText.length&&(r=!0);var i=e.prototype.replaceWith.call(this,t,n);return r&&this.insertAt("-",this.inputWidget.element.wijtextselection().start,i),i},r.prototype.spinEnumPart=function(e,n,r,i){n||(n=new t.wijInputResult),r=parseInt(r.toString());var s=this.inputWidget._getPrefix(),o=this._stringFormat._currentText.indexOf(this._getCulture().numberFormat["."]),u=this._stringFormat._currentValueInString.replace("-",""),a=u.indexOf("."),f=!0;o===-1&&(f=!1,o=this._stringFormat._currentText.length),a===0?a=1:a===-1&&(a=o);var l=Math.pow(10,this.inputWidget.options.decimalPlaces);if(n.testPosition>o&&f){var c=r;r/=l,Math.abs(r)>=1&&(i?this._stringFormat.spinUp(parseInt(r),this._nullvalue):this._stringFormat.spinDown(parseInt(r),this._nullvalue),r=(c-parseInt(r)*l)/l)}i?this._stringFormat.spinUp(r,this._nullvalue):this._stringFormat.spinDown(r,this._nullvalue),this.setNullValue(!1);var h=this.inputWidget.options.allowSpinLoop;this.checkAndRepairBounds(!0,!1,h);var p=this._stringFormat._currentValueInString.replace("-",""),d=p.indexOf(".");d===-1&&(f=!1,d=p.length);var v=this.inputWidget._getPrefix();d!==a&&f?n.testPosition=n.testPosition-s.length+v.length+d-a:n.testPosition=n.testPosition-s.length+v.length},r.prototype.getValue=function(){return this._stringFormat.getJSFloatValue()},r.prototype.setValue=function(e){try{return e===null?(this.setNullValue(!0),e=this.inputWidget._initialValue):this.setNullValue(!1),this._stringFormat.setValueFromJSFloat(e),this.checkAndRepairBounds(!0,!1),!0}catch(t){return!1}},r.prototype.setNullValue=function(e){this._nullvalue=e},r}(t.wijTextProvider);t.wijNumberTextProvider=o;var u=function(){function e(e){this.inputWidget=e,this._currentValueInString="0",this._currentText="0",this._strippedText="0",this._groupSeparator=" "}return e.prototype._isNegtive=function(e){return e.indexOf("-")!==-1||e.indexOf("(")!==-1},e.prototype._stripValue=function(e){var t=this.inputWidget._getCulture().numberFormat,n=t[this.inputWidget.options.type]||t,r=this._isNegtive(e),i=n[","],s=n["."],o=new RegExp("["+i+t.percent.symbol+this.inputWidget.options.currencySymbol+" ]","g"),u;return this._groupSeparator=i,e=this._removeNegativeSign(e),e=e.replace(o,""),e=e.replace(s,"."),u=/([\d\.])+/.exec(e),u&&(e=u[0]),r&&(e="-"+e),e},e.prototype.tryParseValue=function(e){try{var t=parseFloat(this._stripValue(e));return isNaN(t)&&(t=null),t}catch(n){return null}},e.prototype.deFormatValue=function(e){e=this._stripValue(e),this._currentValueInString=e,this._currentText=this._formatValue(e)},e.prototype._formatValue=function(e){var t=this.inputWidget.options,n=this.inputWidget._getCulture().numberFormat,r=n[t.type]||n,i=t.decimalPlaces,s=r[","],o=r["."],u=i!==-2?i:r.decimals,a=t.showGroup?r.groupSizes:[0],f;return e=this._removeLeadingZero(e),f=this._formatDigit(e,s,o,u,a),f=this._removeLeadingZero(f,t.showGroup?s:""),f.indexOf(o)===0&&(f="0"+f),f===""&&(f="0"),this._currentValueInString=e,this._strippedText=f,this._currentText=this._getPrefix()+f+this._getSuffix(),this._currentText},e.prototype._getPrefix=function(){return this.isNegative()?this.inputWidget._userNegativePrefix!==undefined?this.inputWidget._userNegativePrefix.replace(/\$/g,this.inputWidget.options.currencySymbol):this.inputWidget.options.negativePrefix===null?"":this.inputWidget.options.negativePrefix.replace(/\$/g,this.inputWidget.options.currencySymbol):this.inputWidget._userPositivePrefix!==undefined?this.inputWidget._userPositivePrefix.replace(/\$/g,this.inputWidget.options.currencySymbol):this.inputWidget.options.positivePrefix===null?"":this.inputWidget.options.positivePrefix.replace(/\$/g,this.inputWidget.options.currencySymbol)},e.prototype._getSuffix=function(){return this.isNegative()?this.inputWidget._userNegativeSuffix!==undefined?this.inputWidget._userNegativeSuffix.replace(/\$/g,this.inputWidget.options.currencySymbol):this.inputWidget.options.negativeSuffix===null?"":this.inputWidget.options.negativeSuffix.replace(/\$/g,this.inputWidget.options.currencySymbol):this.inputWidget._userPositiveSuffix!==undefined?this.inputWidget._userPositiveSuffix.replace(/\$/g,this.inputWidget.options.currencySymbol):this.inputWidget.options.positiveSuffix===null?"":this.inputWidget.options.positiveSuffix.replace(/\$/g,this.inputWidget.options.currencySymbol)},e.prototype.getFormattedValue=function(){return!this.inputWidget._showNullText()&&this.inputWidget.isValueNull()&&(this._currentValueInString=this.inputWidget._initialValue+""),this._formatValue(this._currentValueInString)},e.prototype.getJSFloatValue=function(){try{return this._currentValueInString===""||this._currentValueInString==="."?0:parseFloat(this._currentValueInString)}catch(e){return Number.NaN}},e.prototype.clear=function(){this._currentValueInString="0",this._currentText="0",this._strippedText="0"},e.prototype.setValueFromJSFloat=function(e){var t=e.toFixed(this.inputWidget.options.decimalPlaces+1);try{return this._currentValueInString=t,this._formatValue(t),!0}catch(n){return!1}},e.prototype.isZero=function(e){typeof e=="undefined"&&(e=this._currentValueInString);var t=this._removeNegativeSign(e),n;return t?(n=parseFloat(t),!isNaN(n)&&!n):!0},e.prototype.setPositiveSign=function(){this._currentValueInString=this._removeNegativeSign(this._currentValueInString)},e.prototype._removeNegativeSign=function(e){return e.replace(/[()\-]/g,"")},e.prototype._removeLeadingZero=function(e,t){typeof t=="undefined"&&(t="");var e=e.replace(/^0+/,"");while(t.length>0&&e.indexOf(t)===0){e=e.substr(t.length);var e=e.replace(/^0+/,"")}return e},e.prototype.isNegative=function(){return this._currentValueInString.indexOf("-")!==-1||this._currentValueInString.indexOf("(")!==-1},e.prototype.invertSign=function(){var e=this.isNegative();e?this.setPositiveSign():this._currentValueInString=this._currentValueInString.length?"-"+this._currentValueInString:"0",this.isZero()&&(this._currentValueInString=e?"0":"-0"),this._formatValue(this._currentValueInString)},e.prototype._parseNumber=function(e){typeof e=="undefined"&&(e=this._currentValueInString);var t=e.split(".",2),n={integer:parseInt(t[0],10)||0,fraction:(t.length>1?parseInt(t[1],10):0)||0,isNegative:t[0].indexOf("-")!==-1};return n.integer===0&&n.fraction===0&&(n.isNegative=!1),n},e.prototype._doSpin=function(e,t){var n=this._parseNumber(),r=e>=0?1:-1,i=Math.abs(e)>=1?"integer":"decimal",s=this.inputWidget.options.increment;s>=Math.pow(10,this.inputWidget.options.decimalPlaces)&&(i==="integer"?s=Math.abs(e):s=Math.abs(e)*Math.pow(10,this.inputWidget.options.decimalPlaces));var o=r*s,u="",a,f,l=n.integer,c=n.fraction;if(i==="integer")l=n.integer+o,l<0&&(u="-",l=-l);else if(i==="decimal"){var h=n.isNegative?-n.fraction:n.fraction;l=n.integer,h<0?(c=-Math.abs(h+o),h*(h+o)<0&&(l=Math.abs(l),u="-")):c=h+o,h===0&&n.isNegative&&(c=-Math.abs(c),u="-",r===1&&(l=Math.abs(l))),c<=0&&(l>0?(l-=1,c=Math.pow(10,this.inputWidget.options.decimalPlaces)+c):(l=Math.abs(n.integer),c=Math.abs(c),u="-"))}a=l.toString(),f=c.toString(),parseInt(this.inputWidget.options.decimalPlaces)>0&&f.length>parseInt(this.inputWidget.options.decimalPlaces)&&(l++,f=f.substring(1),a=l.toString());while(f.length=0?this._currentValueInString=this.inputWidget.options.minValue.toString():this._currentValueInString=this.inputWidget.options.maxValue.toString():this._currentValueInString=u+a+"."+f},e.prototype.spinUp=function(e,t){if(e===null||e===undefined)e=1;this._doSpin(e,t)},e.prototype.spinDown=function(e,t){if(e===null||e===undefined)e=1;this._doSpin(-e,t)},e.prototype.checkDigitsLimits=function(e){var t=this._currentValueInString.split("."),n="";if(!t.length||t.length===1&&t[0]==="")return;t.length>1&&(n=t[1]),n=n.substring(0,e);while(n.length1&&parseFloat(i[1])>=0&&(o=parseFloat("1."+i[1]));if(s<0||i[0]==="-"||i[0].length>0&&i[0][0]==="-")o*=-1;e=""+e.toFixed(12)+"",i=e.split("."),u=parseFloat(i[0]===""||i[0]==="-"?"0":i[0]),a=0,i.length>1&&parseFloat(i[1])>=0&&(a=parseFloat("1."+i[1]));if(u<0||i[0]==="-"||i[0].length>0&&i[0][0]==="-")a*=-1;if(s>u)return!0;s=0&&o1&&parseFloat(r[1])>=0&&(s=parseFloat("1."+r[1]));if(i<0||r[0]==="-"||r[0].length>0&&r[0][0]==="-")s*=-1;e=""+e.toFixed(12)+"",r=e.split("."),o=parseFloat(r[0]===""||r[0]==="-"?"0":r[0]),u=0,r.length>1&&parseFloat(r[1])>=0&&(u=parseFloat("1."+r[1]));if(o<0||r[0]==="-"||r[0].length>0&&r[0][0]==="-")u*=-1;if(io&&(n=!1),i===o&&i>=0&&s>u&&(n=!1),i===o&&i<0&&s>u&&(n=!1),!n&&t&&(this._currentValueInString=""+e+"")}catch(a){}return n},e.prototype._formatDigit=function(e,t,n,r,i){var s=this._removeNegativeSign(e),o,u,a,f,l,c;o=s.indexOf("."),o===-1&&(o=s.length),u="",a=0,f=0;for(c=s.length-1;c>=0;c--)l=s.charAt(c),ca&&a++));if(r>0){u+=n;for(c=0;c div",this.element),n.each(this.panels,function(e,t){var i=n(t).attr("src");i&&!r.test(i)&&n.data(t,"load.wijwizard",i.replace(/#.*$/,""))}),this.element.addClass(t.wijCSS.wijwizard).addClass(t.wijCSS.widget).addClass(t.wijCSS.helperClearFix),this.list&&(this.list.addClass(t.wijCSS.widget).addClass(t.wijCSS.helperReset).addClass(t.wijCSS.wijwizardSteps).addClass(t.wijCSS.helperClearFix).attr("role","tablist"),this.lis.addClass(t.wijCSS.header).addClass(t.wijCSS.cornerAll).attr("role","tab")),this.container=n("
"),this.container.addClass(t.wijCSS.wijwizardContent).addClass(t.wijCSS.widget).addClass(t.wijCSS.content).addClass(t.wijCSS.cornerAll),this.container.append(this.panels),this.container.appendTo(this.element),this.panels.addClass(t.wijCSS.wijwizardPanel).addClass(t.wijCSS.content).attr("role","tabpanel"),t.activeIndex===undefined?(typeof t.activeIndex!="number"&&t.cookie&&(t.activeIndex=parseInt(this._cookie(undefined,undefined),10)),typeof t.activeIndex!="number"&&this.panels.filter("."+t.wijCSS.wijwizardActived).length&&(t.activeIndex=this.panels.index(this.panels.filter("."+t.wijCSS.wijwizardActived))),t.activeIndex=t.activeIndex||(this.panels.length?0:-1)):t.activeIndex===null&&(t.activeIndex=-1),t.activeIndex=t.activeIndex>=0&&this.panels[t.activeIndex]||t.activeIndex<0?t.activeIndex:0,this.panels.addClass(t.wijCSS.wijwizardHide).attr("aria-hidden",!0),t.activeIndex>=0&&this.panels.length&&(this.panels.eq(t.activeIndex).removeClass(t.wijCSS.wijwizardHide).addClass(t.wijCSS.wijwizardActived).attr("aria-hidden",!1),this.load(t.activeIndex)),this._createButtons(),this._addScrollForContent()):(this.panels=n("> div",this.container),t.activeIndex=this.panels.index(this.panels.filter("."+t.wijCSS.wijwizardActived))),this._refreshStep(),this._initScroller(),t.cookie&&this._cookie(t.activeIndex,t.cookie),t.cache===!1&&this.panels.removeData("cache.wijwizard");if(t.showOption===undefined||t.showOption===null)t.showOption={};this._normalizeBlindOption(t.showOption);if(t.hideOption===undefined||t.hideOption===null)t.hideOption={};this._normalizeBlindOption(t.hideOption),this.panels.unbind(".wijwizard")},t.prototype._removeButtons=function(){this.buttons&&(this.buttons.remove(),this.buttons=undefined)},t.prototype._createButtons=function(){var e=this,t=this,r=this.options,i,s,o,u=r.backBtnText,a=r.nextBtnText;this._removeButtons();if(r.navButtons==="none")return;this.buttons||(i=r.navButtons,i==="auto"&&(i=this.list?"common":"edge"),this.buttons=n("
"),this.buttons.addClass(r.wijCSS.wijwizardButtons),s=function(e,t){if(r.disabled)return;t.is(":not(."+r.wijCSS.stateDisabled+")")&&t.addClass(e)},o=function(e,t){if(r.disabled)return;t.removeClass(e)},i==="common"?(this.backBtn=n(""+u+" ").addClass(r.wijCSS.widget).addClass(r.wijCSS.stateDefault).addClass(r.wijCSS.cornerAll).addClass(r.wijCSS.button).addClass(r.wijCSS.buttonTextOnly).appendTo(this.buttons).bind({click:function(){return e.back(),!1},mouseover:function(){s(r.wijCSS.stateHover,n(this))},mouseout:function(){o(r.wijCSS.stateHover,n(this))},mousedown:function(){s(r.wijCSS.stateActive,n(this))},mouseup:function(){o(r.wijCSS.stateActive,n(this))}}).attr("role","button"),this.nextBtn=n(""+a+" ").addClass(r.wijCSS.widget).addClass(r.wijCSS.stateDefault).addClass(r.wijCSS.cornerAll).addClass(r.wijCSS.button).addClass(r.wijCSS.buttonTextOnly).appendTo(this.buttons).bind({click:function(){return t.next(),!1},mouseover:function(){s(r.wijCSS.stateHover,n(this))},mouseout:function(){o(r.wijCSS.stateHover,n(this))},mousedown:function(){s(r.wijCSS.stateActive,n(this))},mouseup:function(){o(r.wijCSS.stateActive,n(this))}}).attr("role","button")):(this.backBtn=n(" ").addClass(r.wijCSS.wijwizardPrev).addClass(r.wijCSS.stateDefault).addClass(r.wijCSS.cornerRight).append(" ").appendTo(this.buttons).bind({click:function(){return t.back(),!1},mouseover:function(){s(r.wijCSS.stateHover,n(this))},mouseout:function(){o(r.wijCSS.stateHover,n(this))},mousedown:function(){s(r.wijCSS.stateActive,n(this))},mouseup:function(){o(r.wijCSS.stateActive,n(this))}}).attr("role","button"),this.nextBtn=n(" ").addClass(r.wijCSS.wijwizardNext).addClass(r.wijCSS.stateDefault).addClass(r.wijCSS.cornerLeft).append(" ").appendTo(this.buttons).bind({click:function(){return t.next(),!1},mouseover:function(){s(r.wijCSS.stateHover,n(this))},mouseout:function(){o(r.wijCSS.stateHover,n(this))},mousedown:function(){s(r.wijCSS.stateActive,n(this))},mouseup:function(){o(r.wijCSS.stateActive,n(this))}}).attr("role","button")),this.buttons.appendTo(this.element))},t.prototype._refreshStep=function(){var e=this.options;this.lis&&(this.lis.removeClass(e.wijCSS.priorityPrimary).addClass(e.wijCSS.prioritySecondary).attr("aria-selected",!1),e.activeIndex>=0&&e.activeIndex<=this.lis.length-1&&(this.lis&&this.lis.eq(e.activeIndex).removeClass(e.wijCSS.prioritySecondary).addClass(e.wijCSS.priorityPrimary).attr("aria-selected",!0),this.scrollWrap&&this.scrollWrap.wijsuperpanel("scrollChildIntoView",this.lis.eq(e.activeIndex)))),this.buttons&&!e.loop&&(this.backBtn[e.activeIndex<=0?"addClass":"removeClass"](e.wijCSS.stateDisabled).attr("aria-disabled",e.activeIndex===0),this.nextBtn[e.activeIndex>=this.panels.length-1?"addClass":"removeClass"](e.wijCSS.stateDisabled).attr("aria-disabled",e.activeIndex>=this.panels.length-1))},t.prototype._initScroller=function(){if(!this.lis)return;var e=0;n.each(this.lis,function(){e+=n(this).outerWidth(!0)}),this.element.innerWidth()"),this.scrollWrap=this.list.parent(),n.effects&&n.effects.save?n.effects.save(this.list,["width","height","overflow"]):n.save&&n.save(this.list,["width","height","overflow"])),this.list.width(e+8),this.scrollWrap.height(this.list.outerHeight(!0)),this.scrollWrap.wijsuperpanel({allowResize:!1,hScroller:{scrollBarVisibility:"hidden"},vScroller:{scrollBarVisibility:"hidden"}})):this._removeScroller()},t.prototype._removeScroller=function(){this.scrollWrap&&(this.scrollWrap.wijsuperpanel("destroy").replaceWith(this.scrollWrap.contents()),this.scrollWrap=undefined,n.effects&&n.effects.restore?n.effects.restore(this.list,["width","height","overflow"]):n.restore&&n.restore(this.list,["width","height","overflow"]))},t.prototype._cookie=function(e,t){var r=this.cookie||(this.cookie=this.options.cookie.name);return n.cookie.apply(null,[r].concat(n.makeArray(arguments)))},t.prototype._normalizeBlindOption=function(e){e.blind===undefined&&(e.blind=!1),e.fade===undefined&&(e.fade=!1),e.duration===undefined&&(e.duration=200);if(typeof e.duration=="string")try{e.duration=parseInt(e.duration,10)}catch(t){e.duration=200}},t.prototype._ui=function(e){return{panel:e,index:this.panels.index(e)}},t.prototype._removeSpinner=function(){this.element.removeClass(this.options.wijCSS.tabsLoading);var e=this.element.data("spinner.wijwizard");e&&(this.element.removeData("spinner.wijwizard"),e.remove())},t.prototype._showPanel=function(e){var t=this,r=this.options,i=n(e),s;i.addClass(r.wijCSS.wijwizardActived),(r.showOption.blind||r.showOption.fade)&&r.showOption.duration>0?(s={duration:r.showOption.duration},r.showOption.blind&&(s.height="toggle"),r.showOption.fade&&(s.opacity="toggle"),i.hide().removeClass(r.wijCSS.wijwizardHide).animate(s,r.showOption.duration||"normal","linear",function(){t._resetStyle(i),i.wijTriggerVisibility&&i.wijTriggerVisibility(),t._trigger("show",null,t._ui(i[0])),t._removeSpinner(),i.attr("aria-hidden",!1),t._trigger("activeIndexChanged",null,t._ui(i[0]))})):(i.removeClass(r.wijCSS.wijwizardHide).attr("aria-hidden",!1),i.wijTriggerVisibility&&i.wijTriggerVisibility(),this._trigger("show",null,this._ui(i[0])),this._removeSpinner(),this._trigger("activeIndexChanged",null,this._ui(i[0])))},t.prototype._hidePanel=function(e){var t=this,r=this,i=this.options,s=n(e),o;s.removeClass(i.wijCSS.wijwizardActived),(i.hideOption.blind||i.hideOption.fade)&&i.hideOption.duration>0?(o={duration:i.hideOption.duration},i.hideOption.blind&&(o.height="toggle"),i.hideOption.fade&&(o.opacity="toggle"),s.animate(o,i.hideOption.duration||"normal","linear",function(){s.addClass(i.wijCSS.wijwizardHide).attr("aria-hidden",!0),t._resetStyle(s),t.element.dequeue("wijwizard")})):(s.addClass(i.wijCSS.wijwizardHide).attr("aria-hidden",!0),this.element.dequeue("wijwizard"))},t.prototype._resetStyle=function(e){e.css({display:""}),n.support.opacity||e[0].style.removeAttribute("filter")},t.prototype._addScrollForContent=function(){var e=this,t=e.element.height();e.buttons&&(t-=e.buttons.outerHeight(!0)),e.list&&(t-=e.list.outerHeight(!0)),t-=e.container.outerHeight(!0)-e.container.innerHeight()-(e.container.innerHeight()-e.container.height()),t=this.panels.length?this.panels.length>0?o.insertAfter(this.panels[this.panels.length-1]):o.appendTo(this.container):o.insertBefore(this.panels[e]),this.list&&this.lis&&(u=n((s.stepHeaderTemplate||i._defaults.stepHeaderTemplate).replace(/#\{title\}/g,t).replace(/#\{desc\}/g,r)),u.addClass(s.wijCSS.header).addClass(s.wijCSS.cornerAll).addClass(s.wijCSS.prioritySecondary).data("destroy.wijwizard",!0),e>=this.lis.length?u.appendTo(this.list):u.insertBefore(this.lis[e])),this._pageLize(!1),this.panels.length===1&&(s.activeIndex=0,u.addClass(s.wijCSS.priorityPrimary),o.removeClass(s.wijCSS.wijwizardHide).addClass(s.wijCSS.wijwizardActived).attr("aria-hidden",!1),this.element.queue("wijwizard",function(){i._trigger("show",null,i._ui(i.panels[0]))}),this._refreshStep(),this.load(0)),this._trigger("add",null,this._ui(this.panels[e])),this},t.prototype.remove=function(e){var t=this.options,n=this.panels.eq(e).remove();return this.lis.eq(e).remove(),e=1&&this.show(e+(e=this.panels.length)return this;if(this.element.queue("wijwizard").length>0)return this;var r=this.options,i={nextIndex:0,nextPanel:null},s,o;n.extend(i,this._ui(this.panels[r.activeIndex])),i.nextIndex=e,i.nextPanel=this.panels[e];if(this._trigger("validating",null,i)===!1)return this;s=this.panels.filter(":not(."+r.wijCSS.wijwizardHide+")"),o=this.panels.eq(e),r.activeIndex=e,this.abort(),r.cookie&&this._cookie(r.activeIndex,r.cookie),this._refreshStep();if(!o.length)throw"jQuery UI wijwizard: Mismatching fragment identifier.";return s.length&&this.element.queue("wijwizard",function(){t._hidePanel(s)}),this.element.queue("wijwizard",function(){t._showPanel(o)}),this.load(e),this},t.prototype.next=function(){var e=this.options,t=e.activeIndex+1;return e.disabled?!1:(e.loop&&(t%=this.panels.length),t=0?(this.show(t),!0):!1)},t.prototype.load=function(e){var t=this,r=t.options,i=t.panels.eq(e)[0],s=n.data(i,"load.wijwizard"),o;t.abort();if(!s||t.element.queue("wijwizard").length!==0&&n.data(i,"cache.wijwizard")){t.element.dequeue("wijwizard");return}return this.element.addClass(r.wijCSS.tabsLoading),r.spinner&&(o=this.element.data("spinner.wijwizard"),o||(o=n("
"),o.addClass(r.wijCSS.wijwizardSpinner),o.html(r.spinner||t._defaults.spinner),o.appendTo(document.body),this.element.data("spinner.wijwizard",o),o.wijpopup({showEffect:"blind",hideEffect:"blind"})),o.wijpopup("show",{of:this.element,my:"center center",at:"center center"})),this.xhr=n.ajax(n.extend({},r.ajaxOptions,{url:s,dataType:"html",success:function(s,o){n(i).html(s),r.cache&&n.data(i,"cache.wijwizard",!0),t._trigger("load",null,t._ui(t.panels[e]));try{r.ajaxOptions&&r.ajaxOptions.success&&r.ajaxOptions.success(s,o)}catch(u){}},error:function(n,s,o){t._trigger("load",null,t._ui(t.panels[e]));try{r.ajaxOptions&&r.ajaxOptions.error&&r.ajaxOptions.error(n,s,e,i)}catch(u){}}})),t.element.dequeue("wijwizard"),t},t.prototype.abort=function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("wijwizard",this.element.queue("wijwizard").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._removeSpinner(),this},t.prototype.url=function(e,t){return this.panels.eq(e).removeData("cache.wijwizard").data("load.wijwizard",t),this},t.prototype.count=function(){return this.panels.length},t.prototype.stop=function(){var e=this.element.data("intId.wijwizard");e&&(window.clearInterval(e),this.element.removeData("intId.wijwizard"))},t.prototype.play=function(){var e=this,t=this.options,n,r=this.panels.length;this.element.data("intId.wijwizard")||(n=window.setInterval(function(){var n=t.activeIndex+1;if(n>=r){if(!t.loop){e.stop();return}n=0}e.show(n)},t.delay),this.element.data("intId.wijwizard",n))},t}(e.wijmoWidget);t.wijwizard=r,r.prototype._defaults={stepHeaderTemplate:"#{title} #{desc} ",panelTemplate:"
",spinner:"Loading… "};var i=function(){function e(){this.wijCSS={wijwizard:"wijmo-wijwizard",wijwizardButtons:"wijmo-wijwizard-buttons",wijwizardPrev:"wijmo-wijwizard-prev",wijwizardNext:"wijmo-wijwizard-next",wijwizardSteps:"wijmo-wijwizard-steps",wijwizardContent:"wijmo-wijwizard-content",wijwizardPanel:"wijmo-wijwizard-panel",wijwizardActived:"wijmo-wijwizard-actived",wijwizardHide:"wijmo-wijwizard-hide",wijwizardSpinner:"wijmo-wijwizard-spinner"},this.wijMobileCSS={header:"ui-header ui-bar-a",content:"ui-body-c",stateDefault:"ui-btn-up-a",stateHover:"ui-btn-down-a",stateActive:"ui-btn-down-a"},this.navButtons="auto",this.autoPlay=!1,this.delay=3e3,this.loop=!1,this.hideOption={fade:!0},this.showOption={fade:!0,duration:400},this.ajaxOptions=null,this.cache=!1,this.cookie=null,this.stepHeaderTemplate="",this.panelTemplate="",this.spinner="",this.backBtnText="back",this.nextBtnText="next",this.add=null,this.remove=null,this.activeIndexChanged=null,this.show=null,this.load=null,this.validating=null}return e}();r.prototype.options=n.extend(!0,{},e.wijmoWidget.prototype.options,new i),n.wijmo.registerWidget("wijwizard",r.prototype)})(e.wizard||(e.wizard={}));var t=e.wizard})(wijmo||(wijmo={}));;
var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(e){(function(t){var n=this;"use strict";var r=jQuery,i=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype._setOption=function(t,n){var i=this.options,s=r("."+i.wijCSS.wijratingResetButton,this.ratingElement[0]),o=r("."+i.wijCSS.wijratingStarContainer,this.ratingElement[0]),u=r("."+i.wijCSS.wijratingNormalStar,this.ratingElement[0]);if(r.isPlainObject(i[t])){switch(t){case"resetButton":typeof n.disabled!="undefined"&&n.disabled!==i[t].disabled&&(n.disabled?(s.hide(),s.attr("aria-hidden",!0)):i.disabled||(s.show(),s.attr("aria-hidden",!1))),typeof n.hint!="undefined"&&n.hint!==i[t].hint&&(n.hint===null?s.attr("title",""):s.attr("title",n.hint)),n.position&&n.position.length&&n.position!==i[t].position&&(n.position==="rightOrBottom"?s.parent().append(s):s.parent().prepend(s)),typeof n.customizedClass!="undefined"&&n.customizedClass!==i[t].customizedClass&&(i[t].customizedClass.length&&s.removeClass(i[t].customizedClass),n.customizedClass.length&&s.addClass(n.customizedClass));break;case"hint":typeof n.disabled!="undefined"&&n.disabled!==i[t].disabled&&(n.disabled?u.removeAttr("title"):this._resetHint(i.hint.content)),typeof n.content!="undefined"&&n.content!==i[t].content&&(i[t].disabled||this._resetHint(n.content));break;case"icons":typeof n.iconsClass!="undefined"&&(i[t].iconsClass&&i[t].iconsClass.length&&this._removeCustomizedIconsClass(i[t].iconsClass),this._addCustomizedIconsClass(n.iconsClass,i.split)),typeof n.hoverIconsClass!="undefined"&&i[t].hoverIconsClass&&i[t].hoverIconsClass.length&&this._removeCustomizedIconsClass(i[t].hoverIconsClass),typeof n.ratedIconsClass!="undefined"&&(i[t].ratedIconsClass&&i[t].ratedIconsClass.length&&this._removeCustomizedIconsClass(i[t].ratedIconsClass),this._resetValue(i.value,i.ratingMode,n.ratedIconsClass));break;default:}r.extend(!0,i[t],n)}else{if(n===i[t])return;switch(t){case"disabled":n?(this._unbindLiveEvents(),s.hide(),s.attr("aria-hidden",!0)):(this._bindLiveEvents(),i.resetButton.disabled||(s.show(),s.attr("aria-hidden",!1)));break;case"count":this._createStars(i.split,n,o);break;case"split":this._createStars(n,i.count,o);break;case"totalValue":this._resetTotalValue(n);break;case"orientation":n==="vertical"?this.ratingElement.addClass(i.wijCSS.wijvRating):this.ratingElement.removeClass(i.wijCSS.wijvRating),i.split>1&&(i[t]=n,this._createStars(i.split,i.count,o));break;case"direction":i[t]=n,this._createStars(i.split,i.count,o);break;case"ratingMode":this._resetValue(i.value,n,i.icons.ratedIconsClass);break;case"value":if(i.min&&ni.max)return;this._resetValue(n,i.ratingMode,i.icons.ratedIconsClass);break;case"iconWidth":i[t]=n,this._createStars(i.split,i.count,o);break;case"iconHeight":i[t]=n,this._createStars(i.split,i.count,o);break;default:}e.prototype._setOption.call(this,t,n)}},t.prototype._create=function(){var t=this.options,n;if(this.element.is("select"))this._parseSelect(),this.element.hide(),n=r("
"),this.element.after(n);else{if(!this.element.is("div"))return;this.element.children("input[type='radio']").length>0?(this._parseRadio(),this.element.hide(),n=r("
"),this.element.after(n)):n=this.element}this.ratingElement=n,this._createRating(),t.disabled||this._bindLiveEvents(),e.prototype._create.call(this)},t.prototype.destroy=function(){var t=this.options;this._unbindLiveEvents(),this.element!==this.ratingElement?(this.ratingElement.remove(),this.element.show()):this.element.removeClass(t.wijCSS.widget).removeClass(t.wijCSS.wijrating).removeClass(t.wijCSS.wijvRating).empty(),e.prototype.destroy.call(this)},t.prototype._unbindLiveEvents=function(){var e=this.options;this.ratingElement.off(".wijrating","."+e.wijCSS.wijratingNormalStar).off(".wijrating","."+e.wijCSS.wijratingResetButton)},t.prototype._bindLiveEvents=function(){var e=this,t=e.options,n="."+t.wijCSS.wijratingNormalStar,i="."+t.wijCSS.wijratingResetButton,s,o={element:e.ratingElement,mouseover:function(i){var o=r(i.target),u=r(n,e.ratingElement[0]);o.is(n)&&(u.removeClass(t.wijCSS.wijratingHoverStar),o.addClass(t.wijCSS.wijratingHoverStar),t.ratingMode==="continuous"&&(t.direction==="reversed"?o.parent().nextAll().children().addClass(t.wijCSS.wijratingHoverStar):o.parent().prevAll().children().addClass(t.wijCSS.wijratingHoverStar)),e._addCustomizedHoverIconsClass(t.icons.hoverIconsClass,t.split,o),s={value:parseFloat(o.html()),target:o},e._trigger("hover",i,s))},mouseout:function(i){var s=r(i.target),o=r(n,e.ratingElement[0]);s.is(n)&&(o.removeClass(t.wijCSS.wijratingHoverStar),e._removeCustomizedIconsClass(t.icons.hoverIconsClass))},click:function(i){var o=r(i.target),u=parseFloat(o.html()),a=r(n,e.ratingElement[0]),f={duration:500,easing:null,delay:250,animated:null},l=r.wijmo.wijrating.animations,c;r.extend(!0,f,t.animation),c=f.animated;if(!o.is(n))return;if(t.max&&u>t.max)return;if(t.min&&u").addClass(t.wijCSS.wijratingResetButton).addClass(t.wijCSS.cornerAll).addClass(t.wijCSS.stateDefault),t.resetButton.customizedClass&&t.resetButton.customizedClass.length&&n.addClass(t.resetButton.customizedClass),n.appendTo(e),n.attr("role","button").attr("aria-label","reset").attr("aria-hidden",!1),t.resetButton.hint&&t.resetButton.hint.length&&n.attr("title",t.resetButton.hint);if(t.resetButton.disabled||t.disabled)n.hide(),n.attr("aria-hidden",!0);i=r(" "),i.addClass(t.wijCSS.icon).addClass(t.wijCSS.iconClose),n.append(i),s=r("
"),s.attr("role","radiogroup").addClass(t.wijCSS.wijratingStarContainer),t.resetButton.position==="leftOrTop"?s.appendTo(e):s.prependTo(e),this._createStars(t.split,t.count,s)},t.prototype._createStars=function(e,t,n){var i=this.options,s=i.hint,o,u,a,f=0,l=0,c=0,h=Math.ceil(i.iconWidth/e),p=Math.ceil(i.iconHeight/e),d=i.icons.ratedIconsClass,v,m,g=d&&d.length;n.empty();for(l;l"),u.attr("role","radio").attr("aria-checked",!1),i.orientation==="vertical"?u.width(i.iconWidth).height(p):u.width(h).height(i.iconHeight),u.addClass(i.wijCSS.wijratingStar),o=r(""+a+"
"),o.addClass(i.wijCSS.wijratingNormalStar).width(i.iconWidth).height(i.iconHeight),u.attr("aria-label",a),c>0&&i.direction==="normal"?i.orientation==="vertical"?o.css({"margin-top":"-"+c*p+"px"}):o.css({"margin-left":"-"+c*h+"px"}):cv&&(m=d[v]))),a===i.value||f>i.value&&aa&&(f=n[a]))),h===e||p>e&&h=i&&n[i]&&n[i].length?a.attr("title",n[i]):a.attr("title",f)})},t.prototype._resetHint=function(e){var t=this.options,n=r("."+t.wijCSS.wijratingNormalStar,this.ratingElement[0]);r.each(n,function(t,n){var i=r(n),s=parseFloat(i.html());e&&e.length&&e.length>=t&&e[t]&&e[t].length?i.attr("title",e[t]):i.attr("title",s)})},t.prototype._clearIntentTimer=function(){this.intentTimers&&this.intentTimers.length&&r.each(this.intentTimers,function(e,t){t&&(window.clearTimeout(t),t=null)}),this.intentTimers=[]},t.prototype._playJqueryAnimation=function(e,t,n){var i=this,s=this,o=s.options,u={easing:e.easing},a=e.animated;s._clearIntentTimer(),r.each(t,function(f,l){var c=Math.floor(f/o.split)*e.delay,h;h=window.setTimeout(function(){r(l).hide(a,u,e.duration,function(){if(f!==t.length-1)return;r.each(t,function(f,l){var c=Math.floor(f/o.split)*e.delay,h;h=window.setTimeout(function(){r(l).show(a,u,e.duration,function(){f===t.length-1&&n&&r.isFunction(n)&&n.call(i)})},c),s.intentTimers.push(h)})})},c),s.intentTimers.push(h)})},t.prototype._addCustomizedIconsClass=function(e,t){var n=this,i=n.options,s,o=0,u=0;e&&e.length&&(s=r("."+i.wijCSS.wijratingNormalStar,n.ratingElement[0]),r.each(s,function(i,s){o===t&&(o=0,u++);if(typeof e=="string")r(s).addClass(e);else if(r.isArray(e)){var a=e.length;uf&&n.addClass(e[f]);else if(s==="reversed")for(l=u.length-1;l>=a;l--)f=Math.floor((u.length-1-l)/t),e.length>f&&r(u[l]).addClass(e[f]);else for(l=0;l<=a;l++)f=Math.floor(l/t),e.length>f&&r(u[l]).addClass(e[f])},t.prototype._removeCustomizedIconsClass=function(e){var t=this.options,n=r("."+t.wijCSS.wijratingNormalStar,this.ratingElement[0]);e&&e.length&&(typeof e=="string"?n.removeClass(e):r.isArray(e)&&r.each(e,function(e,t){n.removeClass(t)}))},t.prototype._parseSelect=function(){var e=this.options,t=[],n=r("option",this.element);n.length&&(e.count=n.length,e.totalValue=n.length,r.each(n,function(n,i){var s=r(i);t.push(s.html()),s.is(":selected")&&(e.value=n+1)}),e.hint.content=t)},t.prototype._parseRadio=function(){var e=this,t=e.options,n=[],i=r("input[type='radio']",e.element);i.length&&(t.count=i.length,t.totalValue=i.length,r.each(i,function(i,s){var u=r(s),a=u.attr("id"),f;a&&a.length>0?(f=r("label[for='"+a+"']",e.element),f.length?n.push(f.html()):n.push("")):n.push(""),u.is(":checked")&&(t.value=i+1)}),t.hint.content=n)},t}(e.wijmoWidget);t.wijrating=i;var s=function(){function e(){this.wijCSS={wijrating:"wijmo-wijrating",wijratingStarContainer:"wijmo-wijrating-starcontainer",wijratingResetButton:"wijmo-wijrating-reset",wijratingHoverResetButton:"wijmo-wijrating-resethover",wijratingStar:"wijmo-wijrating-star",wijratingNormalStar:"wijmo-wijrating-normal",wijratingHoverStar:"wijmo-wijrating-hover",wijratingRatedStar:"wijmo-wijrating-rated",wijvRating:"wijmo-wijrating-vertical"},this.wijMobileCSS={iconClose:"ui-icon-delete"},this.disabled=!1,this.count=5,this.split=1,this.totalValue=5,this.value=0,this.min=null,this.max=null,this.resetButton={disabled:!1,hint:"cancel this rating!",position:"leftOrTop",customizedClass:"",customizedHoverClass:""},this.hint={disabled:!1,content:null},this.orientation="horizontal",this.direction="normal",this.ratingMode="continuous",this.icons={iconsClass:null,hoverIconsClass:null,ratedIconsClass:null},this.iconWidth=16,this.iconHeight=16,this.animation=null,this.rating=null,this.rated=null,this.reset=null,this.hover=null}return e}();i.prototype.options=r.extend(!0,{},e.wijmoWidget.prototype.options,new s),r.wijmo.registerWidget("wijrating",i.prototype),r.mobile&&(r.mobile.selectmenu.prototype.options.initSelector=r.mobile.selectmenu.prototype.options.initSelector+":not( :jqmData(role='wijrating') )"),r.extend(r.wijmo.wijrating,{animations:{scroll:function(e,t,i){var s=e,o=i,u=250,a=500,f="linear",l=250,c=jQuery.makeArray(t);c.reverse(),r.each(c,function(e,n){var i=Math.floor(e/s.split)*l,c={width:0},h,p;h=window.setTimeout(function(){r(n).animate(c,u,f,function(){window.clearTimeout(h);if(e!==t.length-1)return;p=window.setTimeout(function(){r.each(t,function(e,n){var i=Math.floor(e/s.split)*l,a={width:s.iconWidth},c;c=window.setTimeout(function(){var i=this;r(n).animate(a,u,f,function(){window.clearTimeout(c),e===t.length-1&&o&&r.isFunction(o)&&o.call(i)})},i)}),window.clearTimeout(p)},a)})},i)}),i&&r.isFunction(i)&&i.call(n)}}})})(e.rating||(e.rating={}));var t=e.rating})(wijmo||(wijmo={}));;
var __extends=this.__extends||function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n},wijmo;(function(e){(function(t){"use strict";function i(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function s(){var e,t,n;e="";for(n=0;n<32;n+=1){if(n===8||n===12||n===16||n===20)e+="-";t=Math.floor(Math.random()*16).toString(16).toUpperCase(),e+=t}return e}function c(e,t,n){f?(l=amplify.store("wijevcal_tables1"),l||(l={}),l[e]||(l[e]={fields:t},amplify.store("wijevcal_tables1",l),amplify.store("wijevcal_tbl_"+e,{})),n&&n()):o&&o.transaction(function(r){r.executeSql("SELECT COUNT(*) FROM "+e,[],function(){n&&n()},function(r,i){r.executeSql("CREATE TABLE "+e+" "+t,[],n,n)})})}function h(e,t,n,r){var i={rowsAffected:0,rows:new Array},s,u,a,c,h,p,d,v,m,g,y,b,w,E;t||(t=[]),i.rows.item||(i.rows.item=function(e){return this[e]});if(f)try{a=new RegExp("(SELECT) *(.*) *FROM (\\w+)"),c=new RegExp("(INSERT OR REPLACE|INSERT) *(.*) *INTO *(\\w*) *\\(([\\w|,| ]*)\\)"),h=new RegExp("(DELETE) *(.*) *FROM (\\w+) *(\\w*)WHERE (\\w+)='*([^']+)");if(e.match(c)){p=c.exec(e);if(p&&p.length>1){d=p[3],v=l[d],m=amplify.store("wijevcal_tbl_"+d);if(m){y=p[4].split(","),s={};for(u=0;u1){d=p[3],v=l[d],m=amplify.store("wijevcal_tbl_"+d);if(m){w=e.replace(a,"");if(w.toUpperCase().indexOf(" WHERE ")===0){w=w.substr(7),E=w.split(" OR ");for(u=0;u1&&(d=p[3],v=l[d],m=amplify.store("wijevcal_tbl_"+d),m&&m[p[6]]&&delete m[p[6]],amplify.store("wijevcal_tbl_"+d,m)));n&&n(i)}catch(S){r&&r(S)}else{if(!o){r("Local data storage not found.");return}o.transaction(function(i){i.executeSql(e,t,function(e,t){n&&n(t)},function(e,t){r&&r(t.message);return})})}}var n=jQuery,r="wijevcal",o,u="C1EventsCalendarDB",a="1.1",f=!1,l,p=function(e){function t(){e.apply(this,arguments),this._dynIdCounter=0}return __extends(t,e),t.prototype._setOption=function(e,t){var r=this,i=n.when.apply(this,r._defferObjs),s;i.always(function(){r._setOptionCallbacks.fire(),r._setOptionCallbacks.empty(),r._defferObjs=[]}),i.state()==="pending"?this._setOptionCallbacks.add(function(){n.isPlainObject(t)?s=n.extend(!0,{},t):n.isArray(t)?s=[].concat(t):s=t,r._setOptionInternal(e,s)}):this._setOptionInternal(e,t)},t.prototype._setOptionInternal=function(e,t){var r=this.options,s;switch(e){case"dataSource":r.dataSource=t,this._needLoadLocalStorage=!1,r.eventsData=[],this._bindDataView();break;case"eventsData":r.eventsData=t,r.appointments=t,this._needLoadLocalStorage=!1,this._onEventsDataChanged(),this._bindEvents();break;case"appointments":r.eventsData=t,r.appointments=t,this._needLoadLocalStorage=!1,this._onEventsDataChanged(),this._bindEvents();break;case"localization":this._setLocalization(t);break;case"culture":r.culture=t,this.element.find(".wijmo-wijdatepager").wijdatepager("option","culture",r.culture),this._editEventDialog&&this._editEventDialog.find(".wijmo-wijinput-date").wijinputdate("option","culture",r.culture),this.element.find(".wijmo-wijcalendar").wijcalendar("option","culture",r.culture),this._redrawActiveView();break;case"disabled":r.disabled!==t&&(r.disabled=t,this._ensureDisabled());break;case"enableLogs":r.enableLogs=t,this._initLogPanel();break;case"selectedDate":t&&(t=i(t),r.selectedDates[0].getTime()!==t.getTime()&&(r.selectedDates[0]=t,this._onSelectedDatesChanged()));return;case"selectedDates":t&&(r.selectedDates=t,this._onSelectedDatesChanged());return;case"statusBarVisible":r.statusBarVisible=t,this._initStatusbar(),this.invalidate();return;case"headerBarVisible":r.headerBarVisible=t,this._initHeaderbar(),this.invalidate();return;case"navigationBarVisible":r.navigationBarVisible=t,this._initNavigationbar(),this.invalidate();return;case"rightPaneVisible":r.rightPaneVisible=t,this._initRightPane(),this.invalidate();return;case"timeInterval":case"timeIntervalHeight":case"timeRulerInterval":case"timeRulerFormat":r[e]!==t&&(r[e]=t,this._redrawActiveView());break;case"firstDayOfWeek":r[e]!==t&&(r[e]=t,this._redrawActiveView(),s=this._getCulture(),s&&s.calendar&&(s.calendar.firstDay=t,this.element.find(".wijmo-wijcalendar").wijcalendar("refresh")));break;case"viewType":r.viewType!==t&&(r.viewType=t,this._onViewTypeChanged());break;default:}n.wijmo.widget.prototype._setOption.apply(this,arguments)},t.prototype._setLocalization=function(e){this._destroyInternal(),this.options.localization=e,this._create(),this._init()},t.prototype._ensureDisabled=function(){var e=this.options;if(e.disabled){this.element.addClass(e.wijCSS.stateDisabled);try{this.element.find(".wijmo-wijcalendar").wijcalendar("option","disabled",!0),this.element.find(".wijmo-wijsuperpanel").wijsuperpanel("option","disabled",!0),this.element.find(".wijmo-wijdatepager").wijdatepager("option","disabled",!0),n().buttonset&&this.element.find(".ui-buttonset").buttonset("option","disabled",!0),this.element.find(".wijmo-wijev-today.ui-button").button("option","disabled",!0)}catch(t){this.log(t,"error")}this._unbindEvents()}else{this.element.removeClass(e.wijCSS.stateDisabled);try{this.element.find(".wijmo-wijcalendar").wijcalendar("option","disabled",!1),this.element.find(".wijmo-wijsuperpanel").wijsuperpanel("option","disabled",!1),this.element.find(".wijmo-wijdatepager").wijdatepager("option","disabled",!1),n().buttonset&&this.element.find(".ui-buttonset").buttonset("option","disabled",!1),this.element.find(".wijmo-wijev-today.ui-button").button("option","disabled",!1)}catch(t){this.log(t,"error")}this._bindEvents(),this._updateTitleText()}},t.prototype._onViewTypeChanged=function(){this._renderActiveView(),this._updateTitleText(),this._trigger("viewTypeChanged",null,this.options.viewType),this.element.find(".wijmo-wijev-datepager").wijdatepager("option","viewType",this.options.viewType)},t.prototype._onSelectedDatesChanged=function(){var e=this.options;e.selectedDate=e.selectedDates[0],this.element.find(".wijmo-wijev-datepager").wijdatepager("option","selectedDate",e.selectedDate),this._trigger("selectedDatesChanged",null,{selectedDates:e.selectedDates}),this._renderActiveView(),this._updateTitleText()},t.prototype._updateHeaderTitleText=function(){var e=this.options,t=e.titleFormat,n=e.selectedDates[0],r=e.selectedDates[e.selectedDates.length-1];if(t[e.viewType])t=t[e.viewType];else{if(t[e.viewType]===!1){this.element.find(".wijmo-wijev-view .wijmo-wijev-header-title").hide();return}t=t.toString()}e.viewType==="list"&&(r=this._addDays(n,14)),this.element.find(".wijmo-wijev-view .wijmo-wijev-header-title").show().html(this._formatString(t,n,r))},t.prototype._updateTitleText=function(){var e=this.options,t=e.selectedDates[0],r=e.selectedDates[e.selectedDates.length-1],i=new Date,s=!1;s=this._compareDayDates(t,i)===0||ti,n.mobile==null&&this.element.find(".wijmo-wijev-navigationbar .wijmo-wijev-today").button("option","disabled",s),this._updateHeaderTitleText()},t.prototype.localizeString=function(e,t){var n=this.options;return n.localization&&n.localization[e]?n.localization[e]:t},t.prototype._create=function(){var e=this;window.wijmoApplyWijTouchUtilEvents&&(n=window.wijmoApplyWijTouchUtilEvents(n)),this._defferObjs=[],this._chromeLoadDataDeffer=n.Deferred(),this._defferObjs.push(this._chromeLoadDataDeffer),this._setOptionCallbacks=n.Callbacks("once"),this._needLoadLocalStorage=!0;if(this.options.appointments&&this.options.appointments.length||this.options.eventsData&&this.options.eventsData.length)this._needLoadLocalStorage=!1;n.isFunction(window.wijmoASPNetParseOptions)&&window.wijmoASPNetParseOptions(this.options);var t,r,i=this.options;i.colors||(i.colors=["red","darkorchid","green","blue","cornflowerblue","yellow","bronze"]),this.wijevcalnamespacekey||(this.wijevcalnamespacekey="wijevcal"+(new Date).getTime()),this.element[0].id||(this.element[0].id="wijevcal_dynid_"+(new Date).getTime()),this._uidPref=this.element[0].id+"evcdynid",this.element.addClass("wijmo-wijevcal wijmo-wijev "+i.wijCSS.widget+" "+i.wijCSS.helperReset+" "+i.wijCSS.stateDefault),n('").appendTo(this.element),n(''+'
'+'
'+'
'+'
...
'+'
'+this.localizeString("activityLoading","Loading...")+"
"+'
...
'+"
"+'
'+"
"+"
"+'
"+'
'+"
"+"
").appendTo(this.element),n('
'+this.localizeString("activityLoading","Loading...")+"
").appendTo(this.element),n('").appendTo(this.element),n('").appendTo(this.element),t=this.element.find(".wijmo-wijev-navigationbar"),r=this.element.find(".wijmo-wijev-headerbar .wijmo-wijev-tools"),t.find(".wijmo-wijev-today").button({text:this.localizeString("buttonToday","today")}).click(n.proxy(this._onTodayClick,this)),this.element.find(".wijmo-wijev-datepager").wijdatepager({selectedDate:i.selectedDate,localization:i.datePagerLocalization,culture:i.culture,viewType:i.viewType,nextTooltip:this.localizeString("navigatorBarNextTooltip","right"),prevTooltip:this.localizeString("navigatorBarPrevTooltip","left"),firstDayOfWeek:i.firstDayOfWeek,selectedDateChanged:n.proxy(function(e,t){this.goToDate(t.selectedDate)},this)}),n.mobile==null?(r.find(".wijmo-wijev-day").button().button("widget").addClass(i.wijCSS.stateDefault),r.find(".wijmo-wijev-week").button().button("widget").addClass(i.wijCSS.stateDefault),r.find(".wijmo-wijev-month").button().button("widget").addClass(i.wijCSS.stateDefault),r.find(".wijmo-wijev-list").button().button("widget").addClass(i.wijCSS.stateDefault),r.buttonset()):(r.attr("data-role","controlgroup"),r.attr("data-type","horizontal"),r.parent().trigger("create"),r.controlgroup("refresh")),this.element.wijAddVisibilityObserver&&this.element.wijAddVisibilityObserver(function(){e.element.wijRemoveVisibilityObserver&&e.element.wijRemoveVisibilityObserver(),e._redrawActiveView()},"wijevcal"),r.find(".wijmo-wijev-day").click(n.proxy(this._onDayViewClick,this)),r.find(".wijmo-wijev-week").click(n.proxy(this._onWeekViewClick,this)),r.find(".wijmo-wijev-month").click(n.proxy(this._onMonthViewClick,this)),r.find(".wijmo-wijev-list").click(n.proxy(this._onListViewClick,this)),this.showLoadingLabel()},t.prototype.showLoadingLabel=function(e,t){e===!1?this.element.find(".wijmo-wijev-loading-text").hide():(this.element.find(".wijmo-wijev-loading-text").show(),e||(e=this.localizeString("activityLoading","Loading..."))),(t===undefined||t===!0)&&this.element.find(".wijmo-wijev-loading-modal-frame").show(),this.element.find(".wijmo-wijev-loading").show(),this.element.find(".wijmo-wijev-loading-text").html(e)},t.prototype.hideLoadingLabel=function(){this.element.find(".wijmo-wijev-loading-modal-frame").hide(),this.element.find(".wijmo-wijev-loading").hide()},t.prototype._init=function(){var e=this.options;e.selectedDates&&e.selectedDates.length>0?e.selectedDate=e.selectedDates[0]=i(e.selectedDates[0]):e.selectedDate?(e.selectedDate=i(e.selectedDate),e.selectedDates||(e.selectedDates=[]),e.selectedDates[0]=e.selectedDate):(e.selectedDate=i(new Date),e.selectedDates=[e.selectedDate]),e.disabled&&this.element.addClass(e.wijCSS.stateDisabled),this._initHeaderbar(),this._initNavigationbar(),this._initStatusbar(),this._initRightPane(),e.fullScreen&&this._onFullScreenModeChanged(e.fullScreen),this._initLogPanel(),this._initLocalDataStorage(),this.element.ajaxError(jQuery.proxy(this._onAjaxError,this)),n(window).bind("resize."+this.wijevcalnamespacekey,n.proxy(this._onWindowResize,this)),this._renderActiveView(),this._bindDataView()},t.prototype._onFullScreenModeChanged=function(e){},t.prototype._isDataViewLoaded=function(e){return e&&(e.isLoaded()||e.count()>0)},t.prototype._isDataview=function(e){if(e&&typeof e=="object"&&!n.isArray(e))return!0},t.prototype._getDataViewInst=function(){return this.element.data("wijdataview")},t.prototype._bindDataView=function(){var e=this.options,t=e.dataSource,t,n=this;!t&&this._getDataViewInst()&&(t=this._getDataViewInst(),t=e.dataSource=t),t&&this._isDataview(t)?this._isDataViewLoaded(t)?(this._dataView=t,this._setOption("eventsData",t.toArray())):t.element.bind("dataloaded",function(){n._dataView=t,n._setOption("eventsData",t.toArray())}):this._dataView=null},t.prototype._initLocalDataStorage=function(){try{f=!1;if(window.amplify&&window.amplify.store)try{l=amplify.store("wijevcal_tables1"),f=!0,this.log("Using amplify.store for the local data storage")}catch(e){this.log("amplify.store exception:"+e),this._loadData();return}else{if(!window.openDatabase){this.log(this.localizeString("logCouldntOpenLocalStorage","Couldn't open built-in local data storage. Please, add amplify.store references.")),this._loadData();return}try{o=window.openDatabase(u,a,"Wijmo Events Calendar Offline DB",2e5)}catch(t){this.log("web sql database error: "+t),this._loadData();return}if(!o){this.log("Failed to open the database on disk. This is probably because the version was bad or there is not enough space left in this domain's quota"),this._loadData();return}this.log("Using Web SQL Database for the local data storage.")}c("calendars","(id TEXT PRIMARY KEY, name TEXT, location TEXT, description TEXT, color TEXT, tag TEXT)");var r=n.Deferred(),i=this;this._defferObjs.push(r),c("events","(id TEXT PRIMARY KEY, calendar TEXT, subject TEXT, location TEXT, start TIMESTAMP, end TIMESTAMP, description TEXT, color TEXT, allday INTEGER, properties TEXT, tag TEXT)",function(){i._loadData(),r.resolve()})}catch(s){this.log("local datastorage initialization error:"+s)}},t.prototype._initStatusbar=function(){var e=this.element.find(".wijmo-wijev-statusbar");if(!this.options.statusBarVisible){e.hide();return}e.css("float","left"),e.show(),this.statusbarEventsAdded||(this.statusbarEventsAdded=!0)},t.prototype._initHeaderbar=function(){var e=this.element.find(".wijmo-wijev-headerbar");if(!this.options.headerBarVisible){e.hide();return}e.show()},t.prototype._initNavigationbar=function(){var e=this.element.find(".wijmo-wijev-navigationbar");if(!this.options.navigationBarVisible){e.hide();return}e.show()},t.prototype._initRightPane=function(){var e=this.element.find(".wijmo-wijev-rightpane");if(!this.options.rightPaneVisible){e.hide();return}e.show()},t.prototype._initLogPanel=function(){this.options.enableLogs?(this._createLogPanel(),this.log=this._log):(this.logDialog&&this.logDialog.wijdialog("close"),this.log=function(){})},t.prototype._handleServerError=function(e){return e&&e.toString().indexOf("error:")===0?(this.status(e.toString(),"error"),!0):!1},t.prototype._loadData=function(){var e=this.options,t=this,r,i,s,o,u,a,f,l,c,p,d,v,m;this.showLoadingLabel(),p=function(e){e==="Local data storage not found."&&(m=!0),t.hideLoadingLabel()},e.calendars=[],u=this._calendarsById={},l=function(n){e.calendars=[];if(!n)return;if(typeof n=="string"){if(t._handleServerError(n)){p(n);return}try{n=t._jsonParse(n)}catch(i){t.status("Unable to parse received calendars data. "+i,"error");return}}n.calendars&&n.calendars.length&&(n=n.calendars);for(r=0;r0&&(f+=" OR "),f+="calendar='"+e.visibleCalendars[r]+"'";h(f,[],function(n){if(t._needLoadLocalStorage){e.eventsData=[];for(r=0,i=n.rows.length;r=t.end.getTime()&&(t.end=this._addMinutes(t.start,this.options.timeInterval)),this._deSerializeProperties(t.properties,t),t.prevData=this._cloneObj(t),t},t.prototype._prepareEventsForView=function(){this._eventsView=this.getOccurrences()},t.prototype._cloneObj=function(e){var t={},n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},t.prototype._onDayViewClick=function(){var e=this.options;if(e.disabled)return;e.viewType!=="day"&&(e.viewType="day",this._onViewTypeChanged()),e.selectedDates=[e.selectedDate],this._onSelectedDatesChanged()},t.prototype._onWeekViewClick=function(){var e=this.options,t,n,r;if(e.disabled)return;e.viewType!=="week"&&(e.viewType="week",this._onViewTypeChanged()),t=e.selectedDate,r=e.firstDayOfWeek-t.getDay(),Math.abs(r)>6&&(r=t.getDay()-e.firstDayOfWeek),t=this._addDays(t,r),e.selectedDates=[];for(r=0;r<7;r+=1)n=this._addDays(t,r),e.selectedDates.push(n);this._onSelectedDatesChanged()},t.prototype._onMonthViewClick=function(){var e=this.options;if(e.disabled)return;e.viewType!=="month"&&(e.viewType="month",this._onViewTypeChanged())},t.prototype._onListViewClick=function(){var e=this.options;if(e.disabled)return;e.viewType!=="list"&&(e.viewType="list",this._onViewTypeChanged()),e.selectedDates=[e.selectedDate],this._onSelectedDatesChanged()},t.prototype._ensureEditCalendarDialogCreated=function(){var e=this.options,t,r={};this._editCalendarDialog||(t=e.editCalendarTemplate,t||(t=" "+this.localizeString("labelCalendarName","Calendar name")+" "+' '+'
"+"
"+""+this.localizeString("labelLocation","Location")+" "+'
'+""+this.localizeString("labelDescription","Description")+'
'),this._editCalendarDialog=n(''+t+"
"),this.element.append(this._editCalendarDialog),r[this.localizeString("buttonSave","Save")]=n.proxy(function(){try{var e=this._validateAndReadCalendarDialogFields(this._editCalendarDialog);e.prevData?this.updateCalendar(e):this.addCalendar(e),this._editCalendarDialog.wijdialog("close")}catch(t){alert(t)}},this),this._editCalendarDialog.wijdialog({autoOpen:!0,height:340,width:440,modal:!0,title:this.localizeString("titleEditCalendar","Edit calendar"),buttons:r,captionButtons:{pin:{visible:!1},refresh:{visible:!1},toggle:{visible:!1},minimize:{visible:!1},maximize:{visible:!1}}}),this._editCalendarDialog.find(".wijmo-wijev-name, .wijmo-wijev-location, .wijmo-wijev-description").wijtextbox(),this._editCalendarDialog.find(".wijmo-wijev-color-button").button({icons:{primary:e.wijCSS.iconArrowDown}}).click(n.proxy(this._onColorButtonClick,{dlg:this._editCalendarDialog,self:this})))},t.prototype._ensureEditEventDialogCreated=function(){var e=this.options,t,r=!1,i=!1;this._editEventDialog||(t=this.options.editEventDialogTemplate,t||(t=''+'
"+'
'+""+this.localizeString("labelLocation","Location")+" "+' '+""+this.localizeString("labelRepeat","Repeat")+" "+''+''+this.localizeString("repeatNone","None")+" "+''+this.localizeString("repeatDaily","Every Day")+" "+''+this.localizeString("repeatWorkDays","Work days")+" "+''+this.localizeString("repeatWeekly","Every Week")+" "+''+this.localizeString("repeatMonthly","Every Month")+" "+''+this.localizeString("repeatYearly","Every Year")+" "+" "+""+this.localizeString("labelCalendar","Calendar")+" "+' '+''+this.localizeString("labelDescription","Description")+" "+' '+" "+'"+'
'+"
"),this._editEventDialog=n(t),this.element.append(this._editEventDialog),this._editEventDialog.find(".wijmo-wijev-color-button").button({icons:{primary:e.wijCSS.iconArrowDown}}).click(n.proxy(this._onColorButtonClick,{dlg:this._editEventDialog,self:this})),this._editEventDialog.find(".wijmo-wijev-delete").button().click(n.proxy(function(){this.deleteEvent(this._editEventDialog.appt),this._editEventDialog.wijpopup("hide")},this)),this._editEventDialog.find(".wijmo-wijev-cancel").button().click(n.proxy(function(e){this._editEventDialog.wijpopup("hide"),e.preventDefault()},this)),this._editEventDialog.find(".wijmo-wijev-start").width(114).wijinputdate({culture:this.options.culture,titleFormat:this.localizeString("calendarTitleFormat","MMMM yyyy"),toolTipFormat:this.localizeString("calendarToolTipFormat","dddd, MMMM dd, yyyy"),nextTooltip:this.localizeString("calendarNextTooltip","Next"),prevTooltip:this.localizeString("calendarPrevTooltip","Previous"),showDropDownButton:!0,dateFormat:"d",dropDownOpen:function(e,t){r=!1},dropDownClose:function(e,t){r=!0,n(document).one("mouseup",function(){r=!1})},dateChanged:n.proxy(function(e,t){r&&(i=!0,n(document).one("mouseup",function(){i=!1}));var s=this._editEventDialog.find(".wijmo-wijev-end").wijinputdate("option","date");t.date>s&&this._editEventDialog.find(".wijmo-wijev-end").wijinputdate("option","date",t.date)},this)}),this._editEventDialog.find(".wijmo-wijev-start-time").width(80).wijinputdate({culture:this.options.culture,titleFormat:this.localizeString("calendarTitleFormat","MMMM yyyy"),toolTipFormat:this.localizeString("calendarToolTipFormat","dddd, MMMM dd, yyyy"),nextTooltip:this.localizeString("calendarNextTooltip","Next"),prevTooltip:this.localizeString("calendarPrevTooltip","Previous"),showDropDownButton:!1,dateFormat:"t",dateChanged:n.proxy(function(e,t){var n=this._editEventDialog.find(".wijmo-wijev-end-time").wijinputdate("option","date"),r=this._editEventDialog.find(".wijmo-wijev-start").wijinputdate("option","date");t.date.getDate()!==r.getDate()&&(t.date.setDate(r.getDate()),this._editEventDialog.find(".wijmo-wijev-start-time").wijinputdate("option","date",t.date)),t.date>n&&this._editEventDialog.find(".wijmo-wijev-end-time").wijinputdate("option","date",t.date)},this)}),this._editEventDialog.find(".wijmo-wijev-end").width(114).wijinputdate({culture:this.options.culture,titleFormat:this.localizeString("calendarTitleFormat","MMMM yyyy"),toolTipFormat:this.localizeString("calendarToolTipFormat","dddd, MMMM dd, yyyy"),nextTooltip:this.localizeString("calendarNextTooltip","Next"),prevTooltip:this.localizeString("calendarPrevTooltip","Previous"),showDropDownButton:!0,dateFormat:"d",dropDownOpen:function(e,t){r=!1},dropDownClose:function(e,t){r=!0,n(document).one("mouseup",function(){r=!1})},dateChanged:n.proxy(function(e,t){r&&(i=!0,n(document).one("mouseup",function(){i=!1}));var s=this._editEventDialog.find(".wijmo-wijev-start").wijinputdate("option","date");t.date0)for(r=0;r ';e._colorMenu||(e._colorMenu=n(''),t.append(e._colorMenu),e._colorMenu.wijpopup({autoHide:!0})),e._colorMenu.html(o),e._colorMenu.find(".wijmo-wijev-listcolor").click(n.proxy(function(r){this._addColorClass(t.find(".wijmo-wijev-color"),this._readColorFromClass(n(r.target),"default")),e._colorMenu.wijpopup("hide")},e)),e._colorMenu.wijpopup("show",{of:t.find(".wijmo-wijev-color-button"),my:"left top",at:"left bottom"})},t.prototype._validateAndReadCalendarDialogFields=function(e){var t=e.cal||{};t.name=e.find(".wijmo-wijev-name").val(),t.location=e.find(".wijmo-wijev-location").val(),t.description=e.find(".wijmo-wijev-description").val(),t.color=this._readColorFromClass(e.find(".wijmo-wijev-color"),t.color||"default");if(!t.name)throw"Calendar name can not be empty";return t},t.prototype._validateAndReadApptDialogFields=function(e){var t=e.appt,n,r,s,o,u;n=i(e.find(".wijmo-wijev-start").wijinputdate("option","date")),r=i(e.find(".wijmo-wijev-end").wijinputdate("option","date")),s=e.find(".wijmo-wijev-start-time").wijinputdate("option","date"),o=e.find(".wijmo-wijev-end-time").wijinputdate("option","date");var a=(s.getHours()*60+s.getMinutes())*60+s.getSeconds(),f=(o.getHours()*60+o.getMinutes())*60+o.getSeconds();if(n.getTime()===r.getTime()&&a>f)throw this.localizeString("messageEndOccursBeforeStart","The end date you entered occurs before the start date.");return t.subject=e.find(".wijmo-wijev-subject").val(),t.location=e.find(".wijmo-wijev-location").val(),t.start=n,t.end=r,e.find(".wijmo-wijev-allday").length>0&&(t.allday=e.find(".wijmo-wijev-allday")[0].checked),t.allday?t.start.getTime()>=t.end.getTime()&&(t.end=this._addMinutes(t.start,this.options.timeInterval)):(t.start=new Date(t.start.getFullYear(),t.start.getMonth(),t.start.getDate(),s.getHours(),s.getMinutes(),s.getSeconds()),t.end=new Date(t.end.getFullYear(),t.end.getMonth(),t.end.getDate(),o.getHours(),o.getMinutes(),o.getSeconds())),t.calendar=e.find(".wijmo-wijev-calendar").val(),t.description=e.find(".wijmo-wijev-description").val(),t.color=this._readColorFromClass(e.find(".wijmo-wijev-color"),t.color),u=t.recurrencePattern,u&&t.recurrenceState==="master"&&(u.startTime=t.start,u.endTime=t.end,u.patternStartDate=t.start),t},t.prototype._bindApptToDialog=function(e){if(!e)return;var t=this._editEventDialog,n,r;t.appt=e,t.find(".wijmo-wijev-subject").val(e.subject||""),t.find(".wijmo-wijev-location").val(e.location||"");try{t.find(".wijmo-wijev-start").wijinputdate("option","date",e.start),t.find(".wijmo-wijev-start-time").wijinputdate("option","date",e.start),t.find(".wijmo-wijev-end").wijinputdate("option","date",e.end),t.find(".wijmo-wijev-end-time").wijinputdate("option","date",e.end)}catch(i){alert("[e0001a] wijinputdate/wijtextselection firefox error\n"+i)}t.find(".wijmo-wijev-allday").length>0&&(t.find(".wijmo-wijev-allday")[0].checked=e.allday),t.find(".wijmo-wijev-allday").wijcheckbox("refresh"),this._fillCalendarsSelect(t.find(".wijmo-wijev-calendar"),e.calendar),this._loadRepeatValue(e,t.find(".wijmo-wijev-repeat")),t.find(".wijmo-wijev-description").val(e.description||""),e.prevData?t.find(".wijmo-wijev-delete").show():t.find(".wijmo-wijev-delete").hide(),t.find(".wijmo-wijev-calendar").length>0&&(n=this._calendarsById[t.find(".wijmo-wijev-calendar")[0].value]),r=e.color,!r&&n&&n.color&&(r=n.color),this._addColorClass(t.find(".wijmo-wijev-color"),r),this._eventDialogEnsureTimePartState()},t.prototype._onEditEventDialogShown=function(e,t){t.recurrenceState==="exception"?e.find(".wijmo-wijev-repeat").wijdropdown("option","disabled",!0):e.find(".wijmo-wijev-repeat").wijdropdown("option","disabled",!1)},t.prototype._eventDialogEnsureTimePartState=function(){var e=this._editEventDialog;e.find(".wijmo-wijev-allday").length>0&&(e.find(".wijmo-wijev-allday")[0].checked?(e.find(".wijmo-wijev-start-time").wijinputdate("option","disabled",!0),e.find(".wijmo-wijev-end-time").wijinputdate("option","disabled",!0)):(e.find(".wijmo-wijev-start-time").wijinputdate("option","disabled",!1),e.find(".wijmo-wijev-end-time").wijinputdate("option","disabled",!1)))},t.prototype._loadRepeatValue=function(e,t){var n="none";if(e.recurrencePattern)switch(e.recurrencePattern.recurrenceType){case"daily":n="daily";break;case"workdays":n="workdays";break;case"weekly":n="weekly";break;case"monthly":n="monthly";break;case"yearly":n="yearly";break;default:n="custom"}t.val(n)},t.prototype._addColorClass=function(e,t){var n,r=new RegExp("wijmo-wijev-event-color-(\\w+)\\s*");e.length>0&&(n=e[0].className,e[0].className=n.replace(r,""),e.addClass("wijmo-wijev-event-color-"+(t||"default")))},t.prototype._readColorFromClass=function(e,t){var n=new RegExp("wijmo-wijev-event-color-(\\w+)\\s*"),r;if(e.length>0){r=n.exec(e[0].className);if(r&&r.length>1)return r[1]}return t},t.prototype._fillCalendarsSelect=function(e,t){var n="",r=this.options,i,s,o,u=r.calendars.slice(0),a=r.visibleCalendars;if(a&&a.length>0)for(i=0;i'+u[i].name+"";e.html(n).val(t)},t.prototype._bindCalendarToDialog=function(e){if(!e)return;var t=this._editCalendarDialog;t.cal=e,t.find(".wijmo-wijev-name").val(e.name||""),t.find(".wijmo-wijev-location").val(e.location||""),t.find(".wijmo-wijev-description").val(e.description||""),this._addColorClass(t.find(".wijmo-wijev-color"),e.color)},t.prototype._onTodayClick=function(){if(this.options.disabled)return;return this.goToday(),!1},t.prototype._bindEvents=function(){this._eventsAttached||(n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-appointment",n.proxy(this._onAppointmentClick,this)),n(this.element).on("mousedown."+this.wijevcalnamespacekey,".wijmo-wijev-dayview .wijmo-wijev-appointment",n.proxy(this._onDayViewAppointmentMouseDown,this)),n(this.element).on("mousedown."+this.wijevcalnamespacekey,".wijmo-wijev-monthview .wijmo-wijev-appointment",n.proxy(this._onMonthViewAppointmentMouseDown,this)),n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-dayview .wijmo-wijev-timeinterval",n.proxy(this._onDayViewTimeIntervalClick,this)),n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-dayview .wijmo-wijev-allday-cell",n.proxy(this._onDayViewAllDayCellClick,this)),n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-monthview .wijmo-wijev-monthcellheader",n.proxy(this._onMonthViewDayLabelClick,this)),n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-monthview .wijmo-wijev-monthcell-showmore",n.proxy(this._onMonthViewDayLabelClick,this)),n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-weekview .wijmo-wijev-daylabel",n.proxy(this._onMonthViewDayLabelClick,this)),n(this.element).on("click."+this.wijevcalnamespacekey,".wijmo-wijev-monthview .wijmo-wijev-monthcell",n.proxy(this._onMonthViewCellClick,this)),this._eventsAttached=!0)},t.prototype._unbindEvents=function(){this._eventsAttached&&(n(this.element).off("mousedown."+this.wijevcalnamespacekey),n(this.element).off("click."+this.wijevcalnamespacekey),this._eventsAttached=!1)},t.prototype.destroy=function(){this._destroyInternal(),n.wijmo.widget.prototype.destroy.apply(this,arguments)},t.prototype._destroyInternal=function(){var e=this.options;this.element.removeClass("wijmo-wijev wijmo-wijevcal "+e.wijCSS.widget+" "+e.wijCSS.helperReset),n(window).unbind("resize."+this.wijevcalnamespacekey),this._unbindEvents(),this.element.empty(),this.wijevcalnamespacekey=null,this._uidPref=null,this._isUpdating=null,this._resolveDayApptConflictsTimeout=null,this._pendingRedrawActiveView=null,this._listViewDetailsInit=null,this._dayViewDetailsInit=null,this._eventsAttached=null,this.statusbarEventsAdded=null,this._dataView=null,this._eventsView=null,this._eventsDataById=null,this._calendarsById=null,this._dayViewCache=null,this._templateDayColumn=null,this._templateDayHeader=null,this._dayViewScrollToEvent=null,this._maxAllDayEventCount=null,this._dayColumnsToResolve=null,this._dayColumnResolveIdx=null,this.logDialog=null,this.logPanel=null,this._editCalendarDialog=null,this._editEventDialog=null,this._renderAgendaEventsTimeoutId=null,this.__targetAppt=null,this._isApptResize=null,this.__startApptH=null,this.__startApptY=null,this.__startClientY=null,this._apptDragResizeFlag=null,this._apptMovedFlag=null,this._movedFromTimeInervalApptElem=null,this.__targetApptChanged=null,this._defferObjs=null,this._setOptionCallbacks=null,this._chromeLoadDataDeffer=null,n.wijmo.wijevcal.prototype.options.eventsData=[]},t.prototype.deleteCalendar=function(e,t,r){var i,s=this.options.calendars,o=e.id||e,u=!1,a,f,l,c=this;for(i=0;ie.start){t.splice(n,0,e);return}if(t[n].start.getTime()===e.start.getTime()&&t[n].subject>e.subject){t.splice(n,0,e);return}}t.push(e)},t.prototype._readUpdatedServerDataIfAny=function(e,t){var n=null,r;if(typeof e=="string"&&e.indexOf("update:")===0){e=e.toString().substr("update:".length);try{n=this._jsonParse(e)}catch(i){this.status("Unable to read updated server data. "+i,"warning")}if(n)for(r in n)n[r]&&(t[r]=n[r])}},t.prototype.updateEvent=function(e,t,r){var i,s,o,u=this;if(!this._trigger("beforeUpdateEvent",null,{data:e,prevData:e.prevData||{}})){if(e.prevData)for(o in e.prevData)e.prevData.hasOwnProperty(o)&&(e[o]=e.prevData[o]);return this._updateAppointmentVisual(e),!1}e.calendar||(e.calendar="Default"),this.showLoadingLabel(this.localizeString("activityUpdatingEvent","Updating event...")),s=function(t){u.hideLoadingLabel(),u.status("Unable to update event '"+e.subject+"': "+t,"error");if(e.prevData)for(o in e.prevData)e.prevData.hasOwnProperty(o)&&(e[o]=e.prevData[o]);u._updateAppointmentVisual(e),r&&r(t)};if(!e.id){s("id is empty");return}if(e.recurrenceState==="exception"||e.recurrenceState==="occurrence"){if(!this._eventsDataById[e.parentRecurrenceId]){s("Unable to find master event for event with id:"+e.id);return}if(e.recurrenceState==="occurrence")return this.log(this._formatString("[updateEvent->addEvent] recurrenceState for event {0} changed to 'exception'.",e.id)),e.recurrenceState="exception",this.addEvent(e,t,r)}i=function(r){if(u._handleServerError(r)){s(r);return}u._readUpdatedServerDataIfAny(r,e),u._eventsDataById[e.id]?(n.extend(u._eventsDataById[e.id],e),u.status("Event '"+e.subject+"' updated.")):(u._storeEventWithSort(e),u.status("Event '"+e.subject+"' added.")),e.prevData=u._cloneObj(e),u._onEventsDataChanged(),u.hideLoadingLabel(),t&&t(r)};if(this.options.dataStorage.updateEvent)this.options.dataStorage.updateEvent(e,i,s);else if(this.options.webServiceUrl){try{o=this._jsonStringify(e)}catch(a){this.status("Unable prepare event data for server. "+a,"error"),s("Unable to prepare event data for server. "+a);return}n.ajax({url:this.options.webServiceUrl+"?clientId="+this.element[0].id+"&command=updateEvent×tamp="+(new Date).getTime(),dataType:"text",contentType:"application/json; charset=utf-8",type:"POST",data:"jsonData="+o,success:i,error:s})}else{e=u._initEventData(e);if(!f&&!window.openDatabase){i.call(this,{rowsAffected:0,rows:[e]});return}h("INSERT OR REPLACE INTO events (id, calendar, subject, location, start, end, description, color, allday, properties, tag) VALUES(?,?,?,?,?,?,?,?,?,?,?);",[e.id,e.calendar,e.subject,e.location,e.start.getTime(),e.end.getTime(),e.description,e.color,e.allday,this._serializeProperties(e),e.tag],i,s)}},t.prototype._serializeProperties=function(e){var t="",n={};n.parentRecurrenceId=e.parentRecurrenceId,n.recurrenceState=e.recurrenceState,n.recurrencePattern=e.recurrencePattern,n.color=e.color,n.allday=e.allday;try{t=this._jsonStringify(n)}catch(r){this.status("Unable save additional event properties. "+r,"error")}return t},t.prototype._deSerializeProperties=function(e,t){var n={},r;if(e){if(typeof e=="string")try{n=this._jsonParse(e)}catch(i){this.status("Unable to load additional event properties. "+i,"error");return}else n=e;n.parentRecurrenceId&&(t.parentRecurrenceId=n.parentRecurrenceId),n.recurrenceState&&(t.recurrenceState=n.recurrenceState),n.recurrencePattern&&(t.recurrencePattern=n.recurrencePattern),n.color&&(t.color=n.color),n.allday&&(t.allday=n.allday)}t&&t.recurrencePattern&&(r=t.recurrencePattern,r.patternStartDate=r.patternStartDate?new Date(r.patternStartDate):r.patternStartDate,r.startTime=r.startTime?new Date(r.startTime):r.startTime,r.endTime=r.endTime?new Date(r.endTime):r.endTime,r.startTime.getTime()>=r.endTime.getTime()&&(r.endTime=this._addMinutes(r.startTime,this.options.timeInterval)))},t.prototype._jsonStringify=function(e){var t;if(window.__JSONC1)t=window.__JSONC1.stringify(e);else{if(!window.JSON)throw"JSON not found.";t=JSON.stringify(e)}return t},t.prototype._jsonParse=function(e){var t,n,r;if(window.__JSONC1)t=window.__JSONC1.parse(e);else{if(!window.JSON)throw"JSON variable not found.";n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/,r=/^\/Date\((d|-|.*)\)\/$/,t=window.JSON.parse(e,function(e,t){if(typeof t=="string"){var i=n.exec(t),s;if(i)return new Date(Date.UTC(+i[1],+i[2]-1,+i[3],+i[4],+i[5],+i[6]));i=r.exec(t);if(i)return s=i[1].split(/[-,.]/),new Date(+s[0])}return t})}return t},t.prototype.getOccurrences=function(e,t){var n=this.options,r=n.eventsData,i,s,o,u,a,f,l,c,h=100,p,d,v,m=[],g=[],y=[],b={};this._eventsDataById||(this._eventsDataById={});for(a=0,l=r.length;at?!0:!1},t.prototype.deleteEvent=function(e,t,r){e.id&&(e=e.id);var i=this._eventsDataById[e],s,o,u,a,l=this,c,p;if(!this._trigger("beforeDeleteEvent",null,{data:i}))return!1;this.showLoadingLabel(this.localizeString("activityDeletingEvent","Deleting event...")),a=function(e){l.status("Unable to delete event '"+(i?i.subject:"undefined")+"': "+e),l.hideLoadingLabel(),r&&r(e)};if(i.recurrenceState==="exception"||i.recurrenceState==="occurrence"){p=this._eventsDataById[i.parentRecurrenceId];if(p){this.log(this._formatString("[deleteEvent] removing {0} with id {1}. Updating master event with id {2}",i.recurrenceState,i.id,p.id)),p.recurrencePattern.removedOccurrences||(p.recurrencePattern.removedOccurrences=[]),p.recurrencePattern.removedOccurrences.push(i.id),this.updateEvent(p,t,r);if(i.recurrenceState==="occurrence"){this.log("No need to delete occurrence from store. Master event should be updated.");return}}else if(i.recurrenceState!=="exception")return a("Unable to find master event with id "+i.parentRecurrenceId),!1}i.recurrenceState==="master",u=function(n){if(l._handleServerError(n)){a(n);return}if(l._eventsDataById[i.id]){o=l.options.eventsData;for(s=0;s0?this.element.find(".wijmo-wijev-scrollpanel").wijsuperpanel("scrollChildIntoView",n):(this._dayViewScrollToEvent=r,this.goToDate(r.start));break;case"month":this.goToDate(r.start)}},t.prototype.isAllDayEvent=function(e){var t=e;return e.id||(t=this.findEventById(e)),t.allday?(t.end.getTime()-t.start.getTime())/864e5>=1?!0:!0:!1},t.prototype.goToDate=function(e){e=i(e);var t=this.options,n=e.getDay(),r,s,o,u,a,f=t.selectedDates;if(f&&f.length>0){if(this._isContainsDayDate(f,e))return;a=f[0],o=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),u=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()),s=(o-u)/864e5;if(t.viewType==="week")for(r=0;r0?(this._editEventDialog._arrowTarget=a,a.addClass("ui-selected"),o=a.parent(".wijmo-wijev-daycolumn"),o.length<1&&(o=a.parent(".wijmo-wijev-dayheadercolumn")),o=o[0],a.hasClass("wijmo-wijev-allday-cell")?e.allday=!0:a.hasClass("wijmo-wijev-monthcellcontainer")?(o=a[0],e.allday=!0):e.allday=!1,o&&(u=this._parseDateFromClass(o.className,e.allday?null:a[0].className),e.start=u,e.allday?e.end=this._addMinutes(e.start,1440):e.end=this._addMinutes(e.start,i.timeInterval))):(e.start=new Date(i.selectedDates[0]),e.end=this._addMinutes(e.start,i.timeInterval))),this._trigger("beforeEditEventDialogShow",null,{data:e,targetCell:a})&&(this._bindApptToDialog(e),this._editEventDialog.wijpopup("show",{of:a,my:"left center",at:"right center",within:this.element.parent(),offset:(a&&r?Math.round(r.offsetX-a.width()):10)+" 0",collision:"fit"}))},t.prototype._renderActiveView=function(){var e=this.options,t=this.element.find(".wijmo-wijev-headerbar .wijmo-wijev-tools");this.element.find(".wijmo-wijev-view").hide(),this.element.find(".wijmo-wijev-viewdetails").hide(),this.element.find(".wijmo-wijev-"+e.viewType.toLowerCase()+"-details").show();switch(e.viewType.toLowerCase()){case"day":case"week":case"list":this.element.find(".wijmo-wijev-view.wijmo-wijev-dayview").show(),this._renderDayView();break;case"month":this.element.find(".wijmo-wijev-view.wijmo-wijev-monthview").show(),this._renderMonthView();break;default:}t.find(".wijmo-wijev-"+e.viewType.toLowerCase())[0].checked=!0,n().buttonset&&t.buttonset("refresh")},t.prototype._redrawActiveView=function(){if(this._isUpdating){this._pendingRedrawActiveView=!0;return}switch(this.options.viewType.toLowerCase()){case"day":case"week":case"list":this._clearDayViewCache(),this._templateDayColumn=null}this._renderActiveView()},t.prototype._getDayColumnDates=function(e){var t=this.options,n=t.selectedDates,r,i,s;n||(n=[new Date]);if(t.viewType==="week"){r=t.selectedDate||n[0],s=t.firstDayOfWeek-r.getDay(),Math.abs(s)>6&&(s=r.getDay()-t.firstDayOfWeek),r=this._addDays(r,s),n=[];for(s=0;s<7;s+=1)i=this._addDays(r,s),n.push(i)}return e&&(t.selectedDates=n),n},t.prototype._renderDayView=function(){var e=this.options,t=0,r=1440,i,s,o,u=this._getDayColumnDates(!0),a,f,l,c,h=new Date,p,d=!1,v=this.element.find(".wijmo-wijev-dayview"),m,g,y,b=0,w;v.length===0&&(v=n('"),v.appendTo(this.element.find(".wijmo-wijev-view-container")),this.element.find(".wijmo-wijev-scrollpanel").wijsuperpanel({hScroller:{scrollBarVisibility:"hidden"},animationOptions:{disabled:!0}})),v.removeClass("wijmo-wijev-weekview wijmo-wijev-listview"),v.addClass("wijmo-wijev-"+e.viewType.toLowerCase()+"view"),m=this.element.find(".wijmo-wijev-headercontainer"),g=this.element.find(".wijmo-wijev-scrollcontent"),y=g.find(".wijmo-wijev-timeruler");if(!this._templateDayColumn){y.find(".wijmo-wijev-timerulerinterval").remove(),i='',w=!0;while(t
',t+=e.timeInterval,b+=e.timeInterval,b>=e.timeRulerInterval&&(s+=" wijmo-wijev-timeinterval-hourstart",o+=" wijmo-wijev-timerulerinterval-hourstart",y.append(n(''+this._formatString(e.timeRulerFormat,new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,t-b))+"
")),b=0);i+="",this._templateDayColumn=n(i),this._templateDayHeader=n('")}m.find(".wijmo-wijev-dayheadercolumn").remove(),g.find(".wijmo-wijev-daycolumn").remove();for(a=0,p=u.length;ap&&(p=d);l=c*p+h+c,t.outerHeight(l+Math.round(c/2)),t.find(".wijmo-wijev-allday-cell").outerHeight(l),f=this.element.find(".wijmo-wijev-view").width(),g=f-v,g-=18,y=this.element.find(".wijmo-wijev-view").innerHeight()-t.outerHeight(!0)-a,b=Math.floor(g/o.length),t.outerWidth(f),r.outerWidth(f),s.outerWidth(b),o.outerWidth(b),this._invalidateCurrentTimeIndicator(),w=this.element.find(".wijmo-wijev-scrollpanel"),w.outerWidth(f),w.outerHeight(y),w.wijsuperpanel("refresh");switch(this.options.viewType.toLowerCase()){case"day":this._updateDayViewDetails();break;case"list":this._updateListViewDetails()}},t.prototype._updateDayViewDetails=function(){var e=this.options,t=e.selectedDate,r=this.element.find(".wijmo-wijev-leftpane"),i=r.find(".wijmo-wijev-agenda-container");this._dayViewDetailsInit||(this._dayViewDetailsInit=!0,this.element.find(".wijmo-wijev-day-details .wijmo-wijev-daycalendar").wijcalendar({culture:e.culture,titleFormat:this.localizeString("calendarTitleFormat","MMMM yyyy"),toolTipFormat:this.localizeString("calendarToolTipFormat","dddd, MMMM dd, yyyy"),showTitle:!1,showOtherMonthDays:!1,showWeekNumbers:!1,selectionMode:{day:!0,days:!1},selectedDatesChanged:n.proxy(function(t,n){n.dates&&!e.disabled&&this.goToDate(n.dates[0])},this),nextTooltip:this.localizeString("calendarNextTooltip","Next"),prevTooltip:this.localizeString("calendarPrevTooltip","Previous")}),this.element.find(".wijmo-wijev-day-details .wijmo-wijev-agenda-container").wijsuperpanel()),this.element.find(".wijmo-wijev-day-details .wijmo-wijev-daycalendar").wijcalendar("option","displayDate",t).wijcalendar("unSelectAll").wijcalendar("selectDate",t),this.element.find(".wijmo-wijev-day-details .wijmo-wijev-daycalendar").wijcalendar("refresh"),this.element.find(".wijmo-wijev-day-details .wijmo-wijev-monthday-label").html(t.getDate()),this.element.find(".wijmo-wijev-day-details .wijmo-wijev-fulldate-label").html(this._formatString(this.localizeString("dayDetailsLabelFulldateFormat","{0:dddd, MMMM d}"),t)),this.element.find(".wijmo-wijev-day-details .wijmo-wijev-year-label").html(this._formatString(this.localizeString("dayDetailsLabelYearFormat","{0:yyyy}"),t)),this._updateAgendaList(this.element.find(".wijmo-wijev-day-details .wijmo-wijev-agenda-container"),t,t,!1)},t.prototype._listViewAgendaScrolled=function(e,t){var r=this.element.find(".wijmo-wijev-list-details .wijmo-wijev-agenda-container"),i=r.wijsuperpanel("option","vScroller"),s,o=i.scrollValue,u=i.scrollMax-i.scrollLargeChange*2,a=e.type,f=!1,l;a==="wijsuperpanelscroll"?(l=t.position,s=r.find(".wijmo-wijsuperpanel-contentwrapper-touch"),r.height()+l>=s.height()&&(f=!0)):s=r.find(".wijmo-wijsuperpanel-templateouterwrapper"),(o>=u||f)&&s.data("wijevcal_agenda_loadnextpage")&&(s.data("wijevcal_agenda_loadnextpage",!1),s.find(".wijmo-wijev-agenda-more-events").show().html(this.localizeString("agendaLoadingMoreEvents","Loading more events...")),this._renderAgendaEventsTimeoutId&&(clearTimeout(this._renderAgendaEventsTimeoutId),this._renderAgendaEventsTimeoutId=null),this._renderAgendaEventsTimeoutId=setTimeout(n.proxy(function(){this._renderAgendaEventsTimeoutId=null,this._renderAgendaEvents(s,null,null,!0,r),s.find(".wijmo-wijev-agenda-more-events").remove()},this),100))},t.prototype._updateListViewDetails=function(){this._listViewDetailsInit||(this._listViewDetailsInit=!0,n.support.isTouchEnabled&&n.support.isTouchEnabled()?this.element.find(".wijmo-wijev-list-details .wijmo-wijev-agenda-container").wijsuperpanel({scroll:n.proxy(this._listViewAgendaScrolled,this)}):this.element.find(".wijmo-wijev-list-details .wijmo-wijev-agenda-container").wijsuperpanel({scrolled:n.proxy(this._listViewAgendaScrolled,this)})),this._updateAgendaList(this.element.find(".wijmo-wijev-list-details .wijmo-wijev-agenda-container"),null,null,!0)},t.prototype._updateAgendaList=function(e,t,r,i){var s=this.element.find(".wijmo-wijev-leftpane"),o=e;e.outerHeight(s.innerHeight()-e[0].offsetTop),o.find(".wijmo-wijsuperpanel-templateouterwrapper").length>0&&(o=o.find(".wijmo-wijsuperpanel-templateouterwrapper")),n.support.isTouchEnabled&&n.support.isTouchEnabled()&&(o=o.find(".wijmo-wijsuperpanel-contentwrapper-touch"));if(i&&o.data("wijevcal_agenda_initialized")){e.data("wijmo-wijsuperpanel")&&e.wijsuperpanel("refresh");return}o.data("wijevcal_agenda_initialized",!0),o.data("wijevcal_agenda_loadedeventscount",0),o.html(""),this._renderAgendaEvents(o,t,r,i,e)},t.prototype._renderAgendaEvents=function(e,t,r,s,o){var u=this._eventsView,a,f,l,c,h=0,p,d="",v="",m=null,g=null,y=this.options,b,w,E=100,S=this,x=e.data("wijevcal_agenda_loadedeventscount");t&&(m=i(t),g=this._addDays(i(r),1),c=(g.getTime()-m.getTime())/864e5);if(u){l=u.length'+v+"",d+=""),d+='',s&&(d+=this._renderAgendaDayHeader(b)),v="";v+=this._renderAgendaAppointmentVisual(a),p+=1,f===l-1&&(d+='
",d+="
",l',d+=this._formatString(this.localizeString("agendaMoreEventsFormat","More events ({0})..."),u.length-l),d+="",e.data("wijevcal_agenda_loadnextpage",!0)):e.data("wijevcal_agenda_loadnextpage",!1))}}else while(h
m&&a.start=b&&(v+=this._renderAgendaAppointmentVisual(a),p+=1);v!==""&&(d+='',s&&(d+=this._renderAgendaDayHeader(b)),d+='
",d+="
"),h+=1}n(d).appendTo(e)}e.on("click",".wijmo-wijev-agenda-event",n.proxy(this._onAgendaEventClick,this)).on("mouseover",".wijmo-wijev-agenda-event",function(e){if(S.options.disabled)return;n(this).addClass(y.wijCSS.stateHover)}).on("mouseout",".wijmo-wijev-agenda-event",function(e){if(S.options.disabled)return;n(this).removeClass(y.wijCSS.stateHover).removeClass(y.wijCSS.stateActive)}).on("mousedown",".wijmo-wijev-agenda-event",function(){if(S.options.disabled)return;n(this).addClass(y.wijCSS.stateActive)}).on("mouseup",".wijmo-wijev-agenda-event",function(){if(S.options.disabled)return;n(this).removeClass(y.wijCSS.stateActive)}),o.data("wijmo-wijsuperpanel")&&o.wijsuperpanel("refresh")},t.prototype._renderAgendaDayHeader=function(e){var t='";return t},t.prototype._onAgendaEventClick=function(e){if(this.options.disabled)return;var t=n(e.target);t.hasClass("wijmo-wijev-agenda-event")||(t=t.parent(".wijmo-wijev-agenda-event")),t.length>0&&this.goToEvent(this._parseEventIdFromClass(t[0].className))},t.prototype._renderAgendaAppointmentVisual=function(e){var t=''+'"+''+e.subject+"
"+''+(this.isAllDayEvent(e)?this.localizeString("labelAllDay","all-day"):this._formatString(this.localizeString("agendaTimeFormat","{0:hh:mm tt} to {1:hh:mm tt}"),e.start,e.end))+"
"+" ";return t},t.prototype._invalidateCurrentTimeIndicator=function(){var e=this.element.find(".wijmo-wijev-timeruler .wijmo-wijev-currenttime-indicator"),t=new Date,n=this.options;t=t.getMinutes()+t.getHours()*60,e.css("top",t/n.timeInterval*n.timeIntervalHeight)},t.prototype._onEventsDataChanged=function(){this._clearViewsCache(),this._prepareEventsForView(),this._renderActiveView(),this._trigger("eventsDataChanged",null,{eventsData:this.options.eventsData})},t.prototype._onCalendarsChanged=function(){this._trigger("calendarsChanged",null,{calendars:this.options.calendars})},t.prototype._renderDayViewAppointments=function(){var e=this._eventsView,t,r,i,s,o,u=this.element.find(".wijmo-wijev-headercontainer"),a=this.element.find(".wijmo-wijev-scrollcontent"),f=u.find(".wijmo-wijev-dayheadercolumn"),l=a.find(".wijmo-wijev-daycolumn"),c,h,p=this.options,d=this._getDayColumnDates(),v=d[0],m,g,y,b,w,E,S,x,T,N=[];m=d[d.length-1],m=new Date(m.getFullYear(),m.getMonth(),m.getDate(),23,59,59);if(e)for(i=0,o=d.length;iv&&t.startc&&(this.isAllDayEvent(t)?(g=!0,y=n(this._getAllDayEventMarkup(t)),n(f[i]).find(".wijmo-wijev-allday-cell").append(y)):(b=t.start,w=t.end,bh&&(w=h),E=(b-c)/1e3/60,S=(w-c)/1e3/60,x=Math.round(E*p.timeIntervalHeight/p.timeInterval),T=Math.round(S*p.timeIntervalHeight/p.timeInterval),y=n(this._getEventMarkup(t)),y.css("top",x),y.outerHeight(T-x),n(l[i]).append(y)));this._storeDayCache(d[i],f[i],l[i]),l[i]._cached=!0,N.push(l[i])}else N.push(l[i]);this._dayColumnsToResolve=N,this._dayColumnResolveIdx=0,this._resolveDayApptConflictsTimeout||(clearTimeout(this._resolveDayApptConflictsTimeout),this._resolveDayApptConflictsTimeout=null),this._resolveDayApptConflictsTimeout=setTimeout(n.proxy(this._resolveDayViewAppointmentConflictsCb1,this),1),g&&this._invalidateDayView(!0),this._dayViewScrollToEvent&&(y=this.element.find(".wijmo-wijev-dayview .wijmo-wijev-daycolumn ."+this._eventIdToCssClass(this._dayViewScrollToEvent.id)),y.length>0&&this.element.find(".wijmo-wijev-scrollpanel").wijsuperpanel("scrollChildIntoView",y))},t.prototype._getAllDayEventMarkup=function(e){return'"},t.prototype._getEventMarkup=function(e){return''+'
'+this._formatString(this.options.eventTitleFormat,e.start,e.end,e.subject,e.location,"",e.description)+"
"+'
"+"
"},t.prototype._resolveDayViewAppointmentConflictsCb1=function(){this._resolveDayApptConflictsTimeout=null;if(!this._dayColumnsToResolve||this._dayColumnResolveIdx>=this._dayColumnsToResolve.length)return;this._resolveDayViewAppointmentConflicts(this._dayColumnsToResolve[this._dayColumnResolveIdx]),this._dayColumnResolveIdx=this._dayColumnResolveIdx+1,setTimeout(n.proxy(this._resolveDayViewAppointmentConflictsCb1,this),1)},t.prototype._resolveDayViewAppointmentConflicts=function(e){var t=n(e).find(".wijmo-wijev-appointment"),r,i=[],s,o,u,a,f,l,c,h,p=0;r=n(t).toArray().sort(this._sortOffsetTop);for(o=0,l=t.length;of.offsetTop))break;i[o]||(i[o]=[a]),i[o].push(f),f.offsetTop+f.offsetHeight>a.offsetTop+a.offsetHeight&&(a=f)}p=u}for(o=0,l=i.length;ot.offsetTop?1:0},t.prototype._onDayViewTimeIntervalClick=function(e){if(this.options.disabled)return;if(this.options.readOnly)return;this.showEditEventDialog(null,e.target,e)},t.prototype._onDayViewAllDayCellClick=function(e){if(this.options.disabled)return;if(this.options.readOnly)return;var t=n(e.target);if(t.hasClass("wijmo-wijev-appointment")||t.parents(".wijmo-wijev-appointment").length>0)return;if(t.hasClass("wijmo-wijev-daylabel")||t.parents(".wijmo-wijev-daylabel").length>0)return;this.showEditEventDialog(null,e.target,e)},t.prototype._onMonthViewDayLabelClick=function(e){if(this.options.disabled)return;var t=n(e.target).parents(".wijmo-wijev-monthcellcontainer"),r=this.options,i;t.length<1&&(t=n(e.target).parents(".wijmo-wijev-dayheadercolumn")),t[0]&&(i=this._parseDateFromClass(t[0].className),r.viewType!=="day"&&(r.viewType="day",this._onViewTypeChanged()),r.selectedDates=[new Date(i)],this._onSelectedDatesChanged())},t.prototype._onMonthViewCellClick=function(e){if(this.options.disabled)return;var t=n(e.target).parent(".wijmo-wijev-monthcellcontainer");if(this.options.readOnly)return;if(t.length<1)return;this.showEditEventDialog(null,t,e)},t.prototype._onAppointmentClick=function(e){var t=n(e.target),r;if(this.options.disabled)return;if(this.options.readOnly)return;if(this._apptDragResizeFlag)return;t.hasClass("wijmo-wijev-appointment")||(t=t.parents(".wijmo-wijev-appointment")),t.length>0&&(r=this.findEventById(t[0].className),this.showEditEventDialog(r,t,e))},t.prototype.findEventById=function(e){var t;if(e){t=e.indexOf("apptid_"),t!==-1&&(e=this._parseEventIdFromClass(e));if(this._eventsDataById)return this._eventsDataById[e]}return null},t.prototype._onMonthViewAppointmentMouseDown=function(e){if(this.options.disabled)return;if(this.options.readOnly)return;var t=n(e.target),r=t.hasClass("wijmo-wijev-appointment")?t:t.parents(".wijmo-wijev-appointment");e.preventDefault(),this.__targetAppt=r,n(document).bind("mouseup.tmp_wijevcal",n.proxy(this._onMonthViewAppointmentMouseUp,this)),this.element.find(".wijmo-wijev-monthview .wijmo-wijev-monthcellcontainer").bind("mouseover.tmp_wijevcal",n.proxy(this._onMonthViewCellMouseOver,this))},t.prototype._onDayViewAppointmentMouseDown=function(e){if(this.options.disabled)return;if(this.options.readOnly)return;var t=n(e.target),r=t.hasClass("wijmo-wijev-appointment")?t:t.parents(".wijmo-wijev-appointment"),i=t.hasClass("wijmo-wijev-resizer")||t.parents(".wijmo-wijev-resizer").length>0;if(this.options.disabled)return;this._isApptResize=i,e.preventDefault(),this._isApptResize?(this.__startApptH=r[0].offsetHeight,this.__startApptY=r[0].offsetTop):this.__startApptY=r[0].offsetTop,this.__startClientY=e.clientY,this.__targetAppt=r,n(document).bind("mousemove.tmp_wijevcal",n.proxy(this._onDayViewAppointmentMouseMove,this)),n(document).bind("mouseup.tmp_wijevcal",n.proxy(this._onDayViewAppointmentMouseUp,this)),n(this.element).find(".wijmo-wijev-dayview .wijmo-wijev-daycolumn").bind("mouseover.tmp_wijevcal",n.proxy(this._onDayViewColumnMouseOver,this)),n(this.element).find(".wijmo-wijev-dayview .wijmo-wijev-allday-cell").bind("mouseover.tmp_wijevcal",n.proxy(this._onDayViewAllDayMouseOver,this))},t.prototype._onDayViewAppointmentMouseMove=function(e){if(this.options.disabled)return;e.preventDefault();var t=e.clientY-this.__startClientY,n,r=this.options,i,s;e.ctrlKey||(t=Math.round(t/r.timeIntervalHeight)*r.timeIntervalHeight),t!==0&&!this._apptDragResizeFlag&&(this._apptDragResizeFlag=!0,this.__targetAppt.addClass("wijmo-wijev-dragging"),this.__targetAppt.css("width","100%").css("margin-left","0").css("z-index","1000")),this._apptDragResizeFlag&&(this._isApptResize?(i=this.__startApptH+t,i<0?(i=Math.abs(i),n=this.__startApptY-i,n>=0&&(this.__targetAppt.css("height",i),this.__targetAppt.css("top",n))):this.__targetAppt.css("height",i)):(n=this.__startApptY+t,n<0&&(n=0),this.__targetAppt.css("top",n),s=this.__targetAppt.offset().top,this.element.find(".wijmo-wijev-scrollpanel").wijsuperpanel("scrollChildIntoView",this.__targetAppt),this.__startApptY=this.__startApptY-(this.__targetAppt.offset().top-s)),this._onApptVisualDargOrResize(this.__targetAppt,this.findEventById(this.__targetAppt[0].className)))},t.prototype._onDayViewAppointmentMouseUp=function(e){if(this.options.disabled)return;this.__targetAppt&&this.__targetAppt.removeClass("wijmo-wijev-dragging"),n(document).unbind(".tmp_wijevcal"),n(this.element).find(".wijmo-wijev-dayview .wijmo-wijev-daycolumn").unbind(".tmp_wijevcal"),n(this.element).find(".wijmo-wijev-dayview .wijmo-wijev-allday-cell").unbind(".tmp_wijevcal");if(this._apptDragResizeFlag||this._apptMovedFlag){var t=this.findEventById(this.__targetAppt[0].className);this._onApptVisualDargOrResize(this.__targetAppt,t),this._apptMovedFlag=!1,this._movedFromTimeInervalApptElem=null,this.updateEvent(t),window.setTimeout(n.proxy(function(){this.__targetAppt&&!this.__targetAppt.hasClass("wijmo-wijev-dragging")&&(this._apptDragResizeFlag=!1,this._resolveDayViewAppointmentConflicts(this.__targetAppt.parents(".wijmo-wijev-daycolumn")))},this),1)}},t.prototype._updateAppointmentVisual=function(e){var t=this.element.find(".wijmo-wijev-dayview ."+this._eventIdToCssClass(e.id)),n=this.options,r,s,o,u,a,f,l,c;t.length===1&&(this._addColorClass(t,e.color),t.find(".wijmo-wijev-title").html(this._formatString(n.eventTitleFormat,e.start,e.end,e.subject,e.location,"",e.description)),a=i(e.start),r=(e.start-a)/1e3/60,s=(e.end-a)/1e3/60,o=Math.round(r*n.timeIntervalHeight/n.timeInterval),u=Math.round(s*n.timeIntervalHeight/n.timeInterval),t.css("top",o),t.css("height",u-o),f=this._dayDateToCssClass(a),t.parents(".wijmo-wijev-daycolumn."+f).length!==1&&(l=t[0].parentNode,c=this.element.find(".wijmo-wijev-daycolumn."+f),l.removeChild(t[0]),t.appendTo(c)))},t.prototype._onApptVisualDargOrResize=function(e,t){if(this.options.disabled)return;var n=this.options,r=e[0].offsetTop,s=r+e[0].offsetHeight,o,u,a,f,l,c,h,p;e.parents(".wijmo-wijev-dayheadercolumn").length>0?p=e.parents(".wijmo-wijev-dayheadercolumn")[0]:p=e.parents(".wijmo-wijev-daycolumn")[0],h=this._parseDateFromClass(p.className,null),o=Math.round(r*n.timeInterval/n.timeIntervalHeight),u=Math.round(s*n.timeInterval/n.timeIntervalHeight),a=new Date(o*60*1e3+h.getTime()),f=new Date(u*60*1e3+h.getTime()),t&&(this._isApptResize?l=f:(c=t.end.getTime()-t.start.getTime(),l=new Date(a.getTime()+c)),t.allday=e.parents(".wijmo-wijev-dayheadercolumn").length>0,t.start=a,t.end=l,e.find(".wijmo-wijev-title").html(this._formatString(n.eventTitleFormat,t.start,t.end,t.subject,t.location,"",t.description)),!this._isApptResize&&l.getTime()!==f.getTime()&&e.css("height",Math.round((t.end-i(t.start))/1e3/60*n.timeIntervalHeight/n.timeInterval)-Math.round((t.start-i(t.start))/1e3/60*n.timeIntervalHeight/n.timeInterval)))},t.prototype._onDayViewColumnMouseOver=function(e){if(this.options.disabled)return;var t=n(e.target).parents(".wijmo-wijev-daycolumn"),r=this.__targetAppt.parents(".wijmo-wijev-daycolumn");if(t.length<1)return;if(r.length<1){r=this.__targetAppt.parents(".wijmo-wijev-dayheadercolumn");if(r.length<1)return;this._movedFromTimeInervalApptElem?(this.__targetAppt.replaceWith(this._movedFromTimeInervalApptElem),this.__targetAppt=n(this._movedFromTimeInervalApptElem),this._movedFromTimeInervalApptElem=null):this.__targetAppt.html(this._getEventMarkup(this.findEventById(this.__targetAppt[0].className)))}t[0].className!==r[0].className&&(this.__targetAppt[0].parentNode.removeChild(this.__targetAppt[0]),this._resolveDayViewAppointmentConflicts(r),this.__targetAppt.appendTo(t),this._apptMovedFlag=!0)},t.prototype._onMonthViewCellMouseOver=function(e){if(this.options.disabled)return;var t=n(e.target),r=t.hasClass("wijmo-wijev-monthcellcontainer")?t:t.parents(".wijmo-wijev-monthcellcontainer"),i=this.__targetAppt.parents(".wijmo-wijev-monthcellcontainer");if(r.length<1||i.length<1)return;r[0].className!==i[0].className&&(this.__targetAppt[0].parentNode.removeChild(this.__targetAppt[0]),this.__targetAppt.appendTo(r.find(".wijmo-wijev-monthcell")),this.__targetApptChanged=!0)},t.prototype._onMonthViewAppointmentMouseUp=function(){if(this.options.disabled)return;var e,t=this.__targetAppt.parents(".wijmo-wijev-monthcellcontainer")[0],r=this._parseDateFromClass(t.className,null),s;n(document).unbind(".tmp_wijevcal"),this.element.find(".wijmo-wijev-monthview .wijmo-wijev-monthcellcontainer").unbind(".tmp_wijevcal"),this.__targetApptChanged&&(this.__targetApptChanged=!1,e=this.findEventById(this.__targetAppt[0].className),s=(r.getTime()-i(e.start).getTime())/864e5,e.start=this._addDays(e.start,s),e.end=this._addDays(e.end,s),this.updateEvent(e))},t.prototype._onDayViewAllDayMouseOver=function(e){if(this.options.disabled)return;var t=n(e.target).parents(".wijmo-wijev-dayheadercolumn"),r=this.__targetAppt.parents(".wijmo-wijev-daycolumn"),i;if(t.length<1)return;r.length>0?(i=n(this._getAllDayEventMarkup(this.findEventById(this.__targetAppt[0].className))),this._movedFromTimeInervalApptElem=this.__targetAppt[0].cloneNode(!0),this.__targetAppt.replaceWith(i),this.__targetAppt=i):r=this.__targetAppt.parents(".wijmo-wijev-dayheadercolumn");if(r.length<1)return;t[0].className!==r[0].className&&(this.__targetAppt[0].parentNode.removeChild(this.__targetAppt[0]),this._resolveDayViewAppointmentConflicts(r),this.__targetAppt.appendTo(n(t).find(".wijmo-wijev-allday-cell")),this._apptMovedFlag=!0)},t.prototype._renderMonthView=function(){var e=this.options,t=e.selectedDate,r=e.firstDayOfWeek,i=!1,s=!1,o,u,a,f=new Date,l,c,h=!1,p,d=["","","","","","",""],v,m,g=this.element.find(".wijmo-wijev-view.wijmo-wijev-monthview"),y,b=e.dayHeaderFormat,w=e.firstRowDayHeaderFormat;t||(t=new Date),u=new Date(t.getFullYear(),t.getMonth(),1);while(u.getDay()!==parseInt(r))u=this._addDays(u,-1);a=new Date(t.getFullYear(),t.getMonth(),this._daysInMonth(t.getMonth(),t.getFullYear())),o=u,l=0,c=0;while(oa&&(a=o),v="",p="wijmo-wijev-monthcellcontainer "+e.wijCSS.content+" "+this._dayDateToCssClass(o),s=o.getMonth()!==t.getMonth(),s&&(p+=" wijmo-wijev-othermonth"),h?h=!1:(p+=" wijmo-wijev-leftborder",l===6&&(p+=" wijmo-wijev-rightborder")),i=this._compareDayDates(o,f)===0,i&&(p+=" wijmo-wijev-today",p+=" wijmo-wijev-rightborder",h=!0),v+='",d[l]=d[l]+v,l+=1,o=this._addDays(o,1);if(l>6){if(o>a)break;l=0,c+=1}}g.length===0&&(g=n('"),g.appendTo(this.element.find(".wijmo-wijev-view-container"))),y=g.find(".wijmo-wijev-monthview-inner"),y.find(".wijmo-wijev-monthcolumn").remove(),o=u;for(m=0;m<7;m+=1)y.append(''+d[m]+"
"),o=this._addDays(o,1);this._invalidateMonthView(),this._renderMonthViewAppointments()},t.prototype._invalidateMonthView=function(){var e=this.element.find(".wijmo-wijev-monthview"),t=e.find(".wijmo-wijev-monthview-inner"),r=e.find(".wijmo-wijev-monthcolumn"),i=e.find(".wijmo-wijev-monthcellcontainer"),s=this.element.find(".wijmo-wijev-monthview .wijmo-wijev-header-title"),o,u,a,f,l,c,h,p;this._invalidateView();if(r.length<1)return;o=e.innerWidth(),u=e.innerHeight()-s.outerHeight(!0),t.outerWidth(o),t.outerHeight(u),o-=t.outerWidth(!0)-t.innerWidth(),u-=t.outerHeight(!0)-t.innerHeight(),a=Math.floor(o/r.length),r.outerWidth(a),p=o-a*r.length,p>0&&n(r[r.length-1]).outerWidth(a+p),h=n(r[0]).find(".wijmo-wijev-weekdayname").outerHeight(!0),h||(h=0),f=Math.floor((u-h)/n(r[0]).find(".wijmo-wijev-monthcellcontainer").length),i.height(f),l=n(i[0]).find(".wijmo-wijev-monthcellheader").outerHeight(!0),c=f-l,i.find(".wijmo-wijev-monthcell").outerHeight(c)},t.prototype._renderMonthViewAppointments=function(){var e=this._eventsView,t,r,i,s,o,u=this.element.find(".wijmo-wijev-monthcellcontainer"),a,f,l,c;if(e)for(i=0,o=u.length;if&&(c=n('"),n(a).find(".wijmo-wijev-monthcell").append(c))}u.find(".wijmo-wijev-monthcell").each(n.proxy(function(e,t){var r=n(t),i=r.find(".wijmo-wijev-appointment"),s=r.outerHeight(),o=i.outerHeight(),u=i.length*o,a=0;u>s&&(i.each(function(e,t){e*o+o>s&&(t.style.display="none",a+=1)}),a>0&&r.find(".wijmo-wijev-monthcell-showmore").length<1&&r.append(n(''+this._formatString(this.localizeString("monthCellMoreEventsFormat","{0} more..."),a)+"
")))},this))},t.prototype.log=function(e,t){},t.prototype._log=function(e,t){var r;this.logPanel&&(r=new Date,this.logPanel.prepend(n(''+"["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"] "+e+" ")))},t.prototype._createLogPanel=function(){if(!this.logPanel){this.logDialog=n(''),this.logDialog.appendTo(this.element);var e={};e[this.localizeString("buttonClearAll","Clear All")]=function(){n(this).find(".wijmo-wijev-log").html("")},e[this.localizeString("buttonClose","Close")]=function(){n(this).wijdialog("close")},this.logPanel=this.logDialog.wijdialog({captionButtons:{},buttons:e,width:600,height:420,position:["right","top"]}).find(".wijmo-wijev-log")}this.logDialog.wijdialog("open")},t.prototype.status=function(e,t){this.element.find(".wijmo-wijev-statusbar").html(""+e+" "),this.log(e,t?t:"wijmo-wijev-status"),this.statusbarEventsAdded||(this.statusbarEventsAdded=!0,this._initStatusbar())},t.prototype._invalidateView=function(){var e=this.element.find(".wijmo-wijev-rightpane"),t=this.element.find(".wijmo-wijev-leftpane"),r=this.element.find(".wijmo-wijev-headerbar"),i=this.element.find(".wijmo-wijev-navigationbar"),s=this.element.find(".wijmo-wijev-statusbar"),o=this.element.find(".wijmo-wijev-view-container"),u=this.element.find(".wijmo-wijev-view"),a,f,l,c,h,p,d,v,m,g;a=this.element.innerWidth()-(o.outerWidth(!0)-o.innerWidth()),f=this.element.innerHeight()-(o.outerHeight(!0)-o.innerHeight()),l=r.is(":visible")?r.outerHeight(!0):0,c=i.is(":visible")?i.outerHeight(!0):0,h=s.is(":visible")?s.outerHeight(!0):0,o.outerWidth(a),o.outerHeight(f-l-c-h),v=0;for(g=0;g0&&(e=this._addDays(e,r))),e},t.prototype._addMonths=function(e,t){return new Date(e.getFullYear(),e.getMonth()+t,e.getDate())},t.prototype._compareDayDates=function(e,t){return e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),t=new Date(t.getFullYear(),t.getMonth(),t.getDate()),et?1:0},t.prototype._dayDateToCssClass=function(e){return"wijmo-wijev-date_"+e.getFullYear()+"_"+e.getMonth()+"_"+e.getDate()},t.prototype._parseDateFromClass=function(e,t,n){var r,i,s,o=new RegExp("wijmo-wijev-minute-(\\d+)\\s"),u=new RegExp("wijmo-wijev-date_(\\d+_\\d+_\\d+)\\s");return e?(s=u.exec(e+" ")[1].split("_"),r=new Date(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10)),t&&(i=o.exec(t+" "),i&&(i=parseInt(i[1],10),r.setMinutes(i))),r):n||null},t.prototype._eventIdToCssClass=function(e){return"apptid_"+e},t.prototype._parseEventIdFromClass=function(e){var t="",n,r;return n=new RegExp("apptid_(\\S+)"),r=n.exec(e),r&&r.length>1&&(t=r[1]),t},t.prototype._isContainsDayDate=function(e,t){var n;if(!e)return!1;for(n=0;n