(function(){
'use strict';var Jt=function(a,b){var c;if(c=null!=b)c=$APP.y(a),c=b.g?b.g(c):b.call(null,c),c=$APP.La(c);if(c)throw Error("Validator rejected reference state");a.dd=b},Kt=function(a){return function(b){return function(){function c(g,h){return $APP.p(a.g?a.g(h):a.call(null,h))?b.h?b.h(g,h):b.call(null,g,h):g}function d(g){return b.g?b.g(g):b.call(null,g)}function e(){return b.m?b.m():b.call(null)}var f=null;f=function(g,h){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,
g);case 2:return c.call(this,g,h)}throw Error("Invalid arity: "+arguments.length);};f.m=e;f.g=d;f.h=c;return f}()}},Mt=function(a,b){var c=Lt;$APP.ic(c,a,b);return c},Nt=function(a){var b=Lt;$APP.jc(b,a);return b},Ot=function(a,b,c){var d=$APP.Md;for(b=$APP.C(b);;)if(null!=b){a=$APP.P.i(a,$APP.D(b),d);if(d===a)return c;b=$APP.E(b)}else return a},Pt=function(a,b,c,d,e){this.meta=a;this.f=b;this.zd=c;this.bd=d;this.next=e;this.o=26083532;this.B=1},Qt=function(a,b){return new Pt(null,a,null,b,null)},
Rt=function(a,b){return new $APP.se(null,function(){var c=$APP.C(b);if(c){var d=$APP.D(c);d=a.g?a.g(d):a.call(null,d);c=$APP.p(d)?$APP.Q($APP.D(c),Rt(a,$APP.Sc(c))):null}else c=null;return c},null,null)},Tt=function(a,b){var c=$APP.Ke.i(St,a,b);return $APP.Q(c,$APP.sf(function(d){return c===d},b))},Ut=function(a){return function d(c){return new $APP.se(null,function(){return $APP.Q(c,$APP.p($APP.Ad.g?$APP.Ad.g(c):$APP.Ad.call(null,c))?$APP.qf(d,$APP.K([$APP.C.g?$APP.C.g(c):$APP.C.call(null,c)])):
null)},null,null)}(a)},Vt=function(a){return $APP.rf(function(b){return!$APP.Ad(b)},$APP.Sc(Ut(a)))},Wt=function(a,b){var c=$APP.Cm(a);return $APP.Tm(a,$APP.p(c)?new $APP.T(null,1,5,$APP.V,[c],null):$APP.Nf,b)},Xt=function(a,b){var c=new $APP.ya,d=$APP.Fa,e=$APP.Ga;$APP.Fa=!0;$APP.Ga=function(f){return c.append(f)};try{$APP.an.call(null,Wt(a,b))}finally{$APP.Ga=e,$APP.Fa=d}return $APP.x.g(c)},Yt=function(a,b){this.f=a;this.cc=b;this.zc=null;this.o=2153807872;this.B=0},Zt=function(a){return a.g?a.g(0):
a.call(null,0)},$t=function(a){var b=Zt(a);a=$APP.Fr.g($APP.wd(a));return a.g?a.g(b):a.call(null,b)},au=function(a){if($APP.p($t(a))){var b=Zt(a);a=$APP.Rr.g($APP.wd(a));return a.g?a.g(b):a.call(null,b)}throw"called children on a leaf node";},bu=function(a,b,c){a=$APP.$p.g($APP.wd(a));return a.h?a.h(b,c):a.call(null,b,c)},cu=function(a){if($APP.p($t(a))){var b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=au(a),e=$APP.C(d),f=$APP.D(e);e=$APP.E(e);return $APP.p(d)?$APP.vd(new $APP.T(null,2,5,$APP.V,[f,new $APP.n(null,
4,[$APP.kr,$APP.Nf,$APP.sq,$APP.p(c)?$APP.le.h($APP.sq.g(c),b):new $APP.T(null,1,5,$APP.V,[b],null),$APP.xq,c,$APP.qr,e],null)],null),$APP.wd(a)):null}return null},du=function(a){var b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=$APP.Me(c);c=$APP.P.h(d,$APP.kr);var e=$APP.P.h(d,$APP.xq),f=$APP.P.h(d,$APP.sq),g=$APP.P.h(d,$APP.qr);d=$APP.P.h(d,$APP.Er);return $APP.p(f)?(f=null==f?null:$APP.Fb(f),$APP.vd($APP.p(d)?new $APP.T(null,2,5,$APP.V,[bu(a,f,$APP.pf.h(c,$APP.Q(b,g))),$APP.p(e)?$APP.Y.i(e,$APP.Er,!0):
e],null):new $APP.T(null,2,5,$APP.V,[f,e],null),$APP.wd(a))):null},eu=function(a){var b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=$APP.M(a,2,null),e=$APP.M(a,3,null),f=$APP.M(a,4,null);a=$APP.M(a,5,null);return DOMMatrixReadOnly.fromMatrix({a:b,b:c,c:d,d:e,e:f,f:a})},fu=function(a){a=null==a?null:cu(a);if(null==a)a=null;else{var b=$APP.M(a,0,null),c=$APP.M(a,1,null);c=$APP.Me(c);var d=$APP.P.h(c,$APP.kr),e=$APP.P.h(c,$APP.qr);a=$APP.p($APP.p(c)?e:c)?$APP.vd(new $APP.T(null,2,5,$APP.V,[$APP.pd(e),$APP.Y.l(c,
$APP.kr,$APP.Ke.u($APP.le,d,b,$APP.zh(e)),$APP.K([$APP.qr,null]))],null),$APP.wd(a)):a}return null==a?null:Zt(a)},hu=function(a){var b=gu;$APP.Z.h(b,function(c){var d=new $APP.ie(null,a,null,1,null);d=bu(c,Zt(c),$APP.Q(d,au(c)));$APP.M(c,0,null);var e=$APP.M(c,1,null);c=$APP.vd(new $APP.T(null,2,5,$APP.V,[d,$APP.Y.i(e,$APP.Er,!0)],null),$APP.wd(c));return cu(c)});return fu($APP.y(b))},iu=function(){var a=gu;$APP.Z.h(a,function(b){return $APP.p(fu(du(b)))?du(b):b});return fu($APP.y(a))},ju=function(){var a=
gu;$APP.Z.h(a,function(b){return $APP.p(fu(cu(b)))?cu(b):b});return fu($APP.y(a))},lu=function(a){a=$APP.Ke.h(ku,$APP.qf($APP.Pn.h($APP.Qn,2),$APP.K([a])))+1;return $APP.p(isFinite(a))?a:1},mu=function(a){function b(c,d,e){return $APP.p(e)?$APP.le.h(c,d):c}return b(b(b(b($APP.vh([$APP.Th.g(a.key.toLowerCase())]),$APP.Wr,a.ctrlKey),$APP.rq,a.altKey),$APP.Op,a.shiftKey),$APP.Qp,a.metaKey)},nu=function(a,b){if($APP.p(function(){var c=b.repeat;return $APP.p(c)?c:$APP.G.h("INPUT",b.target.tagName)||$APP.G.h("TEXTAREA",
b.target.tagName)}()))return null;$APP.ci($APP.K([mu(b)]));a=$APP.P.i(a,mu(b),function(){return $APP.Rc});return a.m?a.m():a.call(null)},ou=function(a){switch(a){case "resistor":return"R";case "inductor":return"L";case "capacitor":return"C";case "diode":return"D";case "vsource":return"V";case "isource":return"I";case "npn":return"Q";case "pnp":return"Q";case "pmos":return"M";case "nmos":return"M";case "wire":return"W";case "port":return"P";default:return"X"}},qu=function(a){var b=$APP.lf.h(function(c){return[$APP.x.g(pu),
":",$APP.x.g(ou(a)),$APP.x.g(c)].join("")},$APP.E($APP.Gh(0,Number.MAX_VALUE)));return $APP.D($APP.sf($APP.y(Lt),b))},su=function(a){var b=$APP.Ua($APP.$o,$APP.yh($APP.mh($APP.y(Lt))),$APP.mh(a)),c=$APP.Ua(function(e,f){return $APP.dp.u(e,f,$APP.Bj,$APP.nm)},a,$APP.mh(a)),d=$APP.cm(1);$APP.Hl(function(){var e=function(){function g(h){var l=h[1];if(1===l){l=Nt(ru);var m=$APP.Z.i(Lt,$APP.pi,c);h[7]=l;return $APP.am(h,2,m)}return 2===l?(l=h[2],m=$APP.Z.i(Lt,function(){return function(q,r){return $APP.Ke.i($APP.Bj,
q,r)}}(),b),h[8]=l,$APP.am(h,3,m)):3===l?(l=h[2],m=Mt(ru,function(){return function(q,r,t,v){return hu(v)}}()),h[9]=l,$APP.bm(h,m)):null}return function(){function h(q){for(;;){a:try{for(;;){var r=g(q);if(!$APP.pe(r,$APP.$l)){var t=r;break a}}}catch(v){t=v;q[2]=t;if($APP.C(q[4]))q[1]=$APP.D(q[4]);else throw t;t=$APP.$l}if(!$APP.pe(t,$APP.$l))return t}}function l(){var q=[null,null,null,null,null,null,null,null,null,null];q[0]=m;q[1]=1;return q}var m=null;m=function(q){switch(arguments.length){case 0:return l.call(this);
case 1:return h.call(this,q)}throw Error("Invalid arity: "+arguments.length);};m.m=l;m.g=h;return m}()}(),f=function(){var g=e();g[6]=d;return g}();return $APP.Zl(f)});return d},tu=function(){var a=iu();return $APP.p(a)?su(a):null},uu=function(){var a=ju();return $APP.p(a)?su(a):null},yu=function(a,b){return new $APP.T(null,2,5,$APP.V,[vu,new $APP.n(null,3,[wu,a+25,xu,b+25,$APP.qr,5],null)],null)},Du=function(a,b,c){var d=$APP.M(a,0,null);a=$APP.M(a,1,null);return new $APP.T(null,5,5,$APP.V,[zu,2+
(d>a?d:a),b,c,new $APP.T(null,2,5,$APP.V,[Au,new $APP.n(null,4,[$APP.or,50,$APP.nr,50,Bu,50*d,Cu,50*a],null)],null)],null)},Eu=function(a,b,c,d,e){return new $APP.T(null,6,5,$APP.V,[$APP.Ke,zu,a,d,e,function(){return function h(g){return new $APP.se(null,function(){for(;;){var l=$APP.C(g);if(l){if($APP.Ed(l)){var m=$APP.sc(l),q=$APP.F(m),r=$APP.ve(q);a:for(var t=0;;)if(t<q){var v=$APP.rd(m,t),u=$APP.M(v,0,null),w=$APP.M(v,1,null);$APP.M(v,2,null);v=$APP.vd(new $APP.T(null,5,5,$APP.V,[c,50*u,50*w,
d,e],null),new $APP.n(null,1,[$APP.ij,new $APP.T(null,2,5,$APP.V,[u,w],null)],null));r.add(v);t+=1}else{m=!0;break a}return m?$APP.ye($APP.Ae(r),h($APP.tc(l))):$APP.ye($APP.Ae(r),null)}r=$APP.D(l);m=$APP.M(r,0,null);q=$APP.M(r,1,null);$APP.M(r,2,null);return $APP.Q($APP.vd(new $APP.T(null,5,5,$APP.V,[c,50*m,50*q,d,e],null),new $APP.n(null,1,[$APP.ij,new $APP.T(null,2,5,$APP.V,[m,q],null)],null)),h($APP.Sc(l)))}return null}},null,null)}(b)}()],null)},Hu=function(a){return new $APP.T(null,2,5,$APP.V,
[$APP.Sp,function(){return function d(c){return new $APP.se(null,function(){for(;;){var e=$APP.C(c);if(e){var f=e;if($APP.Ed(f)){var g=$APP.sc(f),h=$APP.F(g),l=$APP.ve(h);return function(){for(var q=0;;)if(q<h){var r=$APP.rd(g,q);$APP.ze(l,$APP.vd(new $APP.T(null,2,5,$APP.V,[Fu,new $APP.n(null,1,[Gu,$APP.lf.h(function(){return function(t){return 50*t}}(q,r,g,h,l,f,e),Vt(r))],null)],null),new $APP.n(null,1,[$APP.ij,r],null)));q+=1}else return!0}()?$APP.ye($APP.Ae(l),d($APP.tc(f))):$APP.ye($APP.Ae(l),
null)}var m=$APP.D(f);return $APP.Q($APP.vd(new $APP.T(null,2,5,$APP.V,[Fu,new $APP.n(null,1,[Gu,$APP.lf.h(function(){return function(q){return 50*q}}(m,f,e),Vt(m))],null)],null),new $APP.n(null,1,[$APP.ij,m],null)),d($APP.Sc(f)))}return null}},null,null)}(a)}()],null)},Ju=function(a,b,c,d){return new $APP.T(null,2,5,$APP.V,[Iu,new $APP.n(null,2,[$APP.$q,["rotate(",$APP.x.g(d)," ",$APP.x.g(50*a)," ",$APP.x.g(50*b),")"].join(""),Gu,$APP.lf.h(function(e){return 50*e},new $APP.T(null,6,5,$APP.V,[a,b,
a+c,b+c,a+c,b-c],null))],null)],null)},Nu=function(a,b){return new $APP.T(null,3,5,$APP.V,[Ku,new $APP.n(null,3,[Lu,"left",Mu,"bottom",$APP.$q,eu($APP.$q.g(a)).translate(b/-2*50,b/-2*50).inverse().translate(2.5,-32.5).toString()],null),$APP.fj.g(a)],null)},Ou=function(a,b){return new $APP.T(null,7,5,$APP.V,[zu,3,a,b,new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,4,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[.5,1.5],null),new $APP.T(null,2,5,$APP.V,[1.1,1.5],null)],null),new $APP.T(null,
2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.1,1.1],null),new $APP.T(null,2,5,$APP.V,[1.1,1.9],null)],null),new $APP.T(null,6,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.1],null),new $APP.T(null,2,5,$APP.V,[1.2,1.1],null),new $APP.T(null,2,5,$APP.V,[1.2,1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,1.5],null),new $APP.T(null,2,5,$APP.V,[1.2,1.5],
null)],null)],null)],null),new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),$APP.G.h($APP.cs.g(b),"nmos")?new $APP.T(null,5,5,$APP.V,[Ju,1.3,1.5,.12,0],null):new $APP.T(null,5,5,$APP.V,[Ju,1.4,1.5,.12,180],null)],null)},Pu=function(a,b){return new $APP.T(null,7,5,$APP.V,[zu,3,a,b,new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,3,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[.5,1.5],null),new $APP.T(null,2,5,$APP.V,[1.15,1.5],null)],null),new $APP.T(null,
2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.15,1.15],null),new $APP.T(null,2,5,$APP.V,[1.15,1.85],null)],null),new $APP.T(null,6,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.1],null),new $APP.T(null,2,5,$APP.V,[1.15,1.4],null),new $APP.T(null,2,5,$APP.V,[1.15,1.6],null),new $APP.T(null,2,5,$APP.V,[1.5,1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),$APP.G.h($APP.cs.g(b),"npn")?new $APP.T(null,5,5,$APP.V,[Ju,1.4,1.81,.12,-140],null):
new $APP.T(null,5,5,$APP.V,[Ju,1.25,1.68,.12,40],null)],null)},Ru=function(a,b){var c=$APP.cs.g(b);c=Ot($APP.y(Qu),new $APP.T(null,2,5,$APP.V,[["models:",$APP.x.g(c)].join(""),$APP.Nr],null),new $APP.T(null,2,5,$APP.V,[1,1],null));return Du(c,a,b)},Su=function(a,b){var c=$APP.cs.g(b),d=Ot($APP.y(Qu),new $APP.T(null,2,5,$APP.V,[["models:",$APP.x.g(c)].join(""),$APP.Nr],null),new $APP.T(null,2,5,$APP.V,[1,1],null)),e=$APP.M(d,0,null);d=$APP.M(d,1,null);c=Ot($APP.y(Qu),new $APP.T(null,2,5,$APP.V,[["models:",
$APP.x.g(c)].join(""),$APP.dq],null),$APP.Nf);return Eu(2+(e>d?e:d),c,yu,a,b)},Vu=function(a,b){return["?",$APP.x.g((new URLSearchParams({schem:[$APP.x.g(a),"$",$APP.x.g(b)].join(""),db:Tu,sync:Uu})).toString())].join("")},bv=function(a,b){var c=$APP.cs.g(b),d=$APP.tf(b,new $APP.T(null,2,5,$APP.V,[Wu,Xu],null)),e=Ot($APP.y(Qu),new $APP.T(null,2,5,$APP.V,[["models:",$APP.x.g(c)].join(""),$APP.Nr],null),new $APP.T(null,2,5,$APP.V,[1,1],null)),f=$APP.M(e,0,null),g=$APP.M(e,1,null);e=$APP.tf($APP.y(Qu),
new $APP.T(null,2,5,$APP.V,[["models:",$APP.x.g(c)].join(""),$APP.fs],null));return new $APP.T(null,5,5,$APP.V,[zu,2+(f>g?f:g),a,b,$APP.p(e)?new $APP.T(null,2,5,$APP.V,[Yu,new $APP.n(null,3,[Zu,e,$u,function(h){return h.preventDefault()},$APP.bs,function(){return window.location.assign(Vu(c,d))}],null)],null):new $APP.T(null,6,5,$APP.V,[$APP.Sp,new $APP.T(null,2,5,$APP.V,[Hu,function(){return function m(l){return new $APP.se(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.sc(q),
t=$APP.F(r),v=$APP.ve(t);a:for(var u=0;;)if(u<t){var w=$APP.rd(r,u);v.add(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[w,.5],null),new $APP.T(null,2,5,$APP.V,[w,1],null)],null));u+=1}else{r=!0;break a}return r?$APP.ye($APP.Ae(v),m($APP.tc(q))):$APP.ye($APP.Ae(v),null)}v=$APP.D(q);return $APP.Q(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[v,.5],null),new $APP.T(null,2,5,$APP.V,[v,1],null)],null),m($APP.Sc(q)))}return null}},null,null)}($APP.Gh(1.5,1.5+f))}()],null),new $APP.T(null,
2,5,$APP.V,[Hu,function(){return function m(l){return new $APP.se(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.sc(q),t=$APP.F(r),v=$APP.ve(t);a:for(var u=0;;)if(u<t){var w=$APP.rd(r,u);v.add(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[.5,w],null),new $APP.T(null,2,5,$APP.V,[1,w],null)],null));u+=1}else{r=!0;break a}return r?$APP.ye($APP.Ae(v),m($APP.tc(q))):$APP.ye($APP.Ae(v),null)}v=$APP.D(q);return $APP.Q(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,
[.5,v],null),new $APP.T(null,2,5,$APP.V,[1,v],null)],null),m($APP.Sc(q)))}return null}},null,null)}($APP.Gh(1.5,1.5+g))}()],null),new $APP.T(null,2,5,$APP.V,[Hu,function(){return function m(l){return new $APP.se(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.sc(q),t=$APP.F(r),v=$APP.ve(t);a:for(var u=0;;)if(u<t){var w=$APP.rd(r,u);v.add(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[w,g+1.5],null),new $APP.T(null,2,5,$APP.V,[w,g+1],null)],null));u+=1}else{r=!0;break a}return r?
$APP.ye($APP.Ae(v),m($APP.tc(q))):$APP.ye($APP.Ae(v),null)}v=$APP.D(q);return $APP.Q(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[v,g+1.5],null),new $APP.T(null,2,5,$APP.V,[v,g+1],null)],null),m($APP.Sc(q)))}return null}},null,null)}($APP.Gh(1.5,1.5+f))}()],null),new $APP.T(null,2,5,$APP.V,[Hu,function(){return function m(l){return new $APP.se(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.sc(q),t=$APP.F(r),v=$APP.ve(t);a:for(var u=0;;)if(u<t){var w=$APP.rd(r,u);
v.add(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[f+1.5,w],null),new $APP.T(null,2,5,$APP.V,[f+1,w],null)],null));u+=1}else{r=!0;break a}return r?$APP.ye($APP.Ae(v),m($APP.tc(q))):$APP.ye($APP.Ae(v),null)}v=$APP.D(q);return $APP.Q(new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[f+1.5,v],null),new $APP.T(null,2,5,$APP.V,[f+1,v],null)],null),m($APP.Sc(q)))}return null}},null,null)}($APP.Gh(1.5,1.5+g))}()],null),new $APP.T(null,2,5,$APP.V,[av,new $APP.n(null,4,[$APP.or,50,$APP.nr,
50,Bu,50*f,Cu,50*g],null)],null)],null)],null)},cv=function(a,b,c,d){var e=$APP.M(b,0,null),f=$APP.M(b,1,null),g=$APP.M(b,2,null),h=$APP.M(b,3,null),l=$APP.M(b,4,null),m=$APP.M(b,5,null),q=lu(a)/2-.5;return $APP.lf.h(function(r){var t=$APP.M(r,0,null),v=$APP.M(r,1,null);$APP.M(r,2,null);r=t-q;v-=q;return new $APP.T(null,2,5,$APP.V,[Math.round(c+(e*r+g*v+l)+q),Math.round(d+(f*r+h*v+m)+q)],null)},a)},dv=function(a,b){return $APP.E(Rt(function(c){return $APP.Ne(c,a+b)},Qt(function(c){return c+(0<b?1:
-1)},a)))},ev=function(a){var b=$APP.Me(a);$APP.P.h(b,$APP.lm);var c=$APP.P.h(b,$APP.or),d=$APP.P.h(b,$APP.nr);a=$APP.P.h(b,$APP.Ip);b=$APP.P.h(b,$APP.Jp);return new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[c,d],null),new $APP.T(null,2,5,$APP.V,[c+a,d+b],null)],null),$APP.G.h(a,0)?$APP.lf.h(function(e){return new $APP.T(null,2,5,$APP.V,[c,e],null)},dv(d,b)):$APP.G.h(b,0)?$APP.lf.h(function(e){return new $APP.T(null,2,5,$APP.V,[e,d],null)},dv(c,a)):$APP.Nf],null)},
iv=function(a){var b=$APP.Me(a),c=$APP.P.h(b,$APP.lm),d=$APP.P.h(b,$APP.or),e=$APP.P.h(b,$APP.nr),f=$APP.P.h(b,$APP.cs),g=$APP.P.h(b,$APP.$q),h=$APP.P.h(fv,f),l=gv.g(h),m=hv.g(h),q=$APP.M(m,0,null),r=$APP.M(m,1,null);return new $APP.T(null,2,5,$APP.V,[cv(l,g,d,e),cv(function(){return function u(v){return new $APP.se(null,function(){for(var w=v;;){var A=$APP.C(w);if(A){var I=A,J=$APP.D(I);if(A=$APP.C(function(N,O,U,S,W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib){return function bb(Rb){return new $APP.se(null,
function(cc,dc){return function(){for(;;){var wb=$APP.C(Rb);if(wb){if($APP.Ed(wb)){var ec=$APP.sc(wb),Qc=$APP.F(ec),rb=$APP.ve(Qc);a:for(var Cb=0;;)if(Cb<Qc){var fc=$APP.rd(ec,Cb);rb.add(new $APP.T(null,3,5,$APP.V,[dc+1,fc+1,"%"],null));Cb+=1}else{ec=!0;break a}return ec?$APP.ye($APP.Ae(rb),bb($APP.tc(wb))):$APP.ye($APP.Ae(rb),null)}rb=$APP.D(wb);return $APP.Q(new $APP.T(null,3,5,$APP.V,[dc+1,rb+1,"%"],null),bb($APP.Sc(wb)))}return null}}}(N,O,U,S,W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib),null,null)}}(w,
J,I,A,h,l,m,q,r,a,b,c,d,e,f,g)($APP.Gh(0,r))))return $APP.pf.h(A,u($APP.Sc(w)));w=$APP.Sc(w)}else return null}},null,null)}($APP.Gh(0,q))}(),g,d,e)],null)},jv=function(a){var b=$APP.Me(a),c=$APP.P.h(b,$APP.lm),d=$APP.P.h(b,$APP.or),e=$APP.P.h(b,$APP.nr),f=$APP.P.h(b,$APP.cs),g=$APP.P.h(b,$APP.$q),h=$APP.P.h($APP.y(Qu),["models:",$APP.x.g(f)].join("")),l=$APP.dq.g(h),m=$APP.Nr.g(h),q=$APP.M(m,0,null),r=$APP.M(m,1,null);return new $APP.T(null,2,5,$APP.V,[cv(l,g,d,e),cv(function(){return function u(v){return new $APP.se(null,
function(){for(var w=v;;){var A=$APP.C(w);if(A){var I=A,J=$APP.D(I);if(A=$APP.C(function(N,O,U,S,W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib){return function bb(Rb){return new $APP.se(null,function(cc,dc){return function(){for(;;){var wb=$APP.C(Rb);if(wb){if($APP.Ed(wb)){var ec=$APP.sc(wb),Qc=$APP.F(ec),rb=$APP.ve(Qc);a:for(var Cb=0;;)if(Cb<Qc){var fc=$APP.rd(ec,Cb);rb.add(new $APP.T(null,3,5,$APP.V,[dc+1,fc+1,"%"],null));Cb+=1}else{ec=!0;break a}return ec?$APP.ye($APP.Ae(rb),bb($APP.tc(wb))):$APP.ye($APP.Ae(rb),
null)}rb=$APP.D(wb);return $APP.Q(new $APP.T(null,3,5,$APP.V,[dc+1,rb+1,"%"],null),bb($APP.Sc(wb)))}return null}}}(N,O,U,S,W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib),null,null)}}(w,J,I,A,h,l,m,q,r,a,b,c,d,e,f,g)($APP.Gh(0,r))))return $APP.pf.h(A,u($APP.Sc(w)));w=$APP.Sc(w)}else return null}},null,null)}($APP.Gh(0,q))}(),g,d,e)],null)},kv=function(a){var b=$APP.cs.g(a);return $APP.G.h(b,"wire")?ev(a):$APP.Nd(fv,b)?iv(a):jv(a)},lv=function(){var a=$APP.y(Lt);a=$APP.oh(a);for(var b=$APP.C(a),c=$APP.D(b),d=$APP.E(b),
e=$APP.Re,f=$APP.Re,g=a;;){var h=e,l=f,m=g,q=$APP.C(m),r=$APP.D(q),t=$APP.E(q),v=r,u=t,w=kv(v),A=$APP.M(w,0,null),I=$APP.M(w,1,null),J=$APP.Ua(function(N,O,U,S,W,oa,X,ka,ta,Ka,Ra,$a,ab){return function(eb,Ma){return $APP.dp.u(eb,Ma,$APP.Ls,$APP.lm.g(ab))}}(e,f,g,w,A,I,h,l,m,q,r,t,v,u,$APP.Re,$APP.Re,a,a,b,c,d,c,d),h,A);e=$APP.Ua(function(N,O,U,S,W,oa,X,ka,ta,Ka,Ra,$a,ab,eb){return function(Ma,ib){return $APP.dp.u(Ma,ib,$APP.Ls,$APP.lm.g(eb))}}(e,f,g,w,A,I,J,h,l,m,q,r,t,v,u,$APP.Re,$APP.Re,a,a,b,c,
d,c,d),l,I);if(u)f=e,e=J,g=u;else return new $APP.T(null,2,5,$APP.V,[J,e],null)}},mv=function(a){var b=$APP.M(a,0,null);a=$APP.M(a,1,null);return $APP.Ua(function(c,d){var e=$APP.M(d,0,null);d=$APP.M(d,1,null);return $APP.Nd(b,e)?$APP.Ua(function(f,g){return $APP.dp.u(f,g,$APP.Ms,e)},c,$APP.rf(function(f){return $APP.G.h("wire",$APP.tf($APP.y(Lt),new $APP.T(null,2,5,$APP.V,[f,$APP.cs],null)))},d)):c},$APP.Re,a)},qv=function(a,b){var c=$APP.P.h($APP.y(Lt),a),d=$APP.Me(c);c=$APP.P.h(d,$APP.or);var e=
$APP.P.h(d,$APP.nr),f=$APP.P.h(d,$APP.Ip);d=$APP.P.h(d,$APP.Jp);c=(0,$APP.Ms)(b,new $APP.T(null,2,5,$APP.V,[c,e],null),new $APP.T(null,2,5,$APP.V,[c+f,e+d],null));b=$APP.D($APP.y(nv));a:for(f=$APP.C(c),e=$APP.D(f),f=$APP.E(f),$APP.M(e,0,null),$APP.M(e,1,null),e=$APP.C(f),f=$APP.D(e),$APP.E(e),$APP.M(f,0,null),$APP.M(f,1,null),f=a,d=c,e=$APP.Re;;){c=f;d=$APP.C(d);f=$APP.D(d);var g=$APP.E(d);d=f;f=$APP.M(d,0,null);d=$APP.M(d,1,null);var h=g;g=$APP.C(h);var l=$APP.D(g);$APP.E(g);g=$APP.M(l,0,null);l=
$APP.M(l,1,null);var m=e;if(h)e=$APP.Ah($APP.gk.g(a)),c=$APP.xd(ov.h($APP.P.h(b,new $APP.T(null,2,5,$APP.V,[f,d],null)),$APP.P.h(b,new $APP.T(null,2,5,$APP.V,[g,l],null))))?$APP.Y.i(m,c,new $APP.n(null,6,[$APP.cs,"wire",$APP.$q,$APP.Os,$APP.or,f,$APP.nr,d,$APP.Ip,g-f,$APP.Jp,l-d],null)):m,f=e,d=h,e=c;else{a=m;break a}}return $APP.Z.i(Lt,$APP.Pn.h(pv,$APP.lk),a)},rv=function(a){var b=document.getElementById("mosaic_canvas").getScreenCTM().inverse();a=DOMPointReadOnly.fromPoint($APP.Kk(new $APP.n(null,
2,[$APP.or,a.clientX,$APP.nr,a.clientY],null))).matrixTransform(b);return new $APP.T(null,2,5,$APP.V,[a.x/50,a.y/50],null)},uv=function(a,b,c){return $APP.Z.u(sv,$APP.dp,tv,function(d){var e=$APP.M(d,0,null),f=$APP.M(d,1,null),g=$APP.M(d,2,null);d=$APP.M(d,3,null);var h=a*g*.1,l=a*d*.1;return new $APP.T(null,4,5,$APP.V,[e-(b-e)/g*h,f-(c-f)/d*l,g+h,d+l],null)})},vv=function(a){var b=rv(a),c=$APP.M(b,0,null);b=$APP.M(b,1,null);return uv(0<a.deltaY?1:-1,50*c,50*b)},wv=function(a){var b=tv.g($APP.y(sv)),
c=$APP.M(b,0,null),d=$APP.M(b,1,null),e=$APP.M(b,2,null);b=$APP.M(b,3,null);return uv(a,c+e/2,d+b/2)},xv=function(a){var b=qu($APP.cs.g(a)),c=$APP.pd($APP.$i(b,":"));return $APP.Z.u(Lt,$APP.Y,b,$APP.p($APP.fj.g(a))?a:$APP.Y.i(a,$APP.fj,c))},Cv=function(a){a=yv.i($APP.Po,a,eu);return $APP.p($APP.y(zv))?$APP.Z.u(zv,$APP.dp,$APP.$q,a):$APP.Z.l(Lt,Av,$APP.y(Bv),$APP.dp,$APP.K([$APP.$q,a]))},Ev=function(){var a=Dv.g($APP.y(sv));$APP.Z.u(sv,$APP.Y,Dv,$APP.uh);return $APP.Z.i(Lt,function(b,c){return $APP.Ke.i($APP.Bj,
b,c)},a)},Gv=function(a){return $APP.Z.u(sv,$APP.dp,tv,function(b){var c=$APP.M(b,0,null),d=$APP.M(b,1,null),e=$APP.M(b,2,null);b=$APP.M(b,3,null);var f=document.getElementById("mosaic_canvas").getScreenCTM().inverse();f.e=0;f.f=0;var g=$APP.y(Fv);var h=$APP.M(g,0,null);var l=$APP.M(g,1,null);g=a.clientX;var m=a.clientY;f=DOMPointReadOnly.fromPoint($APP.Kk(new $APP.n(null,2,[$APP.or,g-h,$APP.nr,m-l],null))).matrixTransform(f);$APP.hf(Fv,new $APP.T(null,2,5,$APP.V,[g,m],null));h=new $APP.T(null,2,
5,$APP.V,[f.x,f.y],null);f=$APP.M(h,0,null);h=$APP.M(h,1,null);return new $APP.T(null,4,5,$APP.V,[c-f,d-h,e,b],null)})},Jv=function(a){var b=rv(a);a=$APP.M(b,0,null);b=$APP.M(b,1,null);var c=Hv.g($APP.y(sv)),d=$APP.M(c,0,null);c=$APP.M(c,1,null);return $APP.Z.l(Iv,$APP.Y,$APP.or,a-d,$APP.K([$APP.nr,b-c]))},Kv=function(a){var b=rv(a),c=$APP.M(b,0,null),d=$APP.M(b,1,null);return $APP.Z.h(zv,function(e){var f=c-$APP.or.g(e)-.5,g=d-$APP.nr.g(e)-.5;return $APP.p(a.ctrlKey)?$APP.Y.l(e,$APP.Ip,f,$APP.K([$APP.Jp,
g])):Math.abs(f)>Math.abs(g)?$APP.Y.l(e,$APP.Ip,f,$APP.K([$APP.Jp,0])):$APP.Y.l(e,$APP.Ip,0,$APP.K([$APP.Jp,g]))})},Mv=function(a){var b=Lv.g($APP.y(sv));switch(b instanceof $APP.R?b.qa:null){case "nyancad.mosaic.editor/view":return Gv(a);case "nyancad.mosaic.editor/wire":return Kv(a);case "nyancad.mosaic.editor/device":return Jv(a);case "nyancad.mosaic.editor/box":return Jv(a);default:return null}},Qv=function(a,b){if($APP.G.h(b.buttons,1)&&$APP.G.h($APP.y(Nv),Ov)&&!$APP.Nd($APP.y(Pv),a)){var c=
$APP.cm(1);$APP.Hl(function(){var d=function(){return function(){function f(l){for(;;){a:try{for(;;){var m=void 0,q=l,r=q[1];if(1===r){var t=$APP.Z.i(Pv,$APP.le,a),v=$APP.Z.i(Lt,$APP.Bj,a);q[7]=t;m=q;var u=$APP.am(m,2,v)}else if(2===r){var w=q[2],A=$APP.Z.i(Pv,$APP.$o,a);q[8]=w;m=q;u=$APP.bm(m,A)}else u=null;if(!$APP.pe(u,$APP.$l)){var I=u;break a}}}catch(J){I=J;l[2]=I;if($APP.C(l[4]))l[1]=$APP.D(l[4]);else throw I;I=$APP.$l}if(!$APP.pe(I,$APP.$l))return I}}function g(){var l=[null,null,null,null,
null,null,null,null,null];l[0]=h;l[1]=1;return l}var h=null;h=function(l){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,l)}throw Error("Invalid arity: "+arguments.length);};h.m=g;h.g=f;return h}()}(),e=function(){var f=d();f[6]=c;return f}();return $APP.Zl(e)});return c}return null},Tv=function(a){$APP.Z.u(sv,$APP.Y,Rv,rv(a));var b=$APP.y(Nv);switch(b instanceof $APP.R?b.qa:null){case "nyancad.mosaic.editor/wire":a:switch(b=Lv.g($APP.y(sv)),b instanceof $APP.R?b.qa:
null){case "nyancad.mosaic.editor/view":a=Gv(a);break a;case "nyancad.mosaic.editor/wire":a=Kv(a);break a;default:a=null}return a;case "nyancad.mosaic.editor/pan":return 0<a.buttons?Gv(a):null;case "nyancad.mosaic.editor/device":if($APP.G.h(Lv.g($APP.y(sv)),Sv))a=Gv(a);else{b=rv(a);a=$APP.M(b,0,null);b=$APP.M(b,1,null);var c=$APP.tf(fv,new $APP.T(null,2,5,$APP.V,[$APP.cs.g($APP.y(zv)),hv],null)),d=$APP.M(c,0,null);c=$APP.M(c,1,null);a=$APP.Z.l(zv,$APP.Y,$APP.or,Math.round(a-d-.5),$APP.K([$APP.nr,
Math.round(b-c-.5)]))}return a;default:return Mv(a)}},Wv=function(a){var b=$APP.M(a,0,null);a=$APP.M(a,1,null);return $APP.Z.l(sv,$APP.Y,Uv,new $APP.n(null,5,[$APP.cs,"wire",$APP.or,Math.floor(b),$APP.nr,Math.floor(a),$APP.Ip,0,$APP.Jp,0],null),$APP.K([Lv,Vv]))},Xv=function(a,b){var c=$APP.M(a,0,null);a=$APP.M(a,1,null);if($APP.p(b))return Wv(new $APP.T(null,2,5,$APP.V,[c,a],null));var d=Av.i($APP.y(zv),new $APP.th(null,new $APP.n(null,2,[$APP.Ip,null,$APP.Jp,null],null),null),Math.round);c=$APP.Me(d);
b=$APP.P.h(c,$APP.Ip);c=$APP.P.h(c,$APP.Jp);var e=Math.round($APP.or.g(d)+b),f=Math.round($APP.nr.g(d)+c),g=$APP.y(nv);a=$APP.M(g,0,null);g=$APP.M(g,1,null);a=$APP.Nd(a,new $APP.T(null,2,5,$APP.V,[e,f],null))||$APP.Nd(g,new $APP.T(null,2,5,$APP.V,[e,f],null));if(.5>Math.abs(b)&&.5>Math.abs(c))return $APP.Z.l(sv,$APP.Y,Uv,null,$APP.K([Lv,null]));if(a){var h=$APP.cm(1);$APP.Hl(function(){var l=function(){return function(){function q(v){for(;;){a:try{for(;;){var u=v,w=u[1];if(1===w){var A=xv(d);var I=
$APP.am(u,2,A)}else if(2===w){var J=u[2],N=$APP.Z.l(sv,$APP.Y,Uv,null,$APP.K([Lv,null]));u[7]=J;I=$APP.bm(u,N)}else I=null;if(!$APP.pe(I,$APP.$l)){var O=I;break a}}}catch(U){O=U;v[2]=O;if($APP.C(v[4]))v[1]=$APP.D(v[4]);else throw O;O=$APP.$l}if(!$APP.pe(O,$APP.$l))return O}}function r(){var v=[null,null,null,null,null,null,null,null];v[0]=t;v[1]=1;return v}var t=null;t=function(v){switch(arguments.length){case 0:return r.call(this);case 1:return q.call(this,v)}throw Error("Invalid arity: "+arguments.length);
};t.m=r;t.g=q;return t}()}(),m=function(){var q=l();q[6]=h;return q}();return $APP.Zl(m)})}else h=$APP.cm(1),$APP.Hl(function(){var l=function(){return function(){function q(v){for(;;){a:try{for(;;){var u=v,w=u[1];if(1===w){var A=xv(d);var I=$APP.am(u,2,A)}else if(2===w){var J=u[2],N=Wv(new $APP.T(null,2,5,$APP.V,[e,f],null));u[7]=J;I=$APP.bm(u,N)}else I=null;if(!$APP.pe(I,$APP.$l)){var O=I;break a}}}catch(U){O=U;v[2]=O;if($APP.C(v[4]))v[1]=$APP.D(v[4]);else throw O;O=$APP.$l}if(!$APP.pe(O,$APP.$l))return O}}
function r(){var v=[null,null,null,null,null,null,null,null];v[0]=t;v[1]=1;return v}var t=null;t=function(v){switch(arguments.length){case 0:return r.call(this);case 1:return q.call(this,v)}throw Error("Invalid arity: "+arguments.length);};t.m=r;t.g=q;return t}()}(),m=function(){var q=l();q[6]=h;return q}();return $APP.Zl(m)});return h},Yv=function(){function a(h,l){return $APP.G.h($APP.cs.g(l),"wire")?$APP.le.l(h,new $APP.T(null,2,5,$APP.V,[$APP.or.g(l),$APP.nr.g(l)],null),$APP.K([new $APP.T(null,
2,5,$APP.V,[$APP.or.g(l)+$APP.Ip.g(l),$APP.nr.g(l)+$APP.Jp.g(l)],null)])):h}function b(h){h=$APP.P.h(c,h);var l=$APP.G.h($APP.cs.g(h),"wire");return l?h:l}var c=$APP.y(Lt),d=$APP.Ye(c,$APP.y(Bv));if($APP.p(d)){var e=a($APP.uh,d);for(d=$APP.vh([$APP.lm.g(d)]);;)if($APP.C(e)){var f=$APP.y(nv),g=$APP.M(f,0,null);$APP.M(f,1,null);f=$APP.os.h($APP.yh($APP.rf(b,$APP.qf(g,$APP.K([e])))),d);g=$APP.Ua(a,$APP.uh,$APP.lf.h(c,f));e=$APP.os.h(g,e);d=$APP.pi.h(d,f)}else return $APP.hf(Bv,d)}else return null},aw=
function(){var a=$APP.y(sv),b=Uv.g(a);a=$APP.p(b)?$APP.G.h(Zv.g(a),Vv):b;return $APP.p(a)?$APP.Z.l(sv,$APP.Y,Lv,null,$APP.K([Uv,null])):$APP.Z.l(sv,$APP.Y,Lv,null,$APP.K([Zv,$v,Uv,null]))},cw=function(a){$APP.ci($APP.K([a]));return bw.postMessage(a)},ew=function(a,b){function c(g){return $APP.Y.i(g,Lv,function(){var h=Zv.g(g);h=h instanceof $APP.R?h.qa:null;switch(h){case "nyancad.mosaic.editor/cursor":return dw;case "nyancad.mosaic.editor/wire":return Vv;case "nyancad.mosaic.editor/pan":return Sv;
case "nyancad.mosaic.editor/probe":return null;default:throw Error(["No matching clause: ",$APP.x.g(h)].join(""));}}())}function d(g){var h=$APP.Nd(g,a);return $APP.p(h?h:b.shiftKey)?(0,$APP.Ls)(g,a):$APP.vh([a])}$APP.Z.u(sv,$APP.Y,Hv,rv(b));$APP.hf(Fv,new $APP.T(null,2,5,$APP.V,[b.clientX,b.clientY],null));var e=$APP.y(sv);if($APP.Ne(Zv.g(e),dw)&&$APP.G.h(b.button,0))if(b.stopPropagation(),$APP.G.h(b.detail,1)){var f=Zv.g(e);switch(f instanceof $APP.R?f.qa:null){case "nyancad.mosaic.editor/wire":return Xv(rv(b),
null==Lv.g(e));case "nyancad.mosaic.editor/eraser":return Qv(a,b);case "nyancad.mosaic.editor/probe":return cw(a);default:return $APP.Z.h(sv,function(g){return c($APP.dp.i(g,Dv,d))})}}else switch(e=Zv.g(e),e=e instanceof $APP.R?e.qa:null,e){case "nyancad.mosaic.editor/cursor":return Yv();case "nyancad.mosaic.editor/wire":return aw();default:throw Error(["No matching clause: ",$APP.x.g(e)].join(""));}else return null},gw=function(a){$APP.hf(Fv,new $APP.T(null,2,5,$APP.V,[a.clientX,a.clientY],null));
return $APP.G.h(a.button,1)?$APP.Z.u(sv,$APP.Y,Lv,Sv):$APP.G.h(a.button,0)&&$APP.G.h($v,$APP.y(Nv))?$APP.Z.l(sv,$APP.Y,Dv,$APP.uh,$APP.K([Lv,fw,Hv,rv(a)])):$APP.G.h(a.button,0)&&$APP.G.h(Vv,$APP.y(Nv))?Xv(rv(a),null==Lv.g($APP.y(sv))):null},hw=function(a){var b=Lv.g($APP.y(sv));b=$APP.p(b)?b:$APP.Ne(Zv.g($APP.y(sv)),$v);return $APP.p(b)?(aw(),a.preventDefault()):null},qw=function(a,b,c,d){b=$APP.P.h($APP.P.i(fv,$APP.cs.g(b),new $APP.n(null,3,[hv,new $APP.Mc(function(){return Ru},iw,$APP.Ug([$APP.xp,
$APP.fj,$APP.Kq,$APP.Np,$APP.Yr,$APP.zp,$APP.Dp,$APP.Uq,$APP.im,$APP.fr],[jw,kw,"nyancad/mosaic/editor.cljs",20,1,329,329,$APP.aj(new $APP.T(null,2,5,$APP.V,[$APP.hq,$APP.gq],null)),null,$APP.p(Ru)?Ru.Mc:null])),gv,new $APP.Mc(function(){return Su},lw,$APP.Ug([$APP.xp,$APP.fj,$APP.Kq,$APP.Np,$APP.Yr,$APP.zp,$APP.Dp,$APP.Uq,$APP.im,$APP.fr],[jw,mw,"nyancad/mosaic/editor.cljs",19,1,334,334,$APP.aj(new $APP.T(null,2,5,$APP.V,[$APP.hq,$APP.gq],null)),null,$APP.p(Su)?Su.Mc:null])),nw,new $APP.Mc(function(){return bv},
ow,$APP.Ug([$APP.xp,$APP.fj,$APP.Kq,$APP.Np,$APP.Yr,$APP.zp,$APP.Dp,$APP.Uq,$APP.im,$APP.fr],[jw,pw,"nyancad/mosaic/editor.cljs",18,1,344,344,$APP.aj(new $APP.T(null,2,5,$APP.V,[$APP.hq,$APP.gq],null)),null,$APP.p(bv)?bv.Mc:null]))],null)),a);return $APP.td(b)?$APP.vd(new $APP.T(null,3,5,$APP.V,[b,c,d],null),new $APP.n(null,1,[$APP.ij,c],null)):$APP.G.h(a,hv)?$APP.vd(new $APP.T(null,4,5,$APP.V,[Du,b,c,d],null),new $APP.n(null,1,[$APP.ij,c],null)):$APP.G.h(a,gv)?$APP.vd(new $APP.T(null,6,5,$APP.V,
[Eu,lu(b),b,yu,c,d],null),new $APP.n(null,1,[$APP.ij,c],null)):$APP.vd(new $APP.T(null,1,5,$APP.V,[function(e){return $APP.ci($APP.K(["invalid model for",e]))}],null),new $APP.n(null,1,[$APP.ij,c],null))},sw=function(a,b,c,d){function e(f,g){return $APP.dp.i(f,Dv,function(h){return $APP.pi.i($APP.uh,Kt(function(l){return $APP.Nd(g,l)}),h)})}$APP.Z.h(sv,function(f){f=$APP.Y.l(f,Lv,null,$APP.K([rw,new $APP.n(null,4,[$APP.or,0,$APP.nr,0,$APP.Ip,0,$APP.Jp,0],null)]));f=$APP.p(a)?$APP.Y.i(f,Dv,$APP.uh):
f;return e(f,$APP.y(Lt))});return $APP.Z.u(Lt,Av,b,function(f){f=$APP.Me(f);var g=$APP.P.h(f,$APP.or),h=$APP.P.h(f,$APP.nr);return $APP.Y.l(f,$APP.or,Math.round(g+c),$APP.K([$APP.nr,Math.round(h+d)]))})},uw=function(){var a=Hv.g($APP.y(sv)),b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=rw.g($APP.y(sv)),e=$APP.Me(d),f=$APP.P.h(e,$APP.or),g=$APP.P.h(e,$APP.nr),h=Math.floor(Math.min(b,b+f)),l=Math.floor(Math.min(c,c+g)),m=Math.floor(Math.max(b,b+f)),q=Math.floor(Math.max(c,c+g)),r=$APP.y(nv),t=$APP.M(r,0,
null),v=$APP.M(r,1,null),u=$APP.Ke.h(tw,function(){return function J(I){return new $APP.se(null,function(){for(var N=I;;){var O=$APP.C(N);if(O){var U=O,S=$APP.D(U);if(O=$APP.C(function(W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib,Jb,Rb,bb,cc,dc,wb){return function rb(Qc){return new $APP.se(null,function(Cb,fc,Jd,ch,Ff,Kd,bi,Gf,Ve,dh,eh,fh,Bb,$s,at,bt,Gl){return function(){for(;;){var Lg=$APP.C(Qc);if(Lg){if($APP.Ed(Lg)){var ff=$APP.sc(Lg),Ee=$APP.F(ff),gf=$APP.ve(Ee);a:for(var Hi=0;;)if(Hi<Ee){var Sf=$APP.rd(ff,
Hi);Sf=$APP.P.h(Gl,new $APP.T(null,2,5,$APP.V,[fc,Sf],null));gf.add(Sf);Hi+=1}else{ff=!0;break a}return ff?$APP.ye($APP.Ae(gf),rb($APP.tc(Lg))):$APP.ye($APP.Ae(gf),null)}gf=$APP.D(Lg);return $APP.Q($APP.P.h(Gl,new $APP.T(null,2,5,$APP.V,[fc,gf],null)),rb($APP.Sc(Lg)))}return null}}}(W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib,Jb,Rb,bb,cc,dc,wb),null,null)}}(N,S,U,O,a,b,c,d,e,f,g,h,l,m,q,r,t,v)($APP.Gh(l,q+1))))return $APP.pf.h(O,J($APP.Sc(N)));N=$APP.Sc(N)}else return null}},null,null)}($APP.Gh(h,m+1))}()),
w=$APP.Ke.i(tw,u,function(){return function J(I){return new $APP.se(null,function(){for(var N=I;;){var O=$APP.C(N);if(O){var U=O,S=$APP.D(U);if(O=$APP.C(function(W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib,Jb,Rb,bb,cc,dc,wb,ec){return function Cb(rb){return new $APP.se(null,function(fc,Jd,ch,Ff,Kd,bi,Gf,Ve,dh,eh,fh,Bb,$s,at,bt,Gl,Lg,ff){return function(){for(;;){var Ee=$APP.C(rb);if(Ee){if($APP.Ed(Ee)){var gf=$APP.sc(Ee),Hi=$APP.F(gf),Sf=$APP.ve(Hi);a:for(var xo=0;;)if(xo<Hi){var yo=$APP.rd(gf,xo);yo=$APP.P.h(ff,
new $APP.T(null,2,5,$APP.V,[Jd,yo],null));Sf.add(yo);xo+=1}else{gf=!0;break a}return gf?$APP.ye($APP.Ae(Sf),Cb($APP.tc(Ee))):$APP.ye($APP.Ae(Sf),null)}Sf=$APP.D(Ee);return $APP.Q($APP.P.h(ff,new $APP.T(null,2,5,$APP.V,[Jd,Sf],null)),Cb($APP.Sc(Ee)))}return null}}}(W,oa,X,ka,ta,Ka,Ra,$a,ab,eb,Ma,ib,Jb,Rb,bb,cc,dc,wb,ec),null,null)}}(N,S,U,O,a,b,c,d,e,f,g,h,l,m,q,r,t,v,u)($APP.Gh(l,q+1))))return $APP.pf.h(O,J($APP.Sc(N)));N=$APP.Sc(N)}else return null}},null,null)}($APP.Gh(h,m+1))}());$APP.ci($APP.K([h,
l,m,q,w]));return $APP.Z.l(sv,$APP.Y,Lv,null,$APP.K([rw,new $APP.n(null,4,[$APP.or,0,$APP.nr,0,$APP.Ip,0,$APP.Jp,0],null),Dv,$APP.yh(w)]))},vw=function(a){a.stopPropagation();var b=$APP.G.h(a.target,a.currentTarget),c=Dv.g($APP.y(sv)),d=$APP.y(Iv),e=$APP.Me(d);d=$APP.P.h(e,$APP.or);e=$APP.P.h(e,$APP.nr);return $APP.G.h(Zv.g($APP.y(sv)),dw)&&$APP.G.h(a.button,0)?xv($APP.y(zv)):$APP.G.h(Lv.g($APP.y(sv)),fw)?uw():$APP.G.h(Lv.g($APP.y(sv)),Vv)?null:sw(b,c,d,e)},xw=function(a){for(var b=[],c=arguments.length,
d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;b=2<b.length?new $APP.B(b.slice(2),0,null):null;return ww(arguments[0],arguments[1],b)},ww=function(a,b,c){var d=$APP.M(b,0,null);b=$APP.M(b,1,null);c=$APP.Ke.h($APP.oi,c);var e=$APP.tf(fv,new $APP.T(null,2,5,$APP.V,[a,hv],null)),f=$APP.M(e,0,null);e=$APP.M(e,1,null);return $APP.Z.l(sv,$APP.Y,Uv,$APP.pi.h(new $APP.n(null,4,[$APP.$q,$APP.Os,$APP.cs,a,$APP.or,Math.round(d-f/2-1),$APP.nr,Math.round(b-e/2-1)],null),c),$APP.K([Zv,dw]))},yw=function(){var a=
['\x3c?xml-stylesheet type\x3d"text/css" href\x3d"https://nyancad.github.io/Mosaic/app/css/style.css" ?\x3e',$APP.x.g(document.getElementById("mosaic_canvas").outerHTML)].join("");return btoa($APP.Yi(encodeURIComponent(a),/%([0-9A-F]{2})/,function(b){return String.fromCharCode(["0x",$APP.x.g($APP.jd(b,1))].join(""))}))},Ew=function(){return $APP.Z.u(zw,$APP.Y,["snapshots:",$APP.x.g(pu),"#",$APP.x.g((new Date).toISOString())].join(""),new $APP.n(null,2,[Aw,$APP.y(Lt),Bw,new $APP.n(null,1,["preview.svg",
new $APP.n(null,2,[Cw,"image/svg+xml",Dw,yw()],null)],null)],null))},Lw=function(a){var b=$APP.fl(Lt,new $APP.T(null,2,5,$APP.V,[a,Wu],null)),c=$APP.fl(Lt,new $APP.T(null,2,5,$APP.V,[a,$APP.cs],null)),d=$APP.fl(Lt,new $APP.T(null,2,5,$APP.V,[a,$APP.fj],null));return function(e){return new $APP.T(null,3,5,$APP.V,[$APP.Sp,new $APP.T(null,4,5,$APP.V,[$APP.Sr,$APP.y(c),": ",function(){var f=$APP.y(d);return $APP.p(f)?f:e}()],null),new $APP.T(null,9,5,$APP.V,[$APP.Gp,$APP.Nd(fv,$APP.y(c))?null:new $APP.T(null,
4,5,$APP.V,[$APP.Sp,new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,1,[Zu,Vu($APP.y(c),Xu.g($APP.y(b)))],null),"Edit"],null),new $APP.T(null,3,5,$APP.V,[$APP.cr,new $APP.n(null,2,[$APP.aq,"cell",$APP.qq,"cell name"],null),"cell"],null),new $APP.T(null,4,5,$APP.V,[Gw,new $APP.n(null,4,[$APP.Zk,"cell",$APP.eq,"text",$APP.Zp,$APP.y(c),$APP.yp,function(f){return $APP.hf(c,f.target.value)}],null),new $APP.T(null,1,5,$APP.V,[Hw],null),function(){return function h(g){return new $APP.se(null,function(){for(;;){var l=
$APP.C(g);if(l){if($APP.Ed(l)){var m=$APP.sc(l),q=$APP.F(m),r=$APP.ve(q);a:for(var t=0;;)if(t<q){var v=$APP.rd(m,t),u=$APP.M(v,0,null);v=$APP.M(v,1,null);u=new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.ij,u],null),$APP.fj.g(v)],null);r.add(u);t+=1}else{m=!0;break a}return m?$APP.ye($APP.Ae(r),h($APP.tc(l))):$APP.ye($APP.Ae(r),null)}m=$APP.D(l);r=$APP.M(m,0,null);m=$APP.M(m,1,null);return $APP.Q(new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.ij,r],null),$APP.fj.g(m)],null),h($APP.Sc(l)))}return null}},
null,null)}($APP.y(Qu))}()],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.cr,new $APP.n(null,2,[$APP.aq,"name",$APP.qq,"Instance name"],null),"name"],null),new $APP.T(null,2,5,$APP.V,[$APP.ar,new $APP.n(null,4,[$APP.Zk,"name",$APP.eq,"text",$APP.Zp,$APP.y(d),$APP.yp,$APP.la(function(f){return $APP.hf(d,f.target.value)})],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.cr,new $APP.n(null,2,[$APP.aq,"model",$APP.qq,"Device model"],null),"model"],null),new $APP.T(null,4,5,$APP.V,[Gw,new $APP.n(null,4,
[$APP.Zk,"model",$APP.eq,"text",$APP.Zp,Xu.g($APP.y(b)),$APP.yp,function(f){return $APP.Z.u(b,$APP.Y,Xu,f.target.value)}],null),new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.vr,null],null),"Ideal"],null),function(){return function h(g){return new $APP.se(null,function(){for(;;){var l=$APP.C(g);if(l){if($APP.Ed(l)){var m=$APP.sc(l),q=$APP.F(m),r=$APP.ve(q);a:for(var t=0;;)if(t<q){var v=$APP.rd(m,t);r.add(new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.ij,v],null),v],null));t+=1}else{m=
!0;break a}return m?$APP.ye($APP.Ae(r),h($APP.tc(l))):$APP.ye($APP.Ae(r),null)}r=$APP.D(l);return $APP.Q(new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.ij,r],null),r],null),h($APP.Sc(l)))}return null}},null,null)}($APP.mh($APP.tf($APP.y(Qu),new $APP.T(null,2,5,$APP.V,[["models:",$APP.x.g($APP.y(c))].join(""),$APP.as],null))))}()],null),$APP.Ih(function(){return function h(g){return new $APP.se(null,function(){for(;;){var l=$APP.C(g);if(l){var m=l;if($APP.Ed(m)){var q=$APP.sc(m),r=$APP.F(q),
t=$APP.ve(r);return function(){for(var A=0;;)if(A<r){var I=$APP.rd(q,A),J=$APP.M(I,0,null),N=$APP.M(I,1,null);$APP.ze(t,new $APP.T(null,4,5,$APP.V,[$APP.Sp,new $APP.n(null,1,[$APP.ij,J],null),new $APP.T(null,3,5,$APP.V,[$APP.cr,new $APP.n(null,2,[$APP.aq,J,$APP.qq,Iw.g(N)],null),J],null),new $APP.T(null,2,5,$APP.V,[$APP.ar,new $APP.n(null,4,[$APP.Zk,J,$APP.eq,"text",$APP.Zp,$APP.P.h($APP.y(b),J),$APP.yp,$APP.la(function(O,U,S,W,oa,X,ka,ta,Ka,Ra){return function($a){return $APP.Z.u(Ra,$APP.Y,S,$a.target.value)}}(A,
I,J,N,q,r,t,m,l,b,c,d))],null)],null)],null));A+=1}else return!0}()?$APP.ye($APP.Ae(t),h($APP.tc(m))):$APP.ye($APP.Ae(t),null)}var v=$APP.D(m),u=$APP.M(v,0,null),w=$APP.M(v,1,null);return $APP.Q(new $APP.T(null,4,5,$APP.V,[$APP.Sp,new $APP.n(null,1,[$APP.ij,u],null),new $APP.T(null,3,5,$APP.V,[$APP.cr,new $APP.n(null,2,[$APP.aq,u,$APP.qq,Iw.g(w)],null),u],null),new $APP.T(null,2,5,$APP.V,[$APP.ar,new $APP.n(null,4,[$APP.Zk,u,$APP.eq,"text",$APP.Zp,$APP.P.h($APP.y(b),u),$APP.yp,$APP.la(function(A,
I,J,N,O,U){return function(S){return $APP.Z.u(U,$APP.Y,I,S.target.value)}}(v,u,w,m,l,b,c,d))],null)],null)],null),h($APP.Sc(m)))}return null}},null,null)}(Jw.g($APP.P.h(fv,$APP.y(c))))}()),new $APP.T(null,3,5,$APP.V,[$APP.cr,new $APP.n(null,2,[$APP.aq,"spice",$APP.qq,"Extra spice data"],null),"spice"],null),new $APP.T(null,2,5,$APP.V,[$APP.ar,new $APP.n(null,4,[$APP.Zk,"spice",$APP.eq,"text",$APP.Zp,Kw.g($APP.y(b)),$APP.yp,$APP.la(function(f){return $APP.Z.u(b,$APP.Y,Kw,f.target.value)})],null)],
null)],null)],null)}},Nw=function(){var a=$APP.y(Bv),b=$APP.y(Lt);a=$APP.lf.h(yv.h(function(c){return $APP.Bj.l(c,$APP.nm,$APP.K([$APP.lm]))},b),a);return $APP.Z.u(Mw,$APP.Y,"local:clipboard",new $APP.n(null,1,[Dw,a],null))},Ow=function(){Nw();return Ev()},Pw=function(){var a=$APP.tf($APP.y(Mw),new $APP.T(null,2,5,$APP.V,["local:clipboard",Dw],null)),b=$APP.lf.g(function(c){return new $APP.T(null,2,5,$APP.V,[qu($APP.cs.g(c)),$APP.dp.i(c,$APP.fj,$APP.gk)],null)});a=$APP.pi.i($APP.Re,b,a);$APP.Z.i(Lt,
$APP.pi,a);return $APP.Z.l(sv,$APP.Y,Lv,dw,$APP.K([Dv,$APP.yh($APP.mh(a))]))},Rw=function(){var a=new URL(window.simulatorurl,window.location);a.searchParams.append("schem",pu);var b=a.searchParams,c=b.append;var d=(d=$APP.C(Uu))?Uu:d;c.call(b,"db",$APP.p(d)?d:Qw);return a},Zw=function(){return new $APP.T(null,3,5,$APP.V,[$APP.Sp,new $APP.T(null,16,5,$APP.V,[Sw,new $APP.T(null,3,5,$APP.V,[$APP.It,Nv,new $APP.T(null,5,5,$APP.V,[new $APP.T(null,4,5,$APP.V,[new $APP.T(null,1,5,$APP.V,[$APP.tt],null),
new $APP.T(null,1,5,$APP.V,[$APP.tt],null),$v,"Cursor [esc]"],null),new $APP.T(null,4,5,$APP.V,[new $APP.T(null,1,5,$APP.V,[$APP.wt],null),new $APP.T(null,1,5,$APP.V,[$APP.wt],null),Vv,"Wire [w]"],null),new $APP.T(null,4,5,$APP.V,[new $APP.T(null,1,5,$APP.V,[$APP.ut],null),new $APP.T(null,1,5,$APP.V,[$APP.ut],null),Ov,"Eraser [e]"],null),new $APP.T(null,4,5,$APP.V,[new $APP.T(null,1,5,$APP.V,[$APP.vt],null),new $APP.T(null,1,5,$APP.V,[$APP.vt],null),Tw,"Pan [space]"],null),new $APP.T(null,4,5,$APP.V,
[new $APP.T(null,1,5,$APP.V,[$APP.Ht],null),new $APP.T(null,1,5,$APP.V,[$APP.Ht],null),Uw,"Probe nodes in a connected simulator"],null)],null)],null),new $APP.T(null,1,5,$APP.V,[Vw],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Rotate selected clockwise [s]",$APP.Kp,function(){return Cv(function(a){return a.rotate(90)})}],null),new $APP.T(null,1,5,$APP.V,[$APP.pt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Rotate selected counter-clockwise [shift+s]",
$APP.Kp,function(){return Cv(function(a){return a.rotate(-90)})}],null),new $APP.T(null,1,5,$APP.V,[$APP.qt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Mirror selected horizontal [shift+f]",$APP.Kp,function(){return Cv(function(a){return a.flipY()})}],null),new $APP.T(null,1,5,$APP.V,[$APP.st],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Mirror selected vertical [f]",$APP.Kp,function(){return Cv(function(a){return a.flipX()})}],null),new $APP.T(null,
1,5,$APP.V,[$APP.rt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Delete selected [del]",$APP.Kp,function(){return Ev()}],null),new $APP.T(null,1,5,$APP.V,[$APP.yt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Copy selected [ctrl+c]",$APP.Kp,function(){return Nw()}],null),new $APP.T(null,1,5,$APP.V,[$APP.At],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Cut selected [ctrl+x]",$APP.Kp,function(){return Ow()}],null),new $APP.T(null,
1,5,$APP.V,[$APP.Bt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Paste [ctrl+v]",$APP.Kp,function(){return Pw()}],null),new $APP.T(null,1,5,$APP.V,[$APP.Ct],null)],null),new $APP.T(null,1,5,$APP.V,[Vw],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"zoom in [scroll wheel/pinch]",$APP.Kp,function(){return wv(-1)}],null),new $APP.T(null,1,5,$APP.V,[$APP.lt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"zoom out [scroll wheel/pinch]",
$APP.Kp,function(){return wv(1)}],null),new $APP.T(null,1,5,$APP.V,[$APP.mt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"undo [ctrl+z]",$APP.Kp,tu],null),new $APP.T(null,1,5,$APP.V,[$APP.ot],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"redo [ctrl+shift+z]",$APP.Kp,uu],null),new $APP.T(null,1,5,$APP.V,[$APP.nt],null)],null)],null),new $APP.T(null,6,5,$APP.V,[Ww,new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,3,[Zu,Rw(),Xw,"simulator",$APP.qq,"Open simulator"],
null),new $APP.T(null,1,5,$APP.V,[$APP.Ft],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,3,[Zu,window.notebookurl,Xw,"jupyter",$APP.qq,"Open JupyterLab"],null),new $APP.T(null,1,5,$APP.V,[$APP.Et],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,3,[Zu,"..",Xw,"libman",$APP.qq,"Open library manager"],null),new $APP.T(null,1,5,$APP.V,[$APP.Gt],null)],null),new $APP.T(null,3,5,$APP.V,[Fw,new $APP.n(null,2,[$APP.qq,"Save Snapshot",$APP.Kp,Ew],null),new $APP.T(null,1,5,$APP.V,
[$APP.zt],null)],null),new $APP.T(null,4,5,$APP.V,[Gw,new $APP.n(null,1,[$APP.yp,function(a){return $APP.Z.u(sv,$APP.Y,Yw,a.target.value)}],null),new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.vr,"tetris"],null),"Tetris"],null),new $APP.T(null,3,5,$APP.V,[Hw,new $APP.n(null,1,[$APP.vr,"eyesore"],null),"Classic"],null)],null)],null)],null)},$w=function(a){return $APP.G.h(a,$APP.cs.g($APP.y(zv)))?"active":null},cx=function(a){return new $APP.T(null,2,5,$APP.V,[$APP.iq,new $APP.n(null,1,[ax,
new $APP.n(null,1,[bx,function(){switch(a){case "resistor":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"40"\n   height\x3d"40"\n   viewBox\x3d"0 0 40 40"\n   version\x3d"1.1"\n   id\x3d"svg4"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs8" /\x3e\n  \x3cpath\n     style\x3d"stroke-width:0.078125"\n     d\x3d"M 9.8046875,27.745269 C 9.6757813,27.665644 9.5060914,27.52819 9.4275984,27.439816 9.3491055,27.351441 8.657132,25.720431 7.8898797,23.815348 L 6.4948748,20.351562 3.2474374,20.331174 0,20.310786 v -1.291648 -1.291649 l 3.8476563,0.02297 c 4.2008273,0.02508 4.124189,0.01681 4.4927023,0.485294 0.083066,0.105602 0.530325,1.134624 0.9939078,2.286717 0.463582,1.152092 0.8821216,2.171499 0.9300866,2.265348 0.07522,0.147166 0.311909,-0.459912 1.720999,-4.414063 2.17264,-6.096808 2.039651,-5.759082 2.365731,-6.007795 0.394424,-0.300842 1.053204,-0.341453 1.422983,-0.08772 0.14644,0.100482 0.329544,0.270586 0.406898,0.378008 0.07735,0.107422 0.951591,2.408115 1.942751,5.112651 0.991158,2.704536 1.814905,4.930136 1.830548,4.945778 0.01564,0.01564 0.09878,-0.175676 0.184751,-0.425151 1.768011,-5.13049 3.319902,-9.515212 3.423924,-9.673968 0.273606,-0.417575 1.102947,-0.64298 1.539854,-0.418514 0.476521,0.244818 0.586034,0.464627 2.764406,5.548616 1.194064,2.786761 2.189705,5.066838 2.212536,5.066838 0.02283,0 0.338643,-0.955898 0.701803,-2.124218 0.363159,-1.16832 0.731506,-2.229896 0.818548,-2.359058 0.08704,-0.129161 0.281186,-0.307052 0.431431,-0.395312 0.264028,-0.155103 0.401958,-0.161243 4.120828,-0.183449 L 40,17.727489 v 1.292506 1.292505 h -3.19977 -3.199771 l -0.388987,1.230469 c -0.213942,0.676758 -0.694671,2.214843 -1.068285,3.417968 -0.433867,1.397154 -0.749885,2.282233 -0.874666,2.449697 -0.487603,0.654392 -1.568162,0.630667 -2.018859,-0.04433 -0.12436,-0.186251 -3.150054,-7.151412 -4.386126,-10.096882 -0.08515,-0.202911 -0.128732,-0.241578 -0.176102,-0.15625 -0.03462,0.06236 -0.843722,2.361993 -1.798,5.110288 -0.954279,2.748295 -1.792639,5.075017 -1.863025,5.170493 -0.202047,0.274079 -0.662052,0.49667 -1.026409,0.49667 -0.362897,0 -0.824359,-0.222439 -1.023937,-0.493569 -0.06902,-0.09377 -0.947914,-2.411704 -1.953086,-5.150962 -1.005174,-2.739258 -1.845222,-4.980469 -1.866775,-4.980469 -0.02155,0 -0.825081,2.206055 -1.785618,4.902344 -0.960537,2.696289 -1.827478,5.028685 -1.926536,5.183102 -0.327132,0.509955 -1.136778,0.704641 -1.6393605,0.394198 z"\n     id\x3d"path861" /\x3e\n\x3c/svg\x3e\n';
case "capacitor":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"37"\n   height\x3d"37"\n   viewBox\x3d"0 0 37 37"\n   version\x3d"1.1"\n   id\x3d"svg4"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs8" /\x3e\n  \x3cpath\n     style\x3d"stroke-width:0.0722656"\n     d\x3d"M 11.779297,26.34082 V 19.728516 H 5.8896484 0 V 18.5 17.271484 H 5.8896484 11.779297 V 10.65918 4.046875 h 1.192383 1.192383 V 18.5 32.953125 H 12.97168 11.779297 Z M 22.835937,18.5 V 4.046875 h 1.192383 1.192383 v 6.612305 6.612304 H 31.110352 37 V 18.5 19.728516 h -5.889648 -5.889649 v 6.612304 6.612305 H 24.02832 22.835937 Z"\n     id\x3d"path843" /\x3e\n\x3c/svg\x3e\n';
case "inductor":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"37"\n   height\x3d"37"\n   viewBox\x3d"0 0 37 37"\n   version\x3d"1.1"\n   id\x3d"svg4"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs8" /\x3e\n  \x3cpath\n     style\x3d"stroke-width:0.0722656"\n     d\x3d"m 34.776705,21.318359 c -2.025823,0 -2.245454,-0.01188 -2.472772,-0.133795 -0.356422,-0.191151 -0.494489,-0.411851 -0.652026,-1.042264 -0.07629,-0.305299 -0.185936,-0.645245 -0.24365,-0.755433 -0.38011,-0.725712 -1.22965,-1.260792 -2.077834,-1.308719 -1.14891,-0.06492 -2.115624,0.598025 -2.530248,1.735168 -0.250797,0.687836 -0.750866,1.009931 -1.403533,0.904017 -0.389144,-0.06315 -0.68111,-0.317715 -0.87794,-0.765479 -0.325164,-0.739704 -0.415697,-0.883119 -0.763746,-1.209866 -0.441205,-0.414201 -0.901281,-0.616174 -1.501396,-0.659112 -1.146558,-0.08204 -2.087722,0.527491 -2.545372,1.648461 -0.209557,0.51329 -0.323047,0.66716 -0.630063,0.854237 -0.486776,0.296612 -1.346232,0.09747 -1.567827,-0.363277 -0.04459,-0.09272 -0.178397,-0.384881 -0.297342,-0.649243 -0.262587,-0.583617 -0.685975,-1.023369 -1.23156,-1.279158 -0.347019,-0.162695 -0.505571,-0.191302 -1.058544,-0.190992 -0.77681,4.34e-4 -1.148218,0.141908 -1.677808,0.639084 -0.348049,0.326747 -0.438582,0.470162 -0.763746,1.209866 -0.19683,0.447764 -0.488796,0.70233 -0.87794,0.765479 -0.619261,0.100493 -1.169122,-0.22861 -1.370777,-0.820436 C 9.9753163,19.141869 9.572666,18.671434 8.8679374,18.302522 8.5396491,18.130669 8.4074464,18.105134 7.8397378,18.103926 c -0.5920506,-0.0013 -0.6955906,0.02031 -1.1351504,0.236511 -0.4770863,0.234657 -0.8920181,0.624826 -1.1128445,1.04643 -0.057714,0.110188 -0.1673566,0.450134 -0.2436496,0.755433 -0.1575372,0.630413 -0.2956042,0.851113 -0.6520258,1.042264 -0.2273181,0.121912 -0.4469493,0.133795 -2.472772,0.133795 H 0 v -1.192382 -1.192383 h 1.5845462 1.5845461 l 0.1861616,-0.406631 c 0.5541643,-1.210454 1.5056426,-2.08213 2.8156819,-2.579525 0.5549514,-0.210704 0.6412504,-0.222567 1.6337517,-0.224589 1.0052004,-0.002 1.0721863,0.0072 1.6457159,0.22682 0.6169126,0.236251 1.4397136,0.736733 1.7429416,1.060173 l 0.172837,0.184358 0.341687,-0.304619 c 0.843727,-0.752198 1.813117,-1.140941 2.972427,-1.191997 1.290332,-0.05683 2.43421,0.315294 3.385598,1.101387 0.218322,0.18039 0.413669,0.327982 0.434106,0.327982 0.02044,0 0.215784,-0.147592 0.434106,-0.327982 0.953837,-0.788116 2.098458,-1.159675 3.385598,-1.099009 1.168497,0.05507 2.132657,0.440948 2.972427,1.189619 l 0.341687,0.304619 0.172837,-0.184358 c 0.303228,-0.32344 1.126029,-0.823922 1.742942,-1.060173 0.573529,-0.219636 0.640515,-0.228869 1.645715,-0.22682 0.992502,0.002 1.078801,0.01389 1.633752,0.224589 1.310039,0.497395 2.261517,1.369071 2.815682,2.579525 l 0.186161,0.406631 H 35.415454 37 v 1.192383 1.192382 z"\n     id\x3d"path843" /\x3e\n\x3c/svg\x3e\n';
case "diode":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"39.5"\n   height\x3d"25"\n   viewBox\x3d"0 0 39.5 25"\n   version\x3d"1.1"\n   id\x3d"svg16"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs20" /\x3e\n  \x3cg\n     transform\x3d"translate(1.25)"\n     id\x3d"g14"\x3e\n    \x3cg\n       transform\x3d"translate(31) rotate(90)"\n       id\x3d"g6"\x3e\n      \x3cpath\n         d\x3d"M12.5,0,25,21H0Z"\n         fill\x3d"none"\n         id\x3d"path2" /\x3e\n      \x3cpath\n         d\x3d"M 12.5 5.865288734436035 L 5.276956558227539 18 L 19.72304153442383 18 L 12.5 5.865288734436035 M 12.5 0 L 25 21 L 0 21 L 12.5 0 Z"\n         id\x3d"path4" /\x3e\n    \x3c/g\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 21 22.25 h 2.5 V 21 0 -1.25 Z"\n       id\x3d"line8"\n       transform\x3d"translate(29 2)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 8 9.25 h 2.5 V 8 0 -1.25 Z"\n       id\x3d"line10"\n       transform\x3d"translate(37 12.5) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 9 10.25 h 2.5 V 9 0 -1.25 Z"\n       id\x3d"line12"\n       transform\x3d"translate(9 13) rotate(90)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "vsource":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"34"\n   height\x3d"34"\n   viewBox\x3d"0 0 34 34"\n   version\x3d"1.1"\n   id\x3d"svg8"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs12" /\x3e\n  \x3cg\n     transform\x3d"translate(1.5 1.5)"\n     id\x3d"g6"\x3e\n    \x3cpath\n       d\x3d"m 15.5,-1.5 c -9.3710644,0 -17,7.6289356 -17,17 0,9.371064 7.6289356,17 17,17 9.371064,0 17,-7.628936 17,-17 0,-9.3710644 -7.628936,-17 -17,-17 z m 0,3 c 7.749746,0 14,6.2502543 14,14 0,7.749746 -6.250254,14 -14,14 -7.7497457,0 -14,-6.250254 -14,-14 0,-7.7497457 6.2502543,-14 14,-14 z"\n       id\x3d"circle2" /\x3e\n    \x3cpath\n       d\x3d"M4.609-7.67a3.875,3.875,0,0,0-1.775.49A7.482,7.482,0,0,0,1.074-5.9V-9.278a5.186,5.186,0,0,1,3.867-1.594,8.876,8.876,0,0,1,2.077.234,14.34,14.34,0,0,1,2.107.7,9.186,9.186,0,0,0,3.429.8A4.013,4.013,0,0,0,14.307-9.6a6.466,6.466,0,0,0,1.767-1.3v3.377A5.124,5.124,0,0,1,12.207-5.93a9.255,9.255,0,0,1-1.9-.19,14.389,14.389,0,0,1-2.266-.731A9.22,9.22,0,0,0,4.609-7.67Z"\n       transform\x3d"translate(6.926 23.901)"\n       id\x3d"path4" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "isource":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"34"\n   height\x3d"34"\n   viewBox\x3d"0 0 34 34"\n   version\x3d"1.1"\n   id\x3d"svg10"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs14" /\x3e\n  \x3cg\n     transform\x3d"translate(1.5 1.5)"\n     id\x3d"g8"\x3e\n    \x3cg\n       id\x3d"circle2"\x3e\n      \x3cpath\n         style\x3d"fill:none;stroke-width:3;"\n         d\x3d"M 31,15.5 A 15.5,15.5 0 0 1 15.5,31 15.5,15.5 0 0 1 0,15.5 15.5,15.5 0 0 1 15.5,0 15.5,15.5 0 0 1 31,15.5 Z"\n         id\x3d"path922" /\x3e\n      \x3cpath\n         d\x3d"m 15.5,-1.5 c -9.3710644,0 -17,7.6289356 -17,17 0,9.371064 7.6289356,17 17,17 9.371064,0 17,-7.628936 17,-17 0,-9.3710644 -7.628936,-17 -17,-17 z m 0,3 c 7.749746,0 14,6.2502543 14,14 0,7.749746 -6.250254,14 -14,14 -7.7497457,0 -14,-6.250254 -14,-14 0,-7.7497457 6.2502543,-14 14,-14 z"\n         id\x3d"path924" /\x3e\n    \x3c/g\x3e\n    \x3cpath\n       d\x3d"M 16.993489,22.25 H 16.842076 L 16.074478,21.482402 15.30688,20.714804 17.90344,18.107402 20.5,15.5 17.897669,12.886803 15.295337,10.273606 16.153714,9.4512289 17.012091,8.6288517 20.446183,12.062943 23.880275,15.497035 20.512589,18.873517 17.144903,22.25 Z"\n       id\x3d"path1846" /\x3e\n    \x3cpath\n       d\x3d"m 0,-1.25 v 2.5 h 12 v -2.5 z"\n       id\x3d"line6"\n       transform\x3d"translate(8.5 15.5)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "pmos":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.5"\n   height\x3d"29.5"\n   viewBox\x3d"0 0 22.5 29.5"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-58.75 -773.75)"\n     id\x3d"g16"\x3e\n    \x3cg\n       id\x3d"line2"\n       transform\x3d"translate(60 780)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 17"\n         id\x3d"path884" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n         id\x3d"path886" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line4"\n       transform\x3d"translate(66 780)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 17"\n         id\x3d"path878" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n         id\x3d"path880" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line6"\n       transform\x3d"translate(80 780) rotate(90)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 12"\n         id\x3d"path872" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n         id\x3d"path874" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line8"\n       transform\x3d"translate(80 797) rotate(90)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 12"\n         id\x3d"path866" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n         id\x3d"path868" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line10"\n       transform\x3d"translate(80 797)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 5"\n         id\x3d"path860" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n         id\x3d"path862" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line12"\n       transform\x3d"translate(80 775)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 5"\n         id\x3d"path854" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n         id\x3d"path856" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"path14"\n       transform\x3d"translate(67 786) rotate(-90)"\x3e\n      \x3cpath\n         d\x3d"m 6,0 6,9 H 0 Z"\n         id\x3d"path848" /\x3e\n      \x3cpath\n         d\x3d"m 6,-0.90234375 -0.4160156,0.625 L -0.93359375,9.5 H 12.933594 Z M 6,0.90234375 11.066406,8.5 H 0.93359375 Z"\n         id\x3d"path850" /\x3e\n    \x3c/g\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "nmos":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.5"\n   height\x3d"29.5"\n   viewBox\x3d"0 0 22.5 29.5"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-58.75 -773.75)"\n     id\x3d"g16"\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"line2"\n       transform\x3d"translate(60 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"line4"\n       transform\x3d"translate(66 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line6"\n       transform\x3d"translate(80 780) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line8"\n       transform\x3d"translate(80 797) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line10"\n       transform\x3d"translate(80 797)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line12"\n       transform\x3d"translate(80 775)" /\x3e\n    \x3cpath\n       d\x3d"M6,0l6,9H0Z"\n       transform\x3d"translate(79 774) rotate(90)"\n       id\x3d"path14" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "npn":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.745"\n   height\x3d"28.6"\n   viewBox\x3d"0 0 22.745 28.6"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-57.25 -774.45)"\n     id\x3d"g16"\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"path898"\n       transform\x3d"translate(66 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"path895"\n       transform\x3d"translate(77.892 781.5) rotate(60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"path892"\n       transform\x3d"translate(67.5 790) rotate(-60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"path889"\n       transform\x3d"translate(78.37 796.8)" /\x3e\n    \x3cpath\n       d\x3d"M5,0l5,7.5H0Z"\n       transform\x3d"translate(74.995 777.5) rotate(60)"\n       id\x3d"path886" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"path883"\n       transform\x3d"translate(63.5 788.5) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"path880"\n       transform\x3d"translate(78.37 775.7)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "pnp":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.37"\n   height\x3d"28.6"\n   viewBox\x3d"0 0 22.37 28.6"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-57.25 -774.45)"\n     id\x3d"g16"\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"line2"\n       transform\x3d"translate(66 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line4"\n       transform\x3d"translate(77.892 781.5) rotate(60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line6"\n       transform\x3d"translate(67.5 790) rotate(-60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line8"\n       transform\x3d"translate(78.37 796.8)" /\x3e\n    \x3cpath\n       d\x3d"M5,0l5,7.5H0Z"\n       transform\x3d"translate(72.499 790.41) rotate(-120)"\n       id\x3d"path10" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line12"\n       transform\x3d"translate(63.5 788.5) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line14"\n       transform\x3d"translate(78.37 775.7)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
default:return""}}()],null)],null)],null)},ex=function(a){return ww("port",a,$APP.K([dx,"ground",$APP.$q,$APP.Po($APP.Ns.rotate(-90)),$APP.fj,"GND"]))},fx=function(a){return ww("port",a,$APP.K([dx,"supply",$APP.$q,$APP.Po($APP.Ns.rotate(90)),$APP.fj,"VDD"]))},ix=function(){return new $APP.T(null,9,5,$APP.V,[$APP.Sp,new $APP.T(null,4,5,$APP.V,[gx,new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add port [p]",$APP.Xk,$w("port"),hx,function(a){return xw("port",rv(a))}],null),new $APP.T(null,
1,5,$APP.V,[$APP.xt],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add ground [g]",$APP.Xk,$w("port"),hx,function(a){return ex(rv(a))}],null),"GND"],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add power supply [shift+p]",$APP.Xk,$w("port"),hx,function(a){return fx(rv(a))}],null),"VDD"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add resistor [r]",$APP.Xk,$w("resistor"),hx,function(a){return xw("resistor",rv(a))}],
null),new $APP.T(null,2,5,$APP.V,[cx,"resistor"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add inductor [l]",$APP.Xk,$w("inductor"),hx,function(a){return xw("inductor",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"inductor"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add capacitor [c]",$APP.Xk,$w("capacitor"),hx,function(a){return xw("capacitor",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"capacitor"],null)],null),new $APP.T(null,
3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add diode [d]",$APP.Xk,$w("diode"),hx,function(a){return xw("diode",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"diode"],null)],null),new $APP.T(null,3,5,$APP.V,[gx,new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add voltage source [v]",$APP.Xk,$w("vsource"),hx,function(a){return xw("vsource",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"vsource"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add current source [i]",
$APP.Xk,$w("isource"),hx,function(a){return xw("isource",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"isource"],null)],null)],null),new $APP.T(null,5,5,$APP.V,[gx,new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add N-channel mosfet [m]",$APP.Xk,$w("nmos"),hx,function(a){return xw("nmos",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"nmos"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add P-channel mosfet [shift+m]",$APP.Xk,$w("pmos"),hx,function(a){return xw("pmos",
rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"pmos"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add NPN BJT [b]",$APP.Xk,$w("npn"),hx,function(a){return xw("npn",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"npn"],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,new $APP.n(null,3,[$APP.qq,"Add PNP BJT [shift+b]",$APP.Xk,$w("pnp"),hx,function(a){return xw("pnp",rv(a))}],null),new $APP.T(null,2,5,$APP.V,[cx,"pnp"],null)],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Tq,
new $APP.n(null,3,[$APP.qq,"Add subcircuit [x]",$APP.Xk,$w("ckt"),hx,function(a){return xw("ckt",rv(a))}],null),new $APP.T(null,1,5,$APP.V,[$APP.Dt],null)],null)],null)},jx=function(a){return new $APP.T(null,5,5,$APP.V,[$APP.Sp,function(){return function d(c){return new $APP.se(null,function(){for(var e=c;;)if(e=$APP.C(e)){if($APP.Ed(e)){var f=$APP.sc(e),g=$APP.F(f),h=$APP.ve(g);a:for(var l=0;;)if(l<g){var m=$APP.rd(f,l),q=$APP.M(m,0,null);m=$APP.M(m,1,null);$APP.G.h("wire",$APP.cs.g(m))&&(q=qw(hv,
m,q,m),h.add(q));l+=1}else{f=!0;break a}return f?$APP.ye($APP.Ae(h),d($APP.tc(e))):$APP.ye($APP.Ae(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);if($APP.G.h("wire",$APP.cs.g(f)))return $APP.Q(qw(hv,f,h,f),d($APP.Sc(e)));e=$APP.Sc(e)}else return null},null,null)}(a)}(),function(){return function d(c){return new $APP.se(null,function(){for(var e=c;;)if(e=$APP.C(e)){if($APP.Ed(e)){var f=$APP.sc(e),g=$APP.F(f),h=$APP.ve(g);a:for(var l=0;;)if(l<g){var m=$APP.rd(f,l),q=$APP.M(m,0,null);m=$APP.M(m,
1,null);$APP.Ne("wire",$APP.cs.g(m))&&(q=qw(hv,m,q,m),h.add(q));l+=1}else{f=!0;break a}return f?$APP.ye($APP.Ae(h),d($APP.tc(e))):$APP.ye($APP.Ae(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);if($APP.Ne("wire",$APP.cs.g(f)))return $APP.Q(qw(hv,f,h,f),d($APP.Sc(e)));e=$APP.Sc(e)}else return null},null,null)}(a)}(),function(){return function d(c){return new $APP.se(null,function(){for(;;){var e=$APP.C(c);if(e){if($APP.Ed(e)){var f=$APP.sc(e),g=$APP.F(f),h=$APP.ve(g);a:for(var l=0;;)if(l<
g){var m=$APP.rd(f,l),q=$APP.M(m,0,null);m=$APP.M(m,1,null);q=qw(nw,m,q,m);h.add(q);l+=1}else{f=!0;break a}return f?$APP.ye($APP.Ae(h),d($APP.tc(e))):$APP.ye($APP.Ae(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);return $APP.Q(qw(nw,f,h,f),d($APP.Sc(e)))}return null}},null,null)}(a)}(),function(){return function d(c){return new $APP.se(null,function(){for(;;){var e=$APP.C(c);if(e){if($APP.Ed(e)){var f=$APP.sc(e),g=$APP.F(f),h=$APP.ve(g);a:for(var l=0;;)if(l<g){var m=$APP.rd(f,l),q=$APP.M(m,
0,null);m=$APP.M(m,1,null);q=qw(gv,m,q,m);h.add(q);l+=1}else{f=!0;break a}return f?$APP.ye($APP.Ae(h),d($APP.tc(e))):$APP.ye($APP.Ae(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);return $APP.Q(qw(gv,f,h,f),d($APP.Sc(e)))}return null}},null,null)}(a)}()],null)},lx=function(){return new $APP.T(null,2,5,$APP.V,[$APP.Sp,function(){return function c(b){return new $APP.se(null,function(){for(var d=b;;)if(d=$APP.C(d)){if($APP.Ed(d)){var e=$APP.sc(d),f=$APP.F(e),g=$APP.ve(f);a:for(var h=0;;)if(h<
f){var l=$APP.rd(e,h),m=$APP.M(l,0,null),q=$APP.M(m,0,null);m=$APP.M(m,1,null);l=$APP.M(l,1,null);l=$APP.F(l);$APP.Ne(l,2)&&g.add(new $APP.T(null,2,5,$APP.V,[kx,new $APP.n(null,5,[$APP.ij,new $APP.T(null,2,5,$APP.V,[q,m],null),$APP.Xk,2<l?"wire":"nc",wu,50*(q+.5),xu,50*(m+.5),$APP.qr,5],null)],null));h+=1}else{e=!0;break a}return e?$APP.ye($APP.Ae(g),c($APP.tc(d))):$APP.ye($APP.Ae(g),null)}f=$APP.D(d);e=$APP.M(f,0,null);g=$APP.M(e,0,null);e=$APP.M(e,1,null);f=$APP.M(f,1,null);f=$APP.F(f);if($APP.Ne(f,
2))return $APP.Q(new $APP.T(null,2,5,$APP.V,[kx,new $APP.n(null,5,[$APP.ij,new $APP.T(null,2,5,$APP.V,[g,e],null),$APP.Xk,2<f?"wire":"nc",wu,50*(g+.5),xu,50*(e+.5),$APP.qr,5],null)],null),c($APP.Sc(d)));d=$APP.Sc(d)}else return null},null,null)}($APP.D($APP.y(nv)))}()],null)},sx=function(){var a=$APP.y(sv),b=$APP.Me(a),c=$APP.P.h(b,Dv);a=$APP.P.h(b,Lv);var d=$APP.P.h(b,Uv),e=$APP.P.h(b,rw);e=$APP.Me(e);var f=$APP.P.h(e,$APP.or),g=$APP.P.h(e,$APP.nr);b=$APP.P.h(b,Hv);var h=$APP.M(b,0,null),l=$APP.M(b,
1,null);b=50*Math.round(f);e=50*Math.round(g);return $APP.p(d)?new $APP.T(null,4,5,$APP.V,[mx,qw(hv,d,nx,d),qw(nw,d,ox,d),qw(gv,d,px,d)],null):$APP.G.h(a,fw)?new $APP.T(null,2,5,$APP.V,[qx,new $APP.n(null,4,[$APP.or,50*function(){var m=h+f;return h<m?h:m}(),$APP.nr,50*function(){var m=l+g;return l<m?l:m}(),Bu,Math.abs(50*f),Cu,Math.abs(50*g)],null)],null):$APP.p($APP.p(c)?a:c)?new $APP.T(null,3,5,$APP.V,[rx,new $APP.n(null,1,[$APP.fq,new $APP.n(null,1,[$APP.$q,["translate(",$APP.x.g(b),"px, ",$APP.x.g(e),
"px)"].join("")],null)],null),new $APP.T(null,2,5,$APP.V,[jx,function(){var m=$APP.y(Lt);return $APP.lf.h(function(q){return new $APP.T(null,2,5,$APP.V,[q,$APP.P.h(m,q)],null)},c)}()],null)],null):null},Qx=function(){return new $APP.T(null,4,5,$APP.V,[tx,new $APP.n(null,1,[$APP.Xk,$APP.y(ux)],null),new $APP.T(null,2,5,$APP.V,[vx,new $APP.T(null,1,5,$APP.V,[Zw],null)],null),new $APP.T(null,4,5,$APP.V,[wx,new $APP.T(null,2,5,$APP.V,[xx,new $APP.T(null,1,5,$APP.V,[ix],null)],null),function(){var a=$APP.C($APP.y(Bv));
return a?new $APP.T(null,2,5,$APP.V,[yx,$APP.Ih(function(){return function d(c){return new $APP.se(null,function(){for(;;){var e=$APP.C(c);if(e){if($APP.Ed(e)){var f=$APP.sc(e),g=$APP.F(f),h=$APP.ve(g);a:for(var l=0;;)if(l<g){var m=$APP.rd(f,l);m=$APP.vd(new $APP.T(null,2,5,$APP.V,[Lw,m],null),new $APP.n(null,1,[$APP.ij,m],null));h.add(m);l+=1}else{f=!0;break a}return f?$APP.ye($APP.Ae(h),d($APP.tc(e))):$APP.ye($APP.Ae(h),null)}h=$APP.D(e);return $APP.Q($APP.vd(new $APP.T(null,2,5,$APP.V,[Lw,h],null),
new $APP.n(null,1,[$APP.ij,h],null)),d($APP.Sc(e)))}return null}},null,null)}(a)}())],null):null}(),new $APP.T(null,7,5,$APP.V,[zx,$APP.Ug([Bu,Ax,Bx,Cx,Dx,$u,$APP.Xk,Ex,hx,Cu],["100%",vv,hw,"http://www.w3.org/2000/svg",$APP.y(Fx),gw,new $APP.T(null,2,5,$APP.V,[$APP.y(ux),$APP.y(Nv)],null),Tv,vw,"100%"]),new $APP.T(null,2,5,$APP.V,[Gx,new $APP.T(null,4,5,$APP.V,[Hx,new $APP.n(null,4,[$APP.Zk,"gridfill",Ix,"userSpaceOnUse",Bu,50,Cu,50],null),new $APP.T(null,2,5,$APP.V,[Jx,new $APP.n(null,4,[Kx,0,Lx,
0,Mx,50,Nx,0],null)],null),new $APP.T(null,2,5,$APP.V,[Jx,new $APP.n(null,4,[Kx,0,Lx,0,Mx,0,Nx,50],null)],null)],null)],null),new $APP.T(null,2,5,$APP.V,[Ox,new $APP.n(null,6,[Px,"url(#gridfill)",hx,vw,$APP.or,-25E3,$APP.nr,-25E3,Bu,5E4,Cu,5E4],null)],null),new $APP.T(null,2,5,$APP.V,[jx,$APP.y(Lt)],null),new $APP.T(null,1,5,$APP.V,[lx],null),new $APP.T(null,1,5,$APP.V,[sx],null)],null)],null)],null)},Tx=function(){document.onkeyup=$APP.Pn.h(nu,Rx);document.onkeydown=$APP.Pn.h(nu,Sx);var a=new $APP.T(null,
1,5,$APP.V,[Qx],null),b=document.getElementById("mosaic_editor");return $APP.ll(a,b)},Vx=function(){$APP.C(Uu)&&Ux.sync(Uu,{live:!0,retry:!0});return Tx()},Wx={},Xx,St=function St(a){switch(arguments.length){case 2:return St.h(arguments[0],arguments[1]);case 3:return St.i(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.B(c.slice(3),0,null);return St.l(arguments[0],arguments[1],arguments[2],c)}};
St.h=function(a,b){return b};St.i=function(a,b,c){return(a.g?a.g(b):a.call(null,b))>(a.g?a.g(c):a.call(null,c))?b:c};St.l=function(a,b,c,d){return $APP.Ua(function(e,f){return St.i(a,e,f)},St.i(a,b,c),d)};St.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};St.C=3;
var ku=function ku(a){switch(arguments.length){case 1:return ku.g(arguments[0]);case 2:return ku.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.B(c.slice(2),0,null);return ku.l(arguments[0],arguments[1],c)}};ku.g=function(a){return a};ku.h=function(a,b){return a>b?a:b};ku.l=function(a,b,c){return $APP.Ua(ku,a>b?a:b,c)};ku.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);c=$APP.E(c);return this.l(b,a,c)};ku.C=2;
var pv=function pv(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=1<c.length?new $APP.B(c.slice(1),0,null):null;return pv.l(arguments[0],c)};pv.l=function(a,b){if($APP.p($APP.Ye($APP.ce,b))){var c=function(d,e){var f=$APP.zb(e),g=$APP.Ab(e);if($APP.Nd(d,f)){e=$APP.Y.i;var h=$APP.P.h(d,f);g=a.h?a.h(h,g):a.call(null,h,g);d=e.call($APP.Y,d,f,g)}else d=$APP.Y.i(d,f,g);return d};return $APP.$d(function(d,e){return $APP.Ua(c,$APP.p(d)?d:$APP.Re,$APP.C(e))},b)}return null};
pv.C=1;pv.D=function(a){var b=$APP.D(a);a=$APP.E(a);return this.l(b,a)};$APP.k=Pt.prototype;$APP.k.toString=function(){return $APP.Ac(this)};$APP.k.I=function(){return this.meta};$APP.k.da=function(){return this.ga(null)};$APP.k.Z=function(){return $APP.Rc};$APP.k.ea=function(a,b){a=this.ca(null);var c=this.f.g?this.f.g(a):this.f.call(null,a);for(a=b.h?b.h(a,c):b.call(null,a,c);;){if($APP.$c(a))return $APP.y(a);c=this.f.g?this.f.g(c):this.f.call(null,c);a=b.h?b.h(a,c):b.call(null,a,c)}};
$APP.k.fa=function(a,b,c){a=this.ca(null);for(c=b.h?b.h(c,a):b.call(null,c,a);;){if($APP.$c(c))return $APP.y(c);a=this.f.g?this.f.g(a):this.f.call(null,a);c=b.h?b.h(c,a):b.call(null,c,a)}};$APP.k.ca=function(){Wx===this.bd&&(this.bd=this.f.g?this.f.g(this.zd):this.f.call(null,this.zd));return this.bd};$APP.k.ga=function(){null==this.next&&(this.next=new Pt(null,this.f,this.ca(null),Wx,null));return this.next};$APP.k.U=function(){return this};
$APP.k.J=function(a,b){return b===this.meta?this:new Pt(b,this.f,this.zd,this.bd,this.next)};$APP.k.$=function(a,b){return $APP.Q(b,this)};$APP.k.T=$APP.z;$APP.k.K=function(a,b,c){return $APP.Mh(b,$APP.Sh,"("," ",")",c,this)};
var ov=function ov(a){switch(arguments.length){case 1:return ov.g(arguments[0]);case 2:return ov.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.B(c.slice(2),0,null);return ov.l(arguments[0],arguments[1],c)}};ov.g=function(a){return a};ov.h=function(a,b){for(;;)if($APP.F(b)<$APP.F(a)){var c=a;a=b;b=c}else return $APP.Ua(function(d,e){return function(f,g){return $APP.Nd(e,g)?f:$APP.$o.h(f,g)}}(a,b),a,a)};
ov.l=function(a,b,c){a=Tt(function(d){return-$APP.F(d)},$APP.le.l(c,b,$APP.K([a])));return $APP.Ua(ov,$APP.D(a),$APP.Sc(a))};ov.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);c=$APP.E(c);return this.l(b,a,c)};ov.C=2;
var Av=function Av(a){switch(arguments.length){case 3:return Av.i(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.B(c.slice(3),0,null);return Av.l(arguments[0],arguments[1],arguments[2],c)}};Av.i=function(a,b,c){return $APP.pi.i(a,$APP.lf.g(function(d){var e=$APP.V;var f=$APP.P.h(a,d);f=c.g?c.g(f):c.call(null,f);return new $APP.T(null,2,5,e,[d,f],null)}),b)};
Av.l=function(a,b,c,d){return $APP.pi.i(a,$APP.lf.g(function(e){return new $APP.T(null,2,5,$APP.V,[e,$APP.Ke.i(c,$APP.P.h(a,e),d)],null)}),b)};Av.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};Av.C=3;
var yv=function yv(a){switch(arguments.length){case 0:return yv.m();case 1:return yv.g(arguments[0]);case 2:return yv.h(arguments[0],arguments[1]);case 3:return yv.i(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.B(c.slice(3),0,null);return yv.l(arguments[0],arguments[1],arguments[2],c)}};yv.m=function(){return $APP.ce};yv.g=function(a){return a};
yv.h=function(a,b){return function(){function c(l,m,q){l=b.i?b.i(l,m,q):b.call(null,l,m,q);return a.g?a.g(l):a.call(null,l)}function d(l,m){l=b.h?b.h(l,m):b.call(null,l,m);return a.g?a.g(l):a.call(null,l)}function e(l){l=b.g?b.g(l):b.call(null,l);return a.g?a.g(l):a.call(null,l)}function f(){var l=b.m?b.m():b.call(null);return a.g?a.g(l):a.call(null,l)}var g=null,h=function(){function l(q,r,t,v){var u=null;if(3<arguments.length){u=0;for(var w=Array(arguments.length-3);u<w.length;)w[u]=arguments[u+
3],++u;u=new $APP.B(w,0,null)}return m.call(this,q,r,t,u)}function m(q,r,t,v){q=$APP.Ke.H(b,q,r,t,v);return a.g?a.g(q):a.call(null,q)}l.C=3;l.D=function(q){var r=$APP.D(q);q=$APP.E(q);var t=$APP.D(q);q=$APP.E(q);var v=$APP.D(q);q=$APP.Sc(q);return m(r,t,v,q)};l.l=m;return l}();g=function(l,m,q,r){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,l);case 2:return d.call(this,l,m);case 3:return c.call(this,l,m,q);default:var t=null;if(3<arguments.length){t=0;for(var v=Array(arguments.length-
3);t<v.length;)v[t]=arguments[t+3],++t;t=new $APP.B(v,0,null)}return h.l(l,m,q,t)}throw Error("Invalid arity: "+arguments.length);};g.C=3;g.D=h.D;g.m=f;g.g=e;g.h=d;g.i=c;g.l=h.l;return g}()};
yv.i=function(a,b,c){return function(){function d(m,q,r){m=c.i?c.i(m,q,r):c.call(null,m,q,r);m=b.g?b.g(m):b.call(null,m);return a.g?a.g(m):a.call(null,m)}function e(m,q){m=c.h?c.h(m,q):c.call(null,m,q);m=b.g?b.g(m):b.call(null,m);return a.g?a.g(m):a.call(null,m)}function f(m){m=c.g?c.g(m):c.call(null,m);m=b.g?b.g(m):b.call(null,m);return a.g?a.g(m):a.call(null,m)}function g(){var m=c.m?c.m():c.call(null);m=b.g?b.g(m):b.call(null,m);return a.g?a.g(m):a.call(null,m)}var h=null,l=function(){function m(r,
t,v,u){var w=null;if(3<arguments.length){w=0;for(var A=Array(arguments.length-3);w<A.length;)A[w]=arguments[w+3],++w;w=new $APP.B(A,0,null)}return q.call(this,r,t,v,w)}function q(r,t,v,u){r=$APP.Ke.H(c,r,t,v,u);r=b.g?b.g(r):b.call(null,r);return a.g?a.g(r):a.call(null,r)}m.C=3;m.D=function(r){var t=$APP.D(r);r=$APP.E(r);var v=$APP.D(r);r=$APP.E(r);var u=$APP.D(r);r=$APP.Sc(r);return q(t,v,u,r)};m.l=q;return m}();h=function(m,q,r,t){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,
m);case 2:return e.call(this,m,q);case 3:return d.call(this,m,q,r);default:var v=null;if(3<arguments.length){v=0;for(var u=Array(arguments.length-3);v<u.length;)u[v]=arguments[v+3],++v;v=new $APP.B(u,0,null)}return l.l(m,q,r,v)}throw Error("Invalid arity: "+arguments.length);};h.C=3;h.D=l.D;h.m=g;h.g=f;h.h=e;h.i=d;h.l=l.l;return h}()};
yv.l=function(a,b,c,d){var e=$APP.me($APP.Q(a,$APP.Q(b,$APP.Q(c,d))));return function(){function f(h){var l=null;if(0<arguments.length){l=0;for(var m=Array(arguments.length-0);l<m.length;)m[l]=arguments[l+0],++l;l=new $APP.B(m,0,null)}return g.call(this,l)}function g(h){h=$APP.Ke.h($APP.D(e),h);for(var l=$APP.E(e);;)if(l){var m=$APP.D(l);h=m.g?m.g(h):m.call(null,h);l=$APP.E(l)}else return h}f.C=0;f.D=function(h){h=$APP.C(h);return g(h)};f.l=g;return f}()};
yv.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};yv.C=3;var tw=function tw(a){switch(arguments.length){case 0:return tw.m();case 1:return tw.g(arguments[0]);case 2:return tw.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.B(c.slice(2),0,null);return tw.l(arguments[0],arguments[1],c)}};tw.m=function(){return $APP.uh};tw.g=function(a){return a};
tw.h=function(a,b){return $APP.F(a)<$APP.F(b)?$APP.Ua($APP.le,b,a):$APP.Ua($APP.le,a,b)};tw.l=function(a,b,c){a=Tt($APP.F,$APP.le.l(c,b,$APP.K([a])));return $APP.Ua($APP.pi,$APP.D(a),$APP.Sc(a))};tw.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);c=$APP.E(c);return this.l(b,a,c)};tw.C=2;Yt.prototype.sa=function(){var a=this,b=a.zc;return null==b?$APP.Ij(function(){return $APP.Ke.h(a.f,a.cc)},a.f,a.cc,this,null):$APP.y(b)};
Yt.prototype.N=function(a,b){return b instanceof Yt&&$APP.G.h(this.f,b.f)&&$APP.G.h(this.cc,b.cc)};Yt.prototype.O=function(){return $APP.Ic(new $APP.T(null,2,5,$APP.V,[this.f,this.cc],null))};Yt.prototype.K=function(a,b,c){return $APP.Ej(b,c,"Track",new $APP.n(null,2,[$APP.Ym,this.sa(null),$APP.mr,this.f],null))};
var Yx=function Yx(a,b,c){var e=new $APP.hi(function(){return $APP.Om.h(b,a)});if("undefined"===typeof $APP.Oe||"undefined"===typeof $APP.hn||"undefined"===typeof $APP.jn||"undefined"===typeof Xx)Xx=function(f,g,h,l,m){this.form=f;this.Pa=g;this.Oa=h;this.$b=l;this.Te=m;this.o=393216;this.B=0},Xx.prototype.J=function(f,g){return new Xx(this.form,this.Pa,this.Oa,this.$b,g)},Xx.prototype.I=function(){return this.Te},Xx.prototype.Ua=function(){return this},Xx.prototype.Va=function(){return this},Xx.prototype.Cb=
$APP.z,Xx.prototype.rb=function(f,g){return null==g?null:$APP.rm($APP.y(this.$b),g)},Xx.prototype.sb=function(f,g,h,l,m){f=$APP.y(this.$b);return $APP.Im($APP.dn(f,m,$APP.qn,null))&&null!=m?$APP.le.h($APP.fn(this.form,this.Pa,$APP.le.h(g,$APP.Pp),h,l,m),new $APP.n(null,5,[$APP.Um,$APP.le.h(g,$APP.jo),$APP.Xm,$APP.pq,$APP.Ym,m,$APP.$m,h,$APP.Vm,l],null)):null},Xx.prototype.tb=function(f,g){return Yx.i?Yx.i(this.form,this.Pa,g):Yx.call(null,this.form,this.Pa,g)},Xx.Na=!0,Xx.Ha="cljs.spec.alpha/t_cljs$spec$alpha14092",
Xx.Qa=function(f){return $APP.ac(f,"cljs.spec.alpha/t_cljs$spec$alpha14092")};return new Xx(a,b,c,e,$APP.Re)},Zx=new $APP.R(null,"nf","nf",76757951),Cx=new $APP.R(null,"xmlns","xmlns",-1862095571),dw=new $APP.R("nyancad.mosaic.editor","device","nyancad.mosaic.editor/device",1397330629),Mu=new $APP.R(null,"dominant-baseline","dominant-baseline",609259826),hv=new $APP.R("nyancad.mosaic.editor","bg","nyancad.mosaic.editor/bg",1513825358),Lu=new $APP.R(null,"text-anchor","text-anchor",585613696),$x=new $APP.R(null,
"delete","delete",-1768633620),ay=new $APP.R(null,"span.tray","span.tray",393150468),nw=new $APP.R("nyancad.mosaic.editor","sym","nyancad.mosaic.editor/sym",1888367968),Dw=new $APP.R(null,"data","data",-232669377),kx=new $APP.R(null,"circle","circle",1903212362),by=new $APP.R("nyancad.mosaic.editor","split","nyancad.mosaic.editor/split",-2060037753),Xw=new $APP.R(null,"target","target",253001721),Cw=new $APP.R(null,"content_type","content_type",52159344),Sv=new $APP.R("nyancad.mosaic.editor","view",
"nyancad.mosaic.editor/view",-479208243),rx=new $APP.R(null,"g.staging","g.staging",1672233513),cy=new $APP.R(null,"escape","escape",-991601952),Xu=new $APP.R(null,"model","model",331153215),mw=new $APP.Lc(null,"circuit-conn","circuit-conn",381274267,null),Jw=new $APP.R("nyancad.mosaic.editor","props","nyancad.mosaic.editor/props",1113223408),Jx=new $APP.R(null,"line.grid","line.grid",1678589712),Mx=new $APP.R(null,"x2","x2",-1362513475),Kx=new $APP.R(null,"x1","x1",-1863922247),px=new $APP.R("nyancad.mosaic.editor",
"stagingconn","nyancad.mosaic.editor/stagingconn",-932497011),dy=new $APP.R(null,"selected","selected",574897764),Bu=new $APP.R(null,"width","width",-384071477),iw=new $APP.Lc("nyancad.mosaic.editor","circuit-shape","nyancad.mosaic.editor/circuit-shape",-666412374,null),Hw=new $APP.R(null,"option","option",65132272),Zu=new $APP.R(null,"href","href",-793805698),Zv=new $APP.R("nyancad.mosaic.editor","tool","nyancad.mosaic.editor/tool",195718619),Nx=new $APP.R(null,"y2","y2",-718691301),Lx=new $APP.R(null,
"y1","y1",589123466),yx=new $APP.R(null,"div.sidebar","div.sidebar",1454675964),$v=new $APP.R("nyancad.mosaic.editor","cursor","nyancad.mosaic.editor/cursor",61601755),rw=new $APP.R("nyancad.mosaic.editor","delta","nyancad.mosaic.editor/delta",-1578540228),ey=new $APP.R(null,"line.wire","line.wire",58251721),fy=new $APP.R("nyancad.mosaic.editor","ui","nyancad.mosaic.editor/ui",-586117532),Bx=new $APP.R(null,"on-context-menu","on-context-menu",-1330744340),Dx=new $APP.R(null,"view-box","view-box",
-1792199155),ru=new $APP.R("nyancad.mosaic.editor","undo","nyancad.mosaic.editor/undo",1787806883),gy=new $APP.R("nyancad.mosaic.editor","prev-tool","nyancad.mosaic.editor/prev-tool",1457058552),Gw=new $APP.R(null,"select","select",1147833503),Vv=new $APP.R("nyancad.mosaic.editor","wire","nyancad.mosaic.editor/wire",-496129451),Bw=new $APP.R(null,"_attachments","_attachments",-1723171260),tx=new $APP.R(null,"div#mosaic_app","div#mosaic_app",-171697550),Gx=new $APP.R(null,"defs","defs",1398449717),
fw=new $APP.R("nyancad.mosaic.editor","box","nyancad.mosaic.editor/box",72685753),mx=new $APP.R(null,"g.toolstaging","g.toolstaging",1423440533),Ku=new $APP.R(null,"text.identifier","text.identifier",968733366),gv=new $APP.R("nyancad.mosaic.editor","conn","nyancad.mosaic.editor/conn",1132704290),Rv=new $APP.R("nyancad.mosaic.editor","mouse","nyancad.mosaic.editor/mouse",1202743035),Px=new $APP.R(null,"fill","fill",883462889),Au=new $APP.R(null,"rect.tetris","rect.tetris",319962617),pw=new $APP.Lc(null,
"circuit-sym","circuit-sym",1687815857,null),vu=new $APP.R(null,"circle.port","circle.port",2124426562),qx=new $APP.R(null,"rect.select","rect.select",-274352052),Iw=new $APP.R(null,"tooltip","tooltip",-1809677058),Aw=new $APP.R(null,"schematic","schematic",884071610),Dv=new $APP.R("nyancad.mosaic.editor","selected","nyancad.mosaic.editor/selected",1532065651),hy=new $APP.R(null,"circle.outline","circle.outline",1162019949),Uv=new $APP.R("nyancad.mosaic.editor","staging","nyancad.mosaic.editor/staging",
160758696),Yw=new $APP.R("nyancad.mosaic.editor","theme","nyancad.mosaic.editor/theme",-1698705327),av=new $APP.R(null,"rect.outline","rect.outline",35870808),iy=new $APP.R(null,"inductance","inductance",-14909622),jy=new $APP.R(null,"i","i",-1386841315),ky=new $APP.R(null,"g","g",1738089905),ly=new $APP.R(null,"e","e",1381269198),my=new $APP.R(null,"c","c",-1763192079),ny=new $APP.R(null,"d","d",1972142424),Fw=new $APP.R(null,"a","a",-2123407586),oy=new $APP.R(null,"b","b",1482224470),py=new $APP.R(null,
"z","z",-789527183),qy=new $APP.R(null,"w","w",354169001),ry=new $APP.R(null,"v","v",21465059),sy=new $APP.R(null,"s","s",1705939918),ty=new $APP.R(null,"p","p",151049309),uy=new $APP.R(null,"m","m",1632677161),Vw=new $APP.R(null,"span.sep","span.sep",-303070340),ow=new $APP.Lc("nyancad.mosaic.editor","circuit-sym","nyancad.mosaic.editor/circuit-sym",-1670824032,null),Cu=new $APP.R(null,"height","height",1025178622),vx=new $APP.R(null,"div.menu.chrome","div.menu.chrome",2039856843),Sw=new $APP.R(null,
"div.primary","div.primary",1467266760),ax=new $APP.R(null,"dangerouslySetInnerHTML","dangerouslySetInnerHTML",-554971138),vy=new $APP.R(null,"transform-origin","transform-origin",-586167370),hx=new $APP.R(null,"on-mouse-up","on-mouse-up",-1340533320),jw=new $APP.Lc(null,"nyancad.mosaic.editor","nyancad.mosaic.editor",1155727264,null),Hv=new $APP.R("nyancad.mosaic.editor","mouse-start","nyancad.mosaic.editor/mouse-start",-1507097836),Yu=new $APP.R(null,"image","image",-58725096),Gu=new $APP.R(null,
"points","points",-1486596883),Ox=new $APP.R(null,"rect","rect",-108902628),wy=new $APP.R(null,"capacitance","capacitance",-273749869),Ov=new $APP.R("nyancad.mosaic.editor","eraser","nyancad.mosaic.editor/eraser",-1170358934),Fu=new $APP.R(null,"polyline","polyline",-1731551044),xx=new $APP.R(null,"div.devicetray.chrome","div.devicetray.chrome",903230993),Wu=new $APP.R(null,"props","props",453281727),xy=new $APP.R(null,"g.wire","g.wire",1233150072),Tw=new $APP.R("nyancad.mosaic.editor","pan","nyancad.mosaic.editor/pan",
1148994537),$u=new $APP.R(null,"on-mouse-down","on-mouse-down",1147755470),bx=new $APP.R(null,"__html","__html",674048345),dx=new $APP.R(null,"variant","variant",-424354234),yy=new $APP.R(null,"ac","ac",-1891632475),zy=new $APP.R(null,"line.wirebb","line.wirebb",-1079360418),Ay=new $APP.R(null,"g.device","g.device",-538642655),Hx=new $APP.R(null,"pattern","pattern",242135423),kw=new $APP.Lc(null,"circuit-shape","circuit-shape",22565817,null),nx=new $APP.R("nyancad.mosaic.editor","stagingbg","nyancad.mosaic.editor/stagingbg",
1418997463),lw=new $APP.Lc("nyancad.mosaic.editor","circuit-conn","nyancad.mosaic.editor/circuit-conn",2141897096,null),Uw=new $APP.R("nyancad.mosaic.editor","probe","nyancad.mosaic.editor/probe",33168059),Iu=new $APP.R(null,"polygon.arrow","polygon.arrow",-453339260),xu=new $APP.R(null,"cy","cy",755331060),wu=new $APP.R(null,"cx","cx",1272694324),Kw=new $APP.R(null,"spice","spice",1062386404),Lv=new $APP.R("nyancad.mosaic.editor","dragging","nyancad.mosaic.editor/dragging",-1899225452),By=new $APP.R(null,
"dc","dc",1726058308),Cy=new $APP.R(null,"resistance","resistance",-1289779601),Dy=new $APP.R(null,"backspace","backspace",-696007848),ox=new $APP.R("nyancad.mosaic.editor","stagingsym","nyancad.mosaic.editor/stagingsym",1725041827),zx=new $APP.R(null,"svg#mosaic_canvas","svg#mosaic_canvas",-1312346936),Ww=new $APP.R(null,"div.secondary","div.secondary",-2037301824),tv=new $APP.R("nyancad.mosaic.editor","zoom","nyancad.mosaic.editor/zoom",-1377973775),Ey=new $APP.R(null,"unit","unit",375175175),wx=
new $APP.R(null,"div.content","div.content",-298042649),Ax=new $APP.R(null,"on-wheel","on-wheel",-1971630708),Ex=new $APP.R(null,"on-mouse-move","on-mouse-move",-1386320874),Ix=new $APP.R(null,"pattern-units","pattern-units",-1273751842);var Fy=new URLSearchParams(window.location.search),pu,Gy=Fy.get("schem");pu=$APP.p(Gy)?Gy:"myschem";var Tu,Hy=Fy.get("db");Tu=$APP.p(Hy)?Hy:"schematics";var Qw=$APP.p(window.dburl)?(new URL(Tu,window.dburl)).href:Tu,Uu,Iy=Fy.get("sync");Uu=$APP.p(Iy)?Iy:null;var Ux=new $APP.rs(Qw),Lt=$APP.qm(Ux,pu,$APP.el($APP.Re));Jt(Lt.cache,function(a){var b=$APP.en($APP.Cp,a);return b?b:console.log($APP.$h($APP.K([a])),Xt($APP.Cp,a))});var Qu=$APP.qm(Ux,"models",$APP.el($APP.Re)),zw=$APP.qm(Ux,"snapshots",$APP.el($APP.Re));
$APP.om(Ux,$APP.K([Lt,Qu,zw]));var Mw,Jy=new $APP.rs("local");Mw=$APP.qm(Jy,"local",$APP.ef($APP.Re));var sv=$APP.el(new $APP.n(null,6,[tv,new $APP.T(null,4,5,$APP.V,[0,0,500,500],null),Yw,"tetris",Zv,$v,Dv,$APP.uh,Rv,new $APP.T(null,2,5,$APP.V,[0,0],null),Hv,new $APP.T(null,2,5,$APP.V,[0,0],null)],null));
$APP.cn(tv,$APP.aj($APP.nq,$APP.mq,$APP.In,4),$APP.Rn($APP.vq,$APP.Ja,new $APP.n(null,5,[$APP.Bn,null,$APP.Dn,function(a){return $APP.yd(a)&&$APP.G.h(4,$APP.Be(4,a))},$APP.In,4,$APP.Ln,!0,$APP.Fn,$APP.aj($APP.nq,$APP.mq,$APP.In,4)],null),null));$APP.cn(Yw,new $APP.th(null,new $APP.n(null,2,["eyesore","null","tetris","null"],null),null),new $APP.th(null,new $APP.n(null,2,["eyesore",null,"tetris",null],null),null));
$APP.cn(Zv,new $APP.th(null,new $APP.n(null,6,[dw,"null",Tw,"null",Ov,"null",Vv,"null",Uw,"null",$v,"null"],null),null),new $APP.th(null,new $APP.n(null,6,[dw,null,Tw,null,Ov,null,Vv,null,Uw,null,$v,null],null),null));
$APP.cn(Dv,$APP.aj($APP.zq,$APP.oq,$APP.aj($APP.nq,$APP.Tp)),$APP.Cs(new $APP.T(null,2,5,$APP.V,[$APP.oq,$APP.aj($APP.nq,$APP.Tp)],null),new $APP.T(null,2,5,$APP.V,[$APP.zd,$APP.Rn($APP.Ap,$APP.Na,new $APP.n(null,4,[$APP.Bn,null,$APP.Dn,function(a){return $APP.yd(a)},$APP.Ln,!0,$APP.Fn,$APP.aj($APP.nq,$APP.Tp)],null),null)],null),null));
$APP.cn(Lv,$APP.aj($APP.is,new $APP.th(null,new $APP.n(null,4,[dw,"null",Sv,"null",Vv,"null",fw,"null"],null),null)),Yx(new $APP.th(null,new $APP.n(null,4,[dw,"null",Sv,"null",Vv,"null",fw,"null"],null),null),new $APP.th(null,new $APP.n(null,4,[dw,null,Sv,null,Vv,null,fw,null],null),null),null));$APP.cn(Uv,$APP.aj($APP.is,$APP.Eq),Yx($APP.Eq,$APP.Eq,null));
$APP.cn(fy,$APP.aj($APP.gr,$APP.xr,new $APP.T(null,4,5,$APP.V,[tv,Yw,Zv,Dv],null),$APP.es,new $APP.T(null,2,5,$APP.V,[Lv,Uv],null)),$APP.Bs($APP.Ug([$APP.yq,$APP.Up,$APP.Xq,$APP.jr,$APP.er,$APP.Vr,$APP.Br,$APP.xr,$APP.Zr,$APP.ir,$APP.Vq,$APP.es],[null,null,null,new $APP.T(null,5,5,$APP.V,[function(a){return $APP.Bd(a)},function(a){return $APP.Nd(a,tv)},function(a){return $APP.Nd(a,Yw)},function(a){return $APP.Nd(a,Zv)},function(a){return $APP.Nd(a,Dv)}],null),function(a){return $APP.Bd(a)&&$APP.Nd(a,
tv)&&$APP.Nd(a,Yw)&&$APP.Nd(a,Zv)&&$APP.Nd(a,Dv)},new $APP.T(null,2,5,$APP.V,[Lv,Uv],null),new $APP.T(null,4,5,$APP.V,[tv,Yw,Zv,Dv],null),new $APP.T(null,4,5,$APP.V,[tv,Yw,Zv,Dv],null),new $APP.T(null,4,5,$APP.V,[tv,Yw,Zv,Dv],null),new $APP.T(null,2,5,$APP.V,[Lv,Uv],null),new $APP.T(null,5,5,$APP.V,[$APP.aj($APP.Hp,new $APP.T(null,1,5,$APP.V,[$APP.Lm],null),$APP.aj($APP.tq,$APP.Lm)),$APP.aj($APP.Hp,new $APP.T(null,1,5,$APP.V,[$APP.Lm],null),$APP.aj($APP.tr,$APP.Lm,tv)),$APP.aj($APP.Hp,new $APP.T(null,
1,5,$APP.V,[$APP.Lm],null),$APP.aj($APP.tr,$APP.Lm,Yw)),$APP.aj($APP.Hp,new $APP.T(null,1,5,$APP.V,[$APP.Lm],null),$APP.aj($APP.tr,$APP.Lm,Zv)),$APP.aj($APP.Hp,new $APP.T(null,1,5,$APP.V,[$APP.Lm],null),$APP.aj($APP.tr,$APP.Lm,Dv))],null),new $APP.T(null,2,5,$APP.V,[Lv,Uv],null)])));Jt(sv,function(a){var b=$APP.en(fy,a);return b?b:console.log($APP.$h($APP.K([a])),Xt(fy,a))});
var Fx=$APP.fl(sv,new $APP.T(null,1,5,$APP.V,[tv],null)),ux=$APP.fl(sv,new $APP.T(null,1,5,$APP.V,[Yw],null)),Nv=$APP.fl(sv,new $APP.T(null,1,5,$APP.V,[Zv],null)),Bv=$APP.fl(sv,new $APP.T(null,1,5,$APP.V,[Dv],null)),Iv=$APP.fl(sv,new $APP.T(null,1,5,$APP.V,[rw],null)),zv=$APP.fl(sv,new $APP.T(null,1,5,$APP.V,[Uv],null)),gu=$APP.ef($APP.vd(new $APP.T(null,2,5,$APP.V,[new $APP.ie(null,null,null,1,null),null],null),new $APP.n(null,3,[$APP.Fr,$APP.Gd,$APP.Rr,$APP.ce,$APP.$p,function(a,b){return $APP.vd(b,
$APP.wd(a))}],null)));Mt(ru,function(a,b,c,d){return hu(d)});var zu=function zu(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=3<c.length?new $APP.B(c.slice(3),0,null):null;return zu.l(arguments[0],arguments[1],arguments[2],c)};
zu.l=function(a,b,c,d){return $APP.pi.h(new $APP.T(null,2,5,$APP.V,[Ay,new $APP.n(null,4,[$u,function(e){return ew.h?ew.h(b,e):ew.call(null,b,e)},Ex,function(e){return Qv.h?Qv.h(b,e):Qv.call(null,b,e)},$APP.fq,new $APP.n(null,2,[$APP.$q,eu($APP.$q.h(c,$APP.Os)).translate(50*$APP.or.g(c),50*$APP.nr.g(c)).toString(),vy,[$APP.x.g(50*($APP.or.g(c)+a/2)),"px ",$APP.x.g(50*($APP.nr.g(c)+a/2)),"px"].join("")],null),$APP.Xk,new $APP.T(null,3,5,$APP.V,[$APP.cs.g(c),dx.g(c),$APP.Nd($APP.y(Bv),b)?dy:null],null)],
null)],null),d)};zu.C=3;zu.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};
var fv=$APP.Ug("pmos capacitor wire pnp inductor diode isource port vsource resistor npn nmos".split(" "),[new $APP.n(null,4,[hv,$APP.gt,gv,$APP.ht,nw,Ou,Jw,new $APP.n(null,4,[uy,new $APP.n(null,1,[Iw,"multiplier"],null),Zx,new $APP.n(null,1,[Iw,"number of fingers"],null),qy,new $APP.n(null,2,[Iw,"width",Ey,"meter"],null),$APP.kr,new $APP.n(null,2,[Iw,"lenght",Ey,"meter"],null)],null)],null),new $APP.n(null,4,[hv,$APP.jt,gv,$APP.kt,nw,function(a,b){return new $APP.T(null,6,5,$APP.V,[zu,3,a,b,new $APP.T(null,
3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,4,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.4],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.1,1.4],null),new $APP.T(null,2,5,$APP.V,[1.9,1.4],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.1,1.6],null),new $APP.T(null,2,5,$APP.V,[1.9,1.6],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,
[1.5,1.6],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null)],null)},Jw,new $APP.n(null,1,[wy,new $APP.n(null,2,[Iw,"Capacitance",Ey,"Farad"],null)],null)],null),new $APP.n(null,4,[hv,$APP.Nf,gv,$APP.Nf,nw,function(a,b){(function(){var g=$APP.fj.g(b);return $APP.p(g)?g:a})();var c=$APP.or.g(b),d=$APP.nr.g(b),e=$APP.Ip.g(b),f=$APP.Jp.g(b);return new $APP.T(null,4,5,$APP.V,[xy,new $APP.n(null,3,[$u,function(g){return ew.h?ew.h(a,g):ew.call(null,a,g)},Ex,function(g){return Qv.h?Qv.h(a,
g):Qv.call(null,a,g)},$APP.Xk,$APP.Nd($APP.y(Bv),a)?dy:null],null),new $APP.T(null,2,5,$APP.V,[zy,new $APP.n(null,4,[Kx,50*(c+.5),Lx,50*(d+.5),Mx,50*(c+e+.5),Nx,50*(d+f+.5)],null)],null),new $APP.T(null,2,5,$APP.V,[ey,new $APP.n(null,4,[Kx,50*(c+.5),Lx,50*(d+.5),Mx,50*(c+e+.5),Nx,50*(d+f+.5)],null)],null)],null)},Jw,$APP.Re],null),new $APP.n(null,4,[hv,$APP.gt,gv,$APP.it,nw,Pu,Jw,new $APP.n(null,4,[uy,new $APP.n(null,1,[Iw,"multiplier"],null),Zx,new $APP.n(null,1,[Iw,"number of fingers"],null),qy,
new $APP.n(null,2,[Iw,"width",Ey,"meter"],null),$APP.kr,new $APP.n(null,2,[Iw,"lenght",Ey,"meter"],null)],null)],null),new $APP.n(null,4,[hv,$APP.jt,gv,$APP.kt,nw,function(a,b){return new $APP.T(null,7,5,$APP.V,[zu,3,a,b,new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,
1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.T(null,2,5,$APP.V,[$APP.Um,new $APP.n(null,1,[ny,"M75,55\n                 a5,5 90 0,0 0,10\n                 a5,5 90 0,0 0,10\n                 a5,5 90 0,0 0,10\n                 a5,5 90 0,0 0,10\n                 "],null)],null)],null)},Jw,new $APP.n(null,1,[iy,new $APP.n(null,2,[Iw,"Inductance",Ey,"Henry"],null)],null)],null),new $APP.n(null,4,[hv,$APP.jt,gv,$APP.kt,nw,function(a,b){return new $APP.T(null,7,5,$APP.V,
[zu,3,a,b,new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,3,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.4],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.3,1.6],null),new $APP.T(null,2,5,$APP.V,[1.7,1.6],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,1.6],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.T(null,
5,5,$APP.V,[Ju,1.5,1.6,.2,270],null)],null)},Jw,$APP.Re],null),new $APP.n(null,4,[hv,$APP.jt,gv,$APP.kt,nw,function(a,b){return new $APP.T(null,8,5,$APP.V,[zu,3,a,b,new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,3,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,1.25],null),new $APP.T(null,2,5,$APP.V,[1.5,1.65],null)],
null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.T(null,2,5,$APP.V,[hy,new $APP.n(null,3,[wu,75,xu,75,$APP.qr,20],null)],null),new $APP.T(null,5,5,$APP.V,[Ju,1.5,1.8,.15,-90],null)],null)},Jw,new $APP.n(null,2,[By,new $APP.n(null,2,[Iw,"DC current",Ey,"Ampere"],null),yy,new $APP.n(null,2,[Iw,"AC current",Ey,"Ampere"],null)],null)],null),new $APP.n(null,4,[hv,$APP.Nf,gv,new $APP.T(null,1,5,$APP.V,[new $APP.T(null,
3,5,$APP.V,[0,0,"P"],null)],null),nw,function(a,b){return new $APP.T(null,6,5,$APP.V,[zu,1,a,b,function(){switch(dx.g(b)){case "ground":return new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[.5,.5],null),new $APP.T(null,2,5,$APP.V,[.3,.5],null)],null),new $APP.T(null,4,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[0,.5],null),new $APP.T(null,2,5,$APP.V,[.3,.2],null),new $APP.T(null,2,5,$APP.V,[.3,.8],null),new $APP.T(null,2,5,$APP.V,[0,.5],
null)],null)],null)],null);case "supply":return new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[.5,.5],null),new $APP.T(null,2,5,$APP.V,[0,.5],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[0,.2],null),new $APP.T(null,2,5,$APP.V,[0,.8],null)],null)],null)],null);default:return new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,1,5,$APP.V,[new $APP.T(null,6,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[.5,.5],null),new $APP.T(null,
2,5,$APP.V,[.3,.3],null),new $APP.T(null,2,5,$APP.V,[0,.3],null),new $APP.T(null,2,5,$APP.V,[0,.7],null),new $APP.T(null,2,5,$APP.V,[.3,.7],null),new $APP.T(null,2,5,$APP.V,[.5,.5],null)],null)],null)],null)}}(),new $APP.T(null,3,5,$APP.V,[$APP.Nq,new $APP.n(null,3,[Lu,function(){switch(Math.round($APP.D($APP.$q.g(b)))){case 1:return"end";case -1:return"start";default:return"middle"}}(),Mu,"middle",$APP.$q,eu($APP.$q.g(b)).translate(50/3,-25).inverse().toString()],null),$APP.fj.g(b)],null)],null)},
Jw,$APP.Re],null),new $APP.n(null,4,[hv,$APP.jt,gv,$APP.kt,nw,function(a,b){return new $APP.T(null,9,5,$APP.V,[zu,3,a,b,new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.T(null,2,5,$APP.V,
[hy,new $APP.n(null,3,[wu,75,xu,75,$APP.qr,20],null)],null),new $APP.T(null,3,5,$APP.V,[$APP.Nq,new $APP.n(null,3,[$APP.or,75,$APP.nr,70,Lu,"middle"],null),"+"],null),new $APP.T(null,3,5,$APP.V,[$APP.Nq,new $APP.n(null,3,[$APP.or,75,$APP.nr,90,Lu,"middle"],null),"−"],null)],null)},Jw,new $APP.n(null,2,[By,new $APP.n(null,2,[Iw,"DC voltage",Ey,"Volt"],null),yy,new $APP.n(null,2,[Iw,"AC voltage",Ey,"Volt"],null)],null)],null),new $APP.n(null,4,[hv,$APP.jt,gv,$APP.kt,nw,function(a,b){return new $APP.T(null,
7,5,$APP.V,[zu,3,a,b,new $APP.T(null,3,5,$APP.V,[Nu,b,3],null),new $APP.T(null,2,5,$APP.V,[av,new $APP.n(null,4,[$APP.or,67.5,$APP.nr,1.1*50,Bu,15,Cu,40],null)],null),new $APP.T(null,2,5,$APP.V,[Hu,new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,.5],null),new $APP.T(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.T(null,2,5,$APP.V,[new $APP.T(null,2,5,$APP.V,[1.5,1.9],null),new $APP.T(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null)],null)},Jw,new $APP.n(null,
1,[Cy,new $APP.n(null,2,[Iw,"Resistance",Ey,"Ohm"],null)],null)],null),new $APP.n(null,4,[hv,$APP.gt,gv,$APP.it,nw,Pu,Jw,new $APP.n(null,4,[uy,new $APP.n(null,1,[Iw,"multiplier"],null),Zx,new $APP.n(null,1,[Iw,"number of fingers"],null),qy,new $APP.n(null,2,[Iw,"width",Ey,"meter"],null),$APP.kr,new $APP.n(null,2,[Iw,"lenght",Ey,"meter"],null)],null)],null),new $APP.n(null,4,[hv,$APP.gt,gv,$APP.ht,nw,Ou,Jw,new $APP.n(null,4,[uy,new $APP.n(null,1,[Iw,"multiplier"],null),Zx,new $APP.n(null,1,[Iw,"number of fingers"],
null),qy,new $APP.n(null,2,[Iw,"width",Ey,"meter"],null),$APP.kr,new $APP.n(null,2,[Iw,"lenght",Ey,"meter"],null)],null)],null)]),nv=function(a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;b=1<b.length?new $APP.B(b.slice(1),0,null):null;return new Yt(arguments[0],b)}(function(){return lv()});
Mt(by,function Ky(){Nt(by);Nt(ru);var b=$APP.cm(1);$APP.Hl(function(){var c=function(){function e(f){var g=f[1];if(7===g){g=f[7];var h=f[8],l=f[9],m=f[10],q=f[2];f[7]=g;f[8]=h+1;f[11]=q;f[9]=l;f[10]=m;f[2]=null;f[1]=2;return $APP.$l}return 1===g?(g=$APP.y(nv),g=mv(g),g=$APP.C(g),f[7]=g,f[8]=0,f[9]=0,f[10]=null,f[2]=null,f[1]=2,$APP.$l):4===g?(h=f[8],m=f[10],h=$APP.rd(m,h),g=$APP.M(h,0,null),h=$APP.M(h,1,null),g=qv(g,h),$APP.am(f,7,g)):13===g?(f[2]=f[2],f[1]=10,$APP.$l):6===g?(f[2]=f[2],f[1]=3,$APP.$l):
3===g?(g=f[2],h=Mt(ru,function(){return function(r,t,v,u){return hu(u)}}()),l=Mt(by,Ky),f[12]=g,f[13]=h,$APP.bm(f,l)):12===g?(h=f[14],h=$APP.D(h),g=$APP.M(h,0,null),h=$APP.M(h,1,null),g=qv(g,h),$APP.am(f,14,g)):2===g?(h=f[8],l=f[9],f[1]=$APP.p(h<l)?4:5,$APP.$l):11===g?(h=f[14],g=$APP.sc(h),h=$APP.tc(h),l=$APP.F(g),f[7]=h,f[8]=0,f[9]=l,f[10]=g,f[2]=null,f[1]=2,$APP.$l):9===g?(f[2]=null,f[1]=10,$APP.$l):5===g?(g=f[7],h=f[14],g=$APP.C(g),f[14]=g,f[1]=g?8:9,$APP.$l):14===g?(h=f[14],l=f[2],g=$APP.E(h),
f[7]=g,f[8]=0,f[9]=0,f[15]=l,f[10]=null,f[2]=null,f[1]=2,$APP.$l):10===g?(f[2]=f[2],f[1]=6,$APP.$l):8===g?(h=f[14],f[1]=$APP.Ed(h)?11:12,$APP.$l):null}return function(){function f(l){for(;;){a:try{for(;;){var m=e(l);if(!$APP.pe(m,$APP.$l)){var q=m;break a}}}catch(r){q=r;l[2]=q;if($APP.C(l[4]))l[1]=$APP.D(l[4]);else throw q;q=$APP.$l}if(!$APP.pe(q,$APP.$l))return q}}function g(){var l=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];l[0]=h;l[1]=1;return l}var h=null;
h=function(l){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,l)}throw Error("Invalid arity: "+arguments.length);};h.m=g;h.g=f;return h}()}(),d=function(){var e=c();e[6]=b;return e}();return $APP.Zl(d)});return b});
var Fv=$APP.ef(new $APP.T(null,2,5,$APP.V,[0,0],null)),Pv=$APP.ef($APP.uh),bw=new BroadcastChannel("probe"),gx=function gx(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=0<c.length?new $APP.B(c.slice(0),0,null):null;return gx.l(c)};
gx.l=function(){var a=$APP.el(0),b=$APP.el(null);return function(){function c(e){var f=null;if(0<arguments.length){f=0;for(var g=Array(arguments.length-0);f<g.length;)g[f]=arguments[f+0],++f;f=new $APP.B(g,0,null)}return d.call(this,f)}function d(e){var f=$APP.bf(function(g,h){return new $APP.T(null,3,5,$APP.V,[$APP.iq,new $APP.n(null,2,[$APP.ij,g,hx,function(){return $APP.hf(a,g)}],null),h],null)},e);return new $APP.T(null,4,5,$APP.V,[$APP.zr,new $APP.n(null,2,[$u,function(g){var h=g.currentTarget;
return $APP.hf(b,setTimeout(function(){return h.open=!0},300))},hx,function(g){clearTimeout($APP.y(b));return g.currentTarget.open=!1}],null),new $APP.T(null,3,5,$APP.V,[$APP.Gq,new $APP.n(null,1,[$APP.Kp,function(g){return g.preventDefault()}],null),$APP.jd(e,$APP.y(a))],null),new $APP.T(null,3,5,$APP.V,[ay,$APP.Qn.h($APP.y(a),f),$APP.kf($APP.y(a)+1,f)],null)],null)}c.C=0;c.D=function(e){e=$APP.C(e);return d(e)};c.l=d;return c}()};gx.C=0;gx.D=function(a){return this.l($APP.C(a))};
var Rx=$APP.Ug([new $APP.th(null,new $APP.n(null,1,[my,null],null),null),new $APP.th(null,new $APP.n(null,1,[$APP.kr,null],null),null),new $APP.th(null,new $APP.n(null,2,[py,null,$APP.Wr,null],null),null),new $APP.th(null,new $APP.n(null,2,[$APP.Op,null,ty,null],null),null),new $APP.th(null,new $APP.n(null,1,[ny,null],null),null),new $APP.th(null,new $APP.n(null,2,[$APP.Op,null,oy,null],null),null),new $APP.th(null,new $APP.n(null,1,[$x,null],null),null),new $APP.th(null,new $APP.n(null,1,[sy,null],
null),null),new $APP.th(null,new $APP.n(null,1,[$APP.qr,null],null),null),new $APP.th(null,new $APP.n(null,1,[ky,null],null),null),new $APP.th(null,new $APP.n(null,1,[oy,null],null),null),new $APP.th(null,new $APP.n(null,2,[$APP.Op,null,uy,null],null),null),new $APP.th(null,new $APP.n(null,1,[ly,null],null),null),new $APP.th(null,new $APP.n(null,2,[my,null,$APP.Wr,null],null),null),new $APP.th(null,new $APP.n(null,1,[cy,null],null),null),new $APP.th(null,new $APP.n(null,2,[$APP.Wr,null,$APP.or,null],
null),null),new $APP.th(null,new $APP.n(null,2,[$APP.Op,null,sy,null],null),null),new $APP.th(null,new $APP.n(null,1,[$APP.or,null],null),null),new $APP.th(null,new $APP.n(null,1,[uy,null],null),null),new $APP.th(null,new $APP.n(null,1,[ry,null],null),null),new $APP.th(null,new $APP.n(null,1,[jy,null],null),null),new $APP.th(null,new $APP.n(null,2,[ry,null,$APP.Wr,null],null),null),new $APP.th(null,new $APP.n(null,1,[Dy,null],null),null),new $APP.th(null,new $APP.n(null,3,[$APP.Op,null,py,null,$APP.Wr,
null],null),null),new $APP.th(null,new $APP.n(null,1,[qy,null],null),null),new $APP.th(null,new $APP.n(null,1,[$APP.mr,null],null),null),new $APP.th(null,new $APP.n(null,1,[ty,null],null),null),$APP.vh([$APP.Th.g(" ")]),new $APP.th(null,new $APP.n(null,2,[$APP.Op,null,$APP.mr,null],null),null)],[function(){return xw("capacitor",Rv.g($APP.y(sv)))},function(){return xw("inductor",Rv.g($APP.y(sv)))},tu,function(){return fx(Rv.g($APP.y(sv)))},function(){return xw("diode",Rv.g($APP.y(sv)))},function(){return xw("pnp",
Rv.g($APP.y(sv)))},Ev,function(){return Cv(function(a){return a.rotate(90)})},function(){return xw("resistor",Rv.g($APP.y(sv)))},function(){return ex(Rv.g($APP.y(sv)))},function(){return xw("npn",Rv.g($APP.y(sv)))},function(){return xw("pmos",Rv.g($APP.y(sv)))},function(){return $APP.Z.l(sv,$APP.Y,Zv,Ov,$APP.K([Uv,null]))},Nw,aw,Ow,function(){return Cv(function(a){return a.rotate(-90)})},function(){return xw("ckt",Rv.g($APP.y(sv)))},function(){return xw("nmos",Rv.g($APP.y(sv)))},function(){return xw("vsource",
Rv.g($APP.y(sv)))},function(){return xw("isource",Rv.g($APP.y(sv)))},Pw,Ev,uu,function(){return $APP.Z.u(sv,$APP.Y,Zv,Vv)},function(){return Cv(function(a){return a.flipX()})},function(){return xw("port",Rv.g($APP.y(sv)))},function(){return $APP.Z.h(sv,function(a){return $APP.Y.i(a,Zv,gy.g(a))})},function(){return Cv(function(a){return a.flipY()})}]),Sx=$APP.ng([$APP.vh([$APP.Th.g(" ")]),function(){return $APP.Z.h(sv,function(a){return $APP.Y.l(a,Zv,Tw,$APP.K([gy,Zv.g(a)]))})}]);
$APP.ja("nyancad.mosaic.editor.render",Tx);$APP.ja("nyancad.mosaic.editor.init",Vx);$APP.ja("nyancad.mosaic.editor.clear",function(){return $APP.Z.i(Lt,function(a,b){return $APP.Ke.i($APP.Bj,a,b)},$APP.yh($APP.mh($APP.y(Lt))))});try{Vx()}catch(a){throw console.error("An error occurred when calling (nyancad.mosaic.editor/init)"),a;};
}).call(this);