/* * Kendo UI Complete v2013.3.1119 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Complete commercial licenses may be obtained at * https://www.kendoui.com/purchase/license-agreement/kendo-ui-complete-commercial.aspx * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(define){return define(["./kendo.dataviz.core.min","./kendo.dataviz.svg.min","./kendo.dataviz.canvas.min"],function(){!function(t,e){function a(t,e,a){return t.substring(e,e+a)}var n,r,i,o,h,s,d=window.kendo,u=t.extend,c=d.deepExtend,l=t.inArray,p=t.isPlainObject,v=d.dataviz,f=d.ui.Widget,g=v.Box2D,b=v.Text,m=300,w=100,S=10,C=/^\d+$/,B=/^[a-z0-9]+$/i,x="Character '{0}' is not valid for symbology {1}",k=d.Class.extend({init:function(t){this.setOptions(t)},setOptions:function(t){var e=this;e.options=u({},e.options,t),e.quietZoneLength=e.options.addQuietZone?2*e.options.quietZoneLength:0},encode:function(t,a,n){var r=this;return t!==e&&(t+=""),r.initValue(t,a,n),r.options.addQuietZone&&r.addQuietZone(),r.addData(),r.options.addQuietZone&&r.addQuietZone(),{baseUnit:r.baseUnit,pattern:r.pattern}},options:{quietZoneLength:S,addQuietZone:!0,addCheckSum:!0},initValue:function(){},addQuietZone:function(){this.pattern.push(this.options.quietZoneLength||S)},addData:function(){},invalidCharacterError:function(t){throw Error(d.format(x,t,this.name))}}),A={},T=k.extend({minBaseUnitLength:.7,addData:function(){var t,e=this,a=e.value;for(e.addStart(),t=0;t127?e.invalidCharacterError(t):e.addExtended(t.charCodeAt(0))},addExtended:function(t){var a,n,r,i=this;for(n=0;n=97&&122>=t){var e=this;return[e.characterMap[e.shiftCharacters[0]],e.characterMap[String.fromCharCode(t-32)]]}},function(t){if(t>=33&&58>=t){var e=this;return[e.characterMap[e.shiftCharacters[1]],e.characterMap[String.fromCharCode(t+32)]]}},function(t){if(t>=1&&26>=t){var e=this;return[e.characterMap[e.shiftCharacters[2]],e.characterMap[String.fromCharCode(t+64)]]}},function(t){var e,a,n,r=this;if(r.specialAsciiCodes[t])for(e=[],n=0;ni;)r=parseFloat((r-.1).toFixed(1));if(n>t)throw e=Math.ceil(a.getBaseWidth(i)*n),Error("Insufficient width. The minimum width for value: "+a.value+" is: "+e);a.ratio=r,a.baseUnit=t,a.patternString=a.patternString.substring(0,a.patternString.length-1),a.pattern=a.pattern.concat(a.patternString.replace(/ratio/g,r).split(a.splitCharacter))},getBaseUnit:function(t){return this.width/this.getBaseWidth(t)},getBaseWidth:function(t){var e=this,a=3*(t+2);return e.quietZoneLength+a*(e.dataLength+2)+e.gapWidth*(e.dataLength+1)},addStart:function(){var t=this;t.addPattern(t.characterMap.START.pattern),t.addCharacterGap()},addBase:function(t){this.addPattern(t.pattern),this.addCharacterGap()},addStop:function(){this.addPattern(this.characterMap.START.pattern)},addPattern:function(t){for(var e=0;e=0;a--)o+=n.weightedValue(r[a],i-a,n.cCheckSumTotal);for(t=o%n.checkSumMod,o=n.weightedValue(t,1,n.kCheckSumTotal),a=i-1;a>=0;a--)o+=n.weightedValue(r[a],i-a+1,n.kCheckSumTotal);return e=o%n.checkSumMod,[t,e]},_findCharacterByValue:function(t){for(var e in this.characterMap)if(this.characterMap[e].value===t)return e},weightedValue:function(t,e,a){return(e%a||a)*t},addPattern:function(t){var e,a;for(a=0;a=0&&(a=i.substr(t.index).match(/\d{4,}/g),a&&(o=i.indexOf(a[0],t.index)));(e=t.value.charCodeAt(t.index))>=0&&n.isCode(e)&&t.index=0&&e._moves.push(e._moveFNC),l(e.shiftKey,t)>=0&&e._moves.push(e._shiftState),e._moves.push(e._moveState)},_moveFNC:function(t){return t.fnc?(t.fnc=!1,t.previousState==this.key):e},_shiftState:function(t){var a=this;return t.previousState==a.shiftKey&&(t.index+1>=t.value.length||a.encoding[a.shiftKey].is(t.value,t.index+1))?(a.encoding.addPattern(a.SHIFT),t.shifted=!0,!0):e},_moveState:function(){return this.encoding.addPattern(this.MOVE),!0},SHIFT:98}),i={},i.A=r.extend({key:"A",shiftKey:"B",isCode:function(t){return t>=0&&96>t},getValue:function(t){return 32>t?t+64:t-32},MOVE:101,START:103}),i.B=r.extend({key:"B",shiftKey:"A",isCode:function(t){return t>=32&&128>t},getValue:function(t){return t-32},MOVE:100,START:104}),i.C=n.extend({key:"C",addStart:function(){this.encoding.addPattern(this.START)},is:function(t,e){var n=a(t,e,4);return(e+4<=t.length||2==t.length)&&C.test(n)},move:function(){this.encoding.addPattern(this.MOVE)},pushState:function(t){for(var e;(e=a(t.value,t.index,2))&&C.test(e)&&2==e.length;)this.encoding.addPattern(parseInt(e,10)),t.index+=2},getValue:function(t){return t},MOVE:99,START:105}),i.FNC4=n.extend({key:"FNC4",dependentStates:["A","B"],init:function(t,e){this.encoding=t,this._initSubStates(e)},addStart:function(t){var e=t.value.charCodeAt(0)-128,a=this._getSubState(e);this.encoding[a].addStart()},is:function(t,e){var a=t.charCodeAt(e);return this.isCode(a)},isCode:function(t){return t>=128&&256>t},pushState:function(t){var e,a=this,n=a._initSubState(t),r=a.encoding,i=n.value.length;if(t.index+=i,3>i)for(;n.index=0&&a.subStates.push(t[e])},_getSubState:function(t){var e,a=this;for(e=0;e=0},pushState:function(t){var e,a,n,r=this,i=r.encoding,o=t.value.replace(/\s/g,""),h=RegExp("["+r.startAI+r.endAI+"]","g"),s=t.index,d={state:r.startState};for(i.addPattern(r.START);;){if(d.index=0,n=o.charAt(s)===r.startAI?2:0,e=n>0?r.getBySeparator(o,s):r.getByLength(o,s),e.ai.length)a=s+n+e.id.length+e.ai.length;else if(a=o.indexOf(r.startAI,s+1),0>a){if(s+e.ai.max+e.id.length+n=o.length)break;s=a,d.state!=r.startState&&(i[r.startState].move(d),d.state=r.startState),e.ai.length||i.addPattern(r.START)}t.index=t.value.length},validate:function(t,e){var a=e.substr(t.id.length),n=t.ai;if(!n.type&&!C.test(a))throw Error("Application identifier "+t.id+" is numeric only but contains non numeric character(s).");if("alphanumeric"==n.type&&!B.test(a))throw Error("Application identifier "+t.id+" is alphanumeric only but contains non alphanumeric character(s).");if(n.length&&n.length!==a.length)throw Error("Application identifier "+t.id+" must be "+n.length+" characters long.");if(n.min&&n.min>a.length)throw Error("Application identifier "+t.id+" must be at least "+n.min+" characters long.");if(n.max&&n.max=i;i++)if(n=a(t,e,i),r=o.getAI(n)||o.getAI(n.substring(0,n.length-1)))return{id:n,ai:r};o.unsupportedAIError(n)},unsupportedAIError:function(t){throw Error(d.format("'{0}' is not a supported Application Identifier"),t)},getBySeparator:function(t,e){var a=this,n=t.indexOf(a.startAI,e),r=t.indexOf(a.endAI,n),i=t.substring(n+1,r),o=a.getAI(i)||a.getAI(i.substr(i.length-1));return o||a.unsupportedAIError(i),{ai:o,id:i}},getAI:function(t){var e,a,n,r=this.applicationIdentifiers,i=r.multiKey;if(r[t])return r[t];for(e=0;e=0)return i[e].type;if(i[e].ranges)for(a=i[e].ranges,n=0;n=t.value.length)break;t.shifted?(a=t.state,t.state=t.previousState,t.previousState=a,t.shifted=!1):(t.previousState=t.state,t.state=n.getNextState(t,e),n[t.state].move(t))}},addStart:function(t){this[t.state].addStart(t),this.position=1},addCheckSum:function(){var t=this;t.checksum=t.checkSum%103,t.addPattern(t.checksum)},addStop:function(){this.addPattern(this.STOP)},setBaseUnit:function(){var t=this;t.baseUnit=t.width/(t.totalUnits+t.quietZoneLength)},addPattern:function(t){var e,a,n=this,r=""+n.characterMap[t];for(a=0;an;n++)e=((o-n)%6||6)+1,r+=e*t.charAt(n);return a=(i-r%i)%i,10!=a?[a]:[1,0]},Modulo11Modulo10:function(t){var e,a=this.Modulo11(t);return e=t+a[0],a.concat(this.Modulo10(e))},Modulo10Modulo10:function(t){var e,a=this.Modulo10(t);return e=t+a[0],a.concat(this.Modulo10(e))}},characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:""}),A.msimod10=h.extend({name:"MSI Modulo10",checkSumType:"Modulo10"}),A.msimod11=h.extend({name:"MSI Modulo11",checkSumType:"Modulo11"}),A.msimod1110=h.extend({name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"}),A.msimod1010=h.extend({name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"}),A.code11=k.extend({name:"Code 11",cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221",initValue:function(t,e){var a=this;a.pattern=[],a.value=t,a.width=e,a.totalUnits=0},addData:function(){var t,e=this,a=e.value;for(e.addPattern(e.START),t=0;t=e.kCheckSumMinLength&&(t=(r+e.getWeightedSum(a,n,e.kCheckSumTotal))%e.checkSumMod,e.checksum+=t,e.addPattern(e.characterMap[t]))},getWeightedSum:function(t,e,a){var n,r=0;for(n=0;n0&&(a.width=e.width()),e.height()>0&&(a.height=e.height()),t.options.width&&(a.width=t.options.width),t.options.height&&(a.height=t.options.height),a},value:function(t){var a=this;return t===e?a.options.value:(a.options.value=t+"",a.redraw(),e)},_renderElements:function(t,e,a){var n,r,i,o=this,h=0+o.options.padding.left;for(i=0;i