//>>built
define("dojox/gfx/silverlight","dojo/_base/kernel,dojo/_base/lang,dojo/_base/declare,dojo/_base/Color,dojo/_base/array,dojo/dom-geometry,dojo/dom,dojo/_base/sniff,./_base,./shape,./path".split(","),function(l,j,i,y,p,q,o,z,f,h,r){function s(a){var b=f.normalizeColor(a),a=b.toHex(),b=Math.round(255*b.a),b=(0>b?0:255<b?255:b).toString(16);return"#"+(2>b.length?"0"+b:b)+a.slice(1)}function k(a,b){var c={target:a,currentTarget:a,preventDefault:function(){},stopPropagation:function(){}};try{if(b.source)c.target=
b.source,c.gfxTarget=h.byId(c.target.tag)}catch(g){}if(b)try{c.ctrlKey=b.ctrl;c.shiftKey=b.shift;var e=b.getPosition(null);c.x=c.offsetX=c.layerX=e.x;c.y=c.offsetY=c.layerY=e.y;var d=n[a.getHost().content.root.name],f=q.position(d);c.clientX=f.x+e.x;c.clientY=f.y+e.y}catch(i){}return c}function t(a,b){var c={keyCode:b.platformKeyCode,ctrlKey:b.ctrl,shiftKey:b.shift};try{if(b.source)c.target=b.source,c.gfxTarget=h.byId(c.target.tag)}catch(g){}return c}var d=f.silverlight={};l.experimental("dojox.gfx.silverlight");
var u={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]},v={normal:400,bold:700},A={butt:"Flat",round:"Round",square:"Square"},B={bevel:"Bevel",round:"Round"},w={serif:"Times New Roman",times:"Times New Roman","sans-serif":"Arial",helvetica:"Arial",monotone:"Courier New",courier:"Courier New"};d.Shape=i("dojox.gfx.silverlight.Shape",h.Shape,{destroy:function(){this.rawNode=
null;h.Shape.prototype.destroy.apply(this,arguments)},setFill:function(a){var b=this.rawNode.getHost().content;if(!a)return this.fillStyle=null,this._setFillAttr(null),this;if("object"==typeof a&&"type"in a){switch(a.type){case "linear":this.fillStyle=a=f.makeParameters(f.defaultLinearGradient,a);var c=b.createFromXaml("<LinearGradientBrush/>");c.mappingMode="Absolute";c.startPoint=a.x1+","+a.y1;c.endPoint=a.x2+","+a.y2;p.forEach(a.colors,function(a){var e=b.createFromXaml("<GradientStop/>");e.offset=
a.offset;e.color=s(a.color);c.gradientStops.add(e)});this._setFillAttr(c);break;case "radial":this.fillStyle=a=f.makeParameters(f.defaultRadialGradient,a);var g=b.createFromXaml("<RadialGradientBrush/>"),e=f.matrix.multiplyPoint(f.matrix.invert(this._getAdjustedMatrix()),a.cx,a.cy),e=e.x+","+e.y;g.mappingMode="Absolute";g.gradientOrigin=e;g.center=e;g.radiusX=g.radiusY=a.r;p.forEach(a.colors,function(a){var c=b.createFromXaml("<GradientStop/>");c.offset=a.offset;c.color=s(a.color);g.gradientStops.add(c)});
this._setFillAttr(g);break;case "pattern":this.fillStyle=null,this._setFillAttr(null)}return this}this.fillStyle=a=f.normalizeColor(a);e=b.createFromXaml("<SolidColorBrush/>");e.color=a.toHex();e.opacity=a.a;this._setFillAttr(e);return this},_setFillAttr:function(a){this.rawNode.fill=a},setStroke:function(a){var b=this.rawNode.getHost().content,c=this.rawNode;if(!a)return this.strokeStyle=null,c.stroke=null,this;if("string"==typeof a||j.isArray(a)||a instanceof y)a={color:a};a=this.strokeStyle=f.makeParameters(f.defaultStroke,
a);a.color=f.normalizeColor(a.color);if(a)if(b=b.createFromXaml("<SolidColorBrush/>"),b.color=a.color.toHex(),b.opacity=a.color.a,c.stroke=b,c.strokeThickness=a.width,c.strokeStartLineCap=c.strokeEndLineCap=c.strokeDashCap=A[a.cap],"number"==typeof a.join?(c.strokeLineJoin="Miter",c.strokeMiterLimit=a.join):c.strokeLineJoin=B[a.join],b=a.style.toLowerCase(),b in u&&(b=u[b]),b instanceof Array){b=j.clone(b);if("butt"!=a.cap){for(a=0;a<b.length;a+=2)--b[a],1>b[a]&&(b[a]=1);for(a=1;a<b.length;a+=2)++b[a]}c.strokeDashArray=
b.join(",")}else c.strokeDashArray=null;return this},_getParentSurface:function(){for(var a=this.parent;a&&!(a instanceof f.Surface);a=a.parent);return a},_applyTransform:function(){var a=this._getAdjustedMatrix(),b=this.rawNode;if(a){var c=this.rawNode.getHost().content,g=c.createFromXaml("<MatrixTransform/>"),c=c.createFromXaml("<Matrix/>");c.m11=a.xx;c.m21=a.xy;c.m12=a.yx;c.m22=a.yy;c.offsetX=a.dx;c.offsetY=a.dy;g.matrix=c;b.renderTransform=g}else b.renderTransform=null;return this},setRawNode:function(a){a.fill=
null;a.stroke=null;this.rawNode=a;this.rawNode.tag=this.getUID()},_moveToFront:function(){var a=this.parent.rawNode.children,b=this.rawNode;a.remove(b);a.add(b);return this},_moveToBack:function(){var a=this.parent.rawNode.children,b=this.rawNode;a.remove(b);a.insert(0,b);return this},_getAdjustedMatrix:function(){return this.matrix},setClip:function(a){this.inherited(arguments);var b=this.rawNode;if(a){var c=a?"width"in a?"rect":"cx"in a?"ellipse":"points"in a?"polyline":"d"in a?"path":null:null;
if(a&&!c)return this;var g=this.getBoundingBox()||{x:0,y:0,width:0,height:0},e="1,0,0,1,"+-g.x+","+-g.y;switch(c){case "rect":b.clip=b.getHost().content.createFromXaml("<RectangleGeometry/>");b.clip.rect=a.x+","+a.y+","+a.width+","+a.height;b.clip.transform=e;break;case "ellipse":b.clip=b.getHost().content.createFromXaml("<EllipseGeometry/>");b.clip.center=a.cx+","+a.cy;b.clip.radiusX=a.rx;b.clip.radiusY=a.ry;b.clip.transform="1,0,0,1,"+-g.x+","+-g.y;break;case "polyline":if(2<a.points.length){var e=
b.getHost().content.createFromXaml("<PathGeometry/>"),d=b.getHost().content.createFromXaml("<PathFigure/>");d.StartPoint=a.points[0]+","+a.points[1];for(var f=2;f<=a.points.length-2;f+=2)c=b.getHost().content.createFromXaml("<LineSegment/>"),c.Point=a.points[f]+","+a.points[f+1],d.segments.add(c);e.figures.add(d);e.transform="1,0,0,1,"+-g.x+","+-g.y;b.clip=e}}}else b.clip=null;return this}});d.Group=i("dojox.gfx.silverlight.Group",d.Shape,{constructor:function(){h.Container._init.call(this)},setRawNode:function(a){this.rawNode=
a;this.rawNode.tag=this.getUID()},destroy:function(){this.clear(!0);d.Shape.prototype.destroy.apply(this,arguments)}});d.Group.nodeType="Canvas";d.Rect=i("dojox.gfx.silverlight.Rect",[d.Shape,h.Rect],{setShape:function(a){this.shape=f.makeParameters(this.shape,a);this.bbox=null;var a=this.rawNode,b=this.shape;a.width=b.width;a.height=b.height;a.radiusX=a.radiusY=b.r;return this._applyTransform()},_getAdjustedMatrix:function(){var a=this.matrix,b=this.shape,b={dx:b.x,dy:b.y};return new f.Matrix2D(a?
[a,b]:b)}});d.Rect.nodeType="Rectangle";d.Ellipse=i("dojox.gfx.silverlight.Ellipse",[d.Shape,h.Ellipse],{setShape:function(a){this.shape=f.makeParameters(this.shape,a);this.bbox=null;var a=this.rawNode,b=this.shape;a.width=2*b.rx;a.height=2*b.ry;return this._applyTransform()},_getAdjustedMatrix:function(){var a=this.matrix,b=this.shape,b={dx:b.cx-b.rx,dy:b.cy-b.ry};return new f.Matrix2D(a?[a,b]:b)}});d.Ellipse.nodeType="Ellipse";d.Circle=i("dojox.gfx.silverlight.Circle",[d.Shape,h.Circle],{setShape:function(a){this.shape=
f.makeParameters(this.shape,a);this.bbox=null;a=this.rawNode;a.width=a.height=2*this.shape.r;return this._applyTransform()},_getAdjustedMatrix:function(){var a=this.matrix,b=this.shape,b={dx:b.cx-b.r,dy:b.cy-b.r};return new f.Matrix2D(a?[a,b]:b)}});d.Circle.nodeType="Ellipse";d.Line=i("dojox.gfx.silverlight.Line",[d.Shape,h.Line],{setShape:function(a){this.shape=f.makeParameters(this.shape,a);this.bbox=null;var a=this.rawNode,b=this.shape;a.x1=b.x1;a.y1=b.y1;a.x2=b.x2;a.y2=b.y2;return this}});d.Line.nodeType=
"Line";d.Polyline=i("dojox.gfx.silverlight.Polyline",[d.Shape,h.Polyline],{setShape:function(a,b){a&&a instanceof Array?(this.shape=f.makeParameters(this.shape,{points:a}),b&&this.shape.points.length&&this.shape.points.push(this.shape.points[0])):this.shape=f.makeParameters(this.shape,a);this.bbox=null;this._normalizePoints();for(var c=this.shape.points,d=[],e=0;e<c.length;++e)d.push(c[e].x,c[e].y);this.rawNode.points=d.join(",");return this}});d.Polyline.nodeType="Polyline";d.Image=i("dojox.gfx.silverlight.Image",
[d.Shape,h.Image],{setShape:function(a){this.shape=f.makeParameters(this.shape,a);this.bbox=null;var a=this.rawNode,b=this.shape;a.width=b.width;a.height=b.height;a.source=b.src;return this._applyTransform()},_getAdjustedMatrix:function(){var a=this.matrix,b=this.shape,b={dx:b.x,dy:b.y};return new f.Matrix2D(a?[a,b]:b)},setRawNode:function(a){this.rawNode=a;this.rawNode.tag=this.getUID()}});d.Image.nodeType="Image";d.Text=i("dojox.gfx.silverlight.Text",[d.Shape,h.Text],{setShape:function(a){this.shape=
f.makeParameters(this.shape,a);this.bbox=null;var a=this.rawNode,b=this.shape;a.text=""+b.text;a.textDecorations="underline"===b.decoration?"Underline":"None";a["Canvas.Left"]=-1E4;a["Canvas.Top"]=-1E4;if(!this._delay)this._delay=window.setTimeout(j.hitch(this,"_delayAlignment"),10);return this},_delayAlignment:function(){var a=this.rawNode,b=this.shape,c,d;try{c=a.actualWidth,d=a.actualHeight}catch(e){return}var f=b.x;d=b.y-0.75*d;switch(b.align){case "middle":f-=c/2;break;case "end":f-=c}this._delta=
{dx:f,dy:d};a["Canvas.Left"]=0;a["Canvas.Top"]=0;this._applyTransform();delete this._delay},_getAdjustedMatrix:function(){var a=this.matrix,b=this._delta;return new f.Matrix2D(a?b?[a,b]:a:b?b:{})},setStroke:function(){return this},_setFillAttr:function(a){this.rawNode.foreground=a},setRawNode:function(a){this.rawNode=a;this.rawNode.tag=this.getUID()},getTextWidth:function(){return this.rawNode.actualWidth}});d.Text.nodeType="TextBlock";d.Path=i("dojox.gfx.silverlight.Path",[d.Shape,r.Path],{_updateWithSegment:function(a){this.inherited(arguments);
var b=this.shape.path;if("string"==typeof b)this.rawNode.data=b?b:null},setShape:function(a){this.inherited(arguments);var b=this.shape.path;this.rawNode.data=b?b:null;return this}});d.Path.nodeType="Path";d.TextPath=i("dojox.gfx.silverlight.TextPath",[d.Shape,r.TextPath],{_updateWithSegment:function(){},setShape:function(){},_setText:function(){}});d.TextPath.nodeType="text";var n={},C=new Function;d.Surface=i("dojox.gfx.silverlight.Surface",h.Surface,{constructor:function(){h.Container._init.call(this)},
destroy:function(){this.clear(!0);window[this._onLoadName]=C;delete n[this._nodeName];this.inherited(arguments)},setDimensions:function(a,b){this.width=f.normalizedLength(a);this.height=f.normalizedLength(b);var c=this.rawNode&&this.rawNode.getHost();if(c)c.width=a,c.height=b;return this},getDimensions:function(){var a=this.rawNode&&this.rawNode.getHost(),a=a?{width:a.content.actualWidth,height:a.content.actualHeight}:null;if(0>=a.width)a.width=this.width;if(0>=a.height)a.height=this.height;return a}});
d.createSurface=function(a,b,c){if(!b&&!c)var g=q.position(a),b=b||g.w,c=c||g.h;"number"==typeof b&&(b+="px");"number"==typeof c&&(c+="px");var e=new d.Surface,a=o.byId(a);e._parent=a;e._nodeName=f._base._getUniqueId();g=a.ownerDocument.createElement("script");g.type="text/xaml";g.id=f._base._getUniqueId();g.text="<?xml version='1.0'?><Canvas xmlns='http://schemas.microsoft.com/client/2007' Name='"+e._nodeName+"'/>";a.parentNode.insertBefore(g,a);e._nodes.push(g);var h=f._base._getUniqueId(),i="__"+
f._base._getUniqueId()+"_onLoad";e._onLoadName=i;window[i]=function(){if(!e.rawNode)e.rawNode=o.byId(h).content.root,n[e._nodeName]=a,e.onLoad(e)};g=z("safari")?"<embed type='application/x-silverlight' id='"+h+"' width='"+b+"' height='"+c+" background='transparent' source='#"+g.id+"' windowless='true' maxFramerate='60' onLoad='"+i+"' onError='__dojoSilverlightError' /><iframe style='visibility:hidden;height:0;width:0'/>":"<object type='application/x-silverlight' data='data:application/x-silverlight,' id='"+
h+"' width='"+b+"' height='"+c+"'><param name='background' value='transparent' /><param name='source' value='#"+g.id+"' /><param name='windowless' value='true' /><param name='maxFramerate' value='60' /><param name='onLoad' value='"+i+"' /><param name='onError' value='__dojoSilverlightError' /></object>";a.innerHTML=g;g=o.byId(h);g.content&&g.content.root?(e.rawNode=g.content.root,n[e._nodeName]=a):(e.rawNode=null,e.isLoaded=!1);e._nodes.push(g);e.width=f.normalizedLength(b);e.height=f.normalizedLength(c);
return e};__dojoSilverlightError=function(){};var m=h.Container,l={add:function(a){this!=a.getParent()&&(m.add.apply(this,arguments),this.rawNode.children.add(a.rawNode));return this},remove:function(a,b){if(this==a.getParent()){var c=a.rawNode.getParent();c&&c.children.remove(a.rawNode);m.remove.apply(this,arguments)}return this},clear:function(){this.rawNode.children.clear();return m.clear.apply(this,arguments)},getBoundingBox:m.getBoundingBox,_moveChildToFront:m._moveChildToFront,_moveChildToBack:m._moveChildToBack},
i={createObject:function(a,b){if(!this.rawNode)return null;var c=new a,d=this.rawNode.getHost().content.createFromXaml("<"+a.nodeType+"/>");c.setRawNode(d);c.setShape(b);this.add(c);return c}};j.extend(d.Text,{_setFont:function(){var a=this.fontStyle,b=this.rawNode,c=a.family.toLowerCase();b.fontStyle="italic"==a.style?"Italic":"Normal";b.fontWeight=a.weight in v?v[a.weight]:a.weight;b.fontSize=f.normalizedLength(a.size);b.fontFamily=c in w?w[c]:a.family;if(!this._delay)this._delay=window.setTimeout(j.hitch(this,
"_delayAlignment"),10)}});j.extend(d.Group,l);j.extend(d.Group,h.Creator);j.extend(d.Group,i);j.extend(d.Surface,l);j.extend(d.Surface,h.Creator);j.extend(d.Surface,i);var x={onclick:{name:"MouseLeftButtonUp",fix:k},onmouseenter:{name:"MouseEnter",fix:k},onmouseleave:{name:"MouseLeave",fix:k},onmouseover:{name:"MouseEnter",fix:k},onmouseout:{name:"MouseLeave",fix:k},onmousedown:{name:"MouseLeftButtonDown",fix:k},onmouseup:{name:"MouseLeftButtonUp",fix:k},onmousemove:{name:"MouseMove",fix:k},onkeydown:{name:"KeyDown",
fix:t},onkeyup:{name:"KeyUp",fix:t}},l={connect:function(a,b,c){0===a.indexOf("mouse")&&(a="on"+a);var d,e=a in x?x[a]:{name:a,fix:function(){return{}}};d=2<arguments.length?this.getEventSource().addEventListener(e.name,function(a,d){j.hitch(b,c)(e.fix(a,d))}):this.getEventSource().addEventListener(e.name,function(a,c){b(e.fix(a,c))});return{name:e.name,token:d}},disconnect:function(a){try{this.getEventSource().removeEventListener(a.name,a.token)}catch(b){}}};j.extend(d.Shape,l);j.extend(d.Surface,
l);f.equalSources=function(a,b){return a&&b&&a.equals(b)};return d});