/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.core.min","./kendo.userevents.min"],function(){!function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e){return z?v.elementFromPoint(e.x.screen,e.y.screen):v.elementFromPoint(e.x.client,e.y.client)}function r(e,t){return parseInt(e.css(t),10)||0}function a(e,t){return Math.min(Math.max(e,t.min),t.max)}function o(e,t){var n=E(e),i=n.left+r(e,"borderLeftWidth")+r(e,"paddingLeft"),a=n.top+r(e,"borderTopWidth")+r(e,"paddingTop"),o=i+e.width()-t.outerWidth(!0),s=a+e.height()-t.outerHeight(!0);return{x:{min:i,max:o},y:{min:a,max:s}}}function s(e,n,i){for(var r,a,o=0,s=n&&n.length,l=i&&i.length;e&&e.parentNode;){for(o=0;s>o;o++)if(r=n[o],r.element[0]===e)return{target:r,targetElement:e};for(o=0;l>o;o++)if(a=i[o],p.matchesSelector.call(e,a.options.filter))return{target:a,targetElement:e};e=e.parentNode}return t}var l,c,u,f,d,h,g=window.kendo,p=g.support,v=window.document,m=g.Class,x=g.ui.Widget,_=g.Observable,y=g.UserEvents,b=e.proxy,T=e.extend,E=g.getOffset,M={},S={},w={},O=p.mobileOS,D=O&&O.android,z=D&&"chrome"==O.browser,k="keyup",C="change",W="dragstart",H="drag",P="dragend",A="dragcancel",L="dragenter",N="dragleave",F="drop",B=_.extend({init:function(t,n){var i=this,r=t[0];i.capture=!1,e.each(g.eventMap.down.split(" "),function(){r.addEventListener(this,b(i._press,i),!0)}),e.each(g.eventMap.up.split(" "),function(){r.addEventListener(this,b(i._release,i),!0)}),_.fn.init.call(i),i.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(e){var t=this;t.trigger("press"),t.capture&&e.preventDefault()},_release:function(e){var t=this;t.trigger("release"),t.capture&&(e.preventDefault(),t.cancelCapture())}}),G=_.extend({init:function(t){var n=this;_.fn.init.call(n),n.forcedEnabled=!1,e.extend(n,t),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){e.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:1e3,_virtualMax:-1e3})},virtualSize:function(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())},outOfBounds:function(e){return e>this.max||er,e||t.trigger(C,t)}}),I=_.extend({init:function(e){var t=this,n=b(t.refresh,t);_.fn.init.call(t),t.x=new G(T({horizontal:!0},e)),t.y=new G(T({horizontal:!1},e)),t.forcedMinScale=e.minScale,t.bind(C,e),g.onResize(n)},rescale:function(e){this.x.rescale(e),this.y.rescale(e),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(C)}}),j=_.extend({init:function(e){var t=this;T(t,e),_.fn.init.call(t)},dragMove:function(e){var t=this,n=t.dimension,i=t.axis,r=t.movable,a=r[i]+e;n.enabled&&((ae||a>n.max&&e>0)&&(e*=t.resistance),r.translateAxis(i,e),t.trigger(C,t))}}),Q=m.extend({init:function(e){var t,n,i,r,a=this;T(a,{elastic:!0},e),i=a.elastic?.5:0,r=a.movable,a.x=t=new j({axis:"x",dimension:a.dimensions.x,resistance:i,movable:r}),a.y=n=new j({axis:"y",dimension:a.dimensions.y,resistance:i,movable:r}),a.userEvents.bind(["move","end","gesturestart","gesturechange"],{gesturestart:function(e){a.gesture=e},gesturechange:function(e){var i,o=a.gesture,s=o.center,l=e.center,c=e.distance/o.distance,u=a.dimensions.minScale;r.scale<=u&&1>c&&(c+=.8*(1-c)),i={x:(r.x-s.x)*c+l.x-r.x,y:(r.y-s.y)*c+l.y-r.y},r.scaleWith(c),t.dragMove(i.x),n.dragMove(i.y),a.dimensions.rescale(r.scale),a.gesture=e,e.preventDefault()},move:function(e){e.event.target.tagName.match(/textarea|input/i)||(t.dimension.enabled||n.dimension.enabled?(t.dragMove(e.x.delta),n.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end:function(e){e.preventDefault()}})}}),R=p.transitions.prefix+"Transform";c=p.hasHW3D?function(e,t,n){return"translate3d("+e+"px,"+t+"px,0) scale("+n+")"}:function(e,t,n){return"translate("+e+"px,"+t+"px) scale("+n+")"},u=_.extend({init:function(t){var n=this;_.fn.init.call(n),n.element=e(t),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(c(n.x,n.y,n.scale))},translateAxis:function(e,t){this[e]+=t,this.refresh()},scaleTo:function(e){this.scale=e,this.refresh()},scaleWith:function(e){this.scale*=e,this.refresh()},translate:function(e){this.x+=e.x,this.y+=e.y,this.refresh()},moveAxis:function(e,t){this[e]=t,this.refresh()},moveTo:function(e){T(this,e),this.refresh()},refresh:function(){var e=this,t=c(e.x,e.y,e.scale);t!=e.coordinates&&(e.element[0].style[R]=t,e._saveCoordinates(t),e.trigger(C))},_saveCoordinates:function(e){this.coordinates=e}}),f=x.extend({init:function(e,t){var n,i=this;x.fn.init.call(i,e,t),n=i.options.group,n in S?S[n].push(i):S[n]=[i]},events:[L,N,F],options:{name:"DropTarget",group:"default"},destroy:function(){var e,t=this.options.group,n=S[t]||w[t];if(n.length>1){for(x.fn.destroy.call(this),e=0;e