text: System.register(["./__root_module__-896eff71.js","./index-344072cc.js","./index-e10873ad.js"],function($a){var Vb,jc,Wc,wc,Ud,Kd,he,xd,gd,Ld,Pd,af,bf,Ve,Ad,xe,qc,td,be,Bd,pe,Se,nc,$c,ge,ad,ie,Yb,zb,Rc,Mc,tc,Tc,fb,uc,Rb,Fc,Uc,vd,Xd,vc,Oc,pc,bb,Ma;return{setters:[function(oa){Vb=oa.C;jc=oa.i;Wc=oa.b;wc=oa.R;Ud=oa.p;Kd=oa.m;he=oa.bq;xd=oa.br;gd=oa.d;Ld=oa.c;Pd=oa.at;af=oa.bz;bf=oa.bA;Ve=oa._;Ad=oa.o;xe=oa.n;qc=oa.g;td=oa.bB;be=oa.bC;Bd=oa.a2;pe=oa.P;Se=oa.a;nc=oa.bD;$c=oa.a1;ge=oa.M;ad=oa.ae;ie=
  oa.T;Yb=oa.ad;zb=oa.ah;Rc=oa.S;Mc=oa.I;tc=oa.h;Tc=oa.bE;fb=oa.v;uc=oa.bF;Rb=oa.aE;Fc=oa.bs;Uc=oa.aD;vd=oa.bG;Xd=oa.f},function(oa){vc=oa.M;Oc=oa.I;pc=oa.v;bb=oa.p},function(oa){Ma=oa.localInterface}],execute:function(){function oa(hb,yb){if(!0===yb)return yb;if(hb.copyState)return hb.copyState(yb);hb={};for(var lb in yb){var qa=yb[lb];qa instanceof Array&&(qa=qa.concat([]));hb[lb]=qa}return hb}function La(hb,yb,lb){return hb.startState?hb.startState(yb,lb):!0}function Ua(hb,yb){return Gd.modes[hb]=
  yb}function Sb(hb){if("string"===typeof hb&&Gd.mimeModes.hasOwnProperty(hb))hb=Gd.mimeModes[hb];else if(hb&&"string"===typeof hb.name&&Gd.mimeModes.hasOwnProperty(hb.name)){var yb=Gd.mimeModes[hb.name];"string"===typeof yb&&(yb={name:yb});hb=Object.assign({},yb,hb);hb.name=yb.name}else{if("string"===typeof hb&&/^[\w\-]+\/[\w\-]+\+xml$/.test(hb))return Sb("application/xml");if("string"===typeof hb&&/^[\w\-]+\/[\w\-]+\+json$/.test(hb))return Sb("application/json")}return"string"===typeof hb?{name:hb}:
  hb||{name:"null"}}function Ca(hb,yb){yb=Gd.resolveMode(yb);"string"===typeof yb&&(yb={name:yb});if(!yb.name)throw Error("parserConfig does not have a name of the mode to get");var lb=Gd.modes[yb.name];if(!lb)return Ca(hb,"text/plain");hb=Object.assign({indentUnit:2},hb);return Object.assign(lb(hb,yb),{name:yb.name})}function Va(hb,yb){for(var lb;hb.innerMode;){lb=hb.innerMode(yb);if(!lb||lb.mode==hb)break;yb=lb.state;hb=lb.mode}return lb||{mode:hb,state:yb}}function dc(hb,yb){Gd.mimeModes[hb]=yb}
  function sb(hb,yb,lb){}function od(hb,yb,lb,qa,ba,cb,za){var Wa=hb.editorPlugin._tokenizerValidBefore;Wa&&Wa.row>=lb&&(Wa.row=lb-1);var gb=Gd.linesToTokenize(hb.document,lb,qa,Wa);Wa=gb.lines;gb=gb.state;if(!Wa.length)return!1;gb=gb?Gd.copyState(yb,gb):Gd.startState(yb);for(var ac=0;ac<Wa.length;ac++){var fc=Wa[ac],xc=fc.row;xc>=lb&&xc<=qa&&Gd.indentLine(hb,yb,fc,gb,ba,cb,za);gb=Gd.tokenizeLine(yb,Wa[ac],gb,function(){})}return!0}function bc(hb,yb,lb,qa,ba,cb,za){yb=Gd.linesToTokenize(yb,lb,qa,ba);
  lb=yb.lines;Gd.tokenizeLines(hb,lb,yb.state,cb,za);return lb}function Td(hb,yb,lb,qa,ba){var cb=[],za,Wa=function(fc){return cb.push(za=[])},gb=function(fc,xc,ed,kd,Qd,Ge,cf){return za.push(ed,kd,fc,Qd.current(),xc.localMode||cf)};try{var ac=Gd.visitDocumentTokens(hb,yb,lb,qa,ba,Wa,gb)}catch(fc){cb.length=0,ac=Gd.visitDocumentTokens(hb,yb,lb,qa,null,Wa,gb)}return{tokens:cb,lines:ac}}function rd(hb,yb,lb,qa,ba){null==yb&&(yb=hb.search(/[^\s\u00a0]/),-1==yb&&(yb=hb.length));qa=qa||0;for(ba=ba||0;;){var cb=
  hb.indexOf("\t",qa);if(0>cb||cb>=yb)return ba+(yb-qa);ba+=cb-qa;ba+=lb-ba%lb;qa=cb+1}}function dd(hb){hb=hb.toLowerCase();for(var yb=0;yb<Gd.modeInfo.length;yb++){var lb=Gd.modeInfo[yb];if(lb.mime==hb)return lb;if(lb.mimes)for(var qa=0;qa<lb.mimes.length;qa++)if(lb.mimes[qa]==hb)return lb}if(/\+xml$/.test(hb))return dd("application/xml");if(/\+json$/.test(hb))return dd("application/json")}function Ub(hb){for(var yb=0;yb<Gd.modeInfo.length;yb++){var lb=Gd.modeInfo[yb];if(lb.ext)for(var qa=0;qa<lb.ext.length;qa++)if(lb.ext[qa]==
  hb)return lb}}function Ne(hb){for(var yb=0;yb<Gd.modeInfo.length;yb++){var lb=Gd.modeInfo[yb];if(lb.file&&lb.file.test(hb))return lb}yb=hb.lastIndexOf(".");if(hb=-1<yb&&hb.substring(yb+1,hb.length))return Gd.findModeByExtension(hb)}function gc(hb){hb=hb.toLowerCase();for(var yb=0;yb<Gd.modeInfo.length;yb++){var lb=Gd.modeInfo[yb];if(lb.name.toLowerCase()==hb)return lb;if(lb.alias)for(var qa=0;qa<lb.alias.length;qa++)if(lb.alias[qa].toLowerCase()==hb)return lb}}function Tb(hb){if(!hb)return String(hb);
  if(Array.isArray(hb))return"["+hb.map(Tb).join(",")+"]";if("symbol"===typeof hb)return we.printSymbol(hb);try{return String(hb)}catch(yb){return"Cannot print object: "+yb}}function Ya(hb,yb){return!we.arr.every(yb.map(function(lb){return hb[lb]}),function(lb){return we.obj.equals(lb,hb&&hb.valueOf())})}function ha(hb){if(we.obj.isPrimitive(hb))var yb=we.string.print(hb);else Array.isArray(hb)?((yb=3<hb.length)&&(hb=hb.slice(0,3)),hb=we.string.print(hb),yb&&(hb=hb.slice(0,-1)+", ...]"),yb=hb):yb=we.string.print(hb);
  yb=yb.replace(/\n/g,"");500<yb.length&&(yb=yb.slice(0,20)+("...["+(yb.length-20)+' CHARS]"'));return yb}function Pa(hb){return ld.Inspector.openInWindow({targetObject:hb})}function nb(hb,yb){return ld.Inspector.openInWindow({remoteTarget:{code:hb,evalEnvironment:yb}})}function cc(hb,yb){function lb(Wa){var gb=Wa.name,ac=Wa.ownerChain(),fc=Wa.owner,xc=Wa.world(),ed;Wa===cb&&(ed=[za]);xc===Wa&&(ed=["$world"]);if(!ed&&gb&&fc){fc===xc&&1===ld.arr.count(ld.arr.pluck(xc.submorphs,"name"),gb)&&(ed=['$world.get("'+
  gb+'")']);if(!ed&&fc!=xc)for(xc=ac.length-1;xc--;)if(1===ac[xc].getAllNamed(gb).length){ed=[].concat($jscomp.arrayFromIterable(lb(ac[xc])),['get("'+gb+'")']);break}ed||(gb=[].concat($jscomp.arrayFromIterable(lb(fc)),['get("'+gb+'")']),ld.syncEval(gb.join("."),{context:cb}).value===Wa&&(ed=gb))}ed||(ed=[za+'.getMorphById("'+Wa.id+'")']);return ed}yb=void 0===yb?{}:yb;var qa=hb.world(),ba=yb;yb=void 0===ba.maxLength?10:ba.maxLength;var cb=void 0===ba.fromMorph?qa:ba.fromMorph;if(cb===hb)return"this";
  var za=qa===cb?"$world":"this";if(!(qa||hb.name&&cb.get(hb.name)===hb))return"morph";qa=lb(hb);return qa.length>yb?'$world.getMorphWithId("'+hb.id+'")':qa.join(".")}function Lc(hb,yb,lb){var qa=(yb=void 0===yb?"":yb)&&wd.arr.last(yb.split(".")).toLowerCase(),ba="",cb=0,za=Math.pow(2,19);if("string"===typeof hb){if(hb.length>za)return null}else if(hb.document.stringSize>za)return null;if("string"===typeof hb)ba=hb.slice(0,1E3);else for(hb=$jscomp.makeIterator(hb.document.lines),za=hb.next();!za.done;za=
  hb.next()){var Wa=za.value;za=Wa.stringSize;Wa=Wa.text;var gb=!0;1E3<cb+za&&(gb=!1,za=1E3-cb);ba+=Wa.slice(0,za)+(gb?"\n":"");cb+=za;if(1E3<=cb)break}cb=$jscomp.makeIterator(wd.modeInfo);for(hb=cb.next();!hb.done;hb=cb.next()){gb=hb.value;za=gb.contentTest;hb=gb.mode;Wa=gb.ext;gb=gb.file;if("function"===typeof za)try{if(za(ba))return hb}catch(ac){}if(gb&&gb instanceof RegExp&&gb.test(yb))return hb;if(Wa)for(za=$jscomp.makeIterator(Wa),Wa=za.next();!Wa.done;Wa=za.next())if(Wa.value===qa)return hb}return lb}
  $a({a:dc,d:Ua,r:sb});var pd=lively.FreezerRuntime.recorderFor("lively.ide/themes/default.js");pd.Color=Vb;var ce=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/themes/default.js"),lb=yb.hasOwnProperty("DefaultTheme")&&"function"===typeof yb.DefaultTheme?yb.DefaultTheme:yb.DefaultTheme=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"background",get:function(){return pd.Color.white}},
  {key:"default",get:function(){return{fontColor:"#333"}}},{key:"header",get:function(){return{fontSize:"110%",fontColor:"#6b94ee"}}},{key:"header-1",get:function(){return{fontSize:"135%",fontColor:"#6b94ee"}}},{key:"header-2",get:function(){return{fontSize:"125%",fontColor:"#6b94be"}}},{key:"header-3",get:function(){return{fontSize:"120%",fontColor:"#6b94be"}}},{key:"quote",get:function(){return{fontColor:"#090"}}},{key:"negative",get:function(){return{fontColor:"#d44"}}},{key:"positive",get:function(){return{fontColor:"#292"}}},
  {key:"strong",get:function(){return{fontWeight:"bold"}}},{key:"em",get:function(){return{fontStyle:"italic"}}},{key:"link",get:function(){return{textDecoration:"underline"}}},{key:"strikethrough",get:function(){return{textDecoration:"line-through"}}},{key:"hr",get:function(){return{fontColor:"#999"}}},{key:"link",get:function(){return{textDecoration:"underline",fontColor:"#2c2cff"}}},{key:"url",get:function(){return{textDecoration:"underline",fontColor:"#2c2cff"}}},{key:"keyword",get:function(){return{fontColor:"#708"}}},
  {key:"atom",get:function(){return{fontColor:"#219"}}},{key:"number",get:function(){return{fontColor:"#174"}}},{key:"def",get:function(){return{fontColor:"#22c"}}},{key:"variable",get:function(){return{fontColor:"#05a"}}},{key:"punctuation",get:function(){return{fontColor:"#05a"}}},{key:"property",get:function(){return{fontColor:"#222"}}},{key:"operator",get:function(){return{fontColor:"#05a"}}},{key:"variable-2",get:function(){return{fontColor:"#05a"}}},{key:"variable-3",get:function(){return{fontColor:"#085"}}},
  {key:"comment",get:function(){return{fontColor:"#666"}}},{key:"string",get:function(){return{fontColor:"#181"}}},{key:"string-2",get:function(){return{fontColor:"#0B2"}}},{key:"meta",get:function(){return{fontColor:"#555"}}},{key:"qualifier",get:function(){return{fontColor:"#555"}}},{key:"builtin",get:function(){return{fontColor:"#30a"}}},{key:"bracket",get:function(){return{fontColor:"#997"}}},{key:"tag",get:function(){return{fontColor:"#170"}}},{key:"attribute",get:function(){return{fontColor:"#333"}}},
  {key:"error",get:function(){return{backgroundColor:"#ff4c4c"}}},{key:"invalidchar",get:function(){return{backgroundColor:"#ff4c4c"}}},{key:"diff-file-header",get:function(){return{fontColor:pd.Color.white,fontWeight:"bold",backgroundColor:pd.Color.rgba(136,136,136,.7)}}},{key:"diff-hunk-header",get:function(){return{backgroundColor:pd.Color.rgba(204,204,204,.4),fontWeight:"bold"}}},{key:"coord",get:function(){return{backgroundColor:pd.Color.rgba(204,204,204,.4),fontWeight:"bold"}}},{key:"inserted",
  get:function(){return{backgroundColor:"rgba(108,255,108, .3)"}}},{key:"deleted",get:function(){return{backgroundColor:"rgba(255,108,108, .3)"}}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"DefaultTheme"}},{key:"instance",get:function(){return this._instance||(this._instance=new this)}}],yb,{pathInPackage:function(){return"themes/default.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:42,end:2826})}(void 0),Ie=ce=pd.DefaultTheme;pd.default=ce;var Gd=lively.FreezerRuntime.recorderFor("lively.ide/editor-modes.js");Gd.copyState=oa;Gd.startState=La;Gd.defineMode=Ua;Gd.resolveMode=Sb;Gd.getMode=Ca;Gd.innerMode=Va;Gd.defineMIME=dc;Gd.registerHelper=sb;Gd.indentLines=od;Gd.indentLine=function(hb,yb,lb,qa,ba,cb,za){za=Object.assign({indentWithTabs:!hb.useSoftTabs,indentUnit:hb.tabWidth,tabSize:4,ignoreFollowingText:!1},
  za);null==ba&&(ba="add");"smart"==ba&&(yb.indent||(ba="prev"));var Wa=za.tabSize,gb=lb.text,ac=Gd.countColumn(gb,null,Wa);lb.modeState&&(lb.modeState=null);var fc=gb.match(/^\s*/)[0];if(!cb&&!/\S/.test(gb)){var xc=0;ba="not"}else if("smart"==ba&&(xc=yb.indent(qa,za.ignoreFollowingText?"":gb.slice(fc.length),gb),xc==Gd.passIndent||150<xc)){if(!cb)return;ba="prev"}"prev"==ba?xc=0<lb.row?Gd.countColumn(lb.prevLine().text,null,Wa):0:"add"==ba?xc=ac+za.indentUnit:"subtract"==ba?xc=ac-za.indentUnit:"number"===
  typeof ba&&(xc=ac+ba);xc=Math.max(0,xc);yb="";qa=0;if(za.indentWithTabs)for(za=Math.floor(xc/Wa);za;--za)qa+=Wa,yb+="\t";qa<xc&&(yb+=" ".repeat(xc-qa));if(yb!=fc)return hb.replace({start:{row:lb.row,column:0},end:{row:lb.row,column:fc.length}},yb),!0};Gd.tokenizeLines=function(hb,yb,lb,qa,ba){if(yb.length){lb=lb?Gd.copyState(hb,lb):Gd.startState(hb);for(var cb=0;cb<yb.length;cb++){var za=yb[cb];qa(za);lb=Gd.tokenizeLine(hb,za,lb,ba)}}};Gd.tokenizeLine=function(hb,yb,lb,qa){var ba=yb.text;if(!ba)return lb;
  var cb=new Gd.StringStream(ba,2);lb=yb.modeState="function"===typeof hb.copyState?hb.copyState(lb):Gd.copyState(hb,lb);yb.prevLine();for(lb._string=ba;!cb.eol();)ba=hb.token(cb,lb),qa(ba,lb,cb.start,cb.pos,cb,yb,hb),cb.start=cb.pos;return lb};Gd.printTokens=function(hb){for(var yb="",lb=0;lb<hb.length;lb+=5)yb+=hb[lb+0]+" => "+hb[lb+1]+" "+hb[lb+2]+" "+hb[lb+3]+" "+hb[lb+4].name+"\n";return yb};Gd.visitDocumentTokens=bc;Gd.tokenizeDocument=Td;Gd.linesToTokenize=function(hb,yb,lb,qa){if(qa&&qa.row>=
  lb)return{lines:[],state:null};yb=qa?Math.max(0,qa.row-1):yb;var ba=hb.getLine(yb),cb=ba.text;hb=[ba];qa=null;for(var za=0,Wa;(Wa=ba.prevLine())&&50>za++;){ba=Wa;if(ba.modeState){qa=ba.modeState;break}hb.unshift(ba)}if(!qa){for(var gb=ba,ac=Infinity;(Wa=ba.prevLine())&&100>za++;){ba=Wa;if(ba.modeState){qa=ba.modeState;break}hb.unshift(ba);Wa=cb.match(/^\s*/)[0].length;if(0===Wa)break;Wa<ac&&(ac=Wa,gb=ba)}!qa&&0<ac&&(hb=hb.slice(hb.indexOf(gb)))}if(lb>yb)for(ba=Gd.arr.last(hb);yb<=lb;yb++){ba=ba.nextLine();
  if(!ba)break;hb.push(ba)}return{lines:hb,state:qa}};Gd.countColumn=rd;Gd.findModeByMIME=dd;Gd.findModeByExtension=Ub;Gd.findModeByFileName=Ne;Gd.findModeByName=gc;Gd.arr=Wc;ce=Gd.modes||{};Gd.modes=ce;Gd.modes=ce;Gd.modes=ce;ce=$a("p",{});Gd.passIndent=ce;Gd.passIndent=ce;Gd.passIndent=ce;Gd.copyState=oa;Gd.copyState=oa;Gd.startState=La;Gd.startState=La;Gd.defineMode=Ua;Gd.defineMode=Ua;Gd.resolveMode=Sb;Gd.resolveMode=Sb;Gd.getMode=Ca;Gd.getMode=Ca;Gd.innerMode=Va;Gd.innerMode=Va;ce={};Gd.mimeModes=
  ce;Gd.mimeModes=ce;Gd.mimeModes=ce;Gd.defineMIME=dc;Gd.defineMIME=dc;Gd.registerHelper=sb;Gd.registerHelper=sb;Gd.indentLines=od;Gd.indentLines=od;Gd.visitDocumentTokens=bc;Gd.visitDocumentTokens=bc;Gd.tokenizeDocument=Td;Gd.tokenizeDocument=Td;Gd.countColumn=rd;Gd.countColumn=rd;(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/editor-modes.js"),lb=yb.hasOwnProperty("StringStream")&&"function"===typeof yb.StringStream?yb.StringStream:yb.StringStream=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||
  this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(qa,ba){this.reset(qa,ba)}},{key:"reset",value:function(qa,ba){this.pos=this.start=0;this.string=void 0===qa?"":qa;this.tabSize=void 0===ba?2:ba;this.lineStart=this.lastColumnPos=this.lastColumnValue=0}},{key:"eol",value:function(){return this.pos>=this.string.length}},{key:"sol",value:function(){return this.pos==this.lineStart}},{key:"peek",value:function(){return this.string.charAt(this.pos)||
  void 0}},{key:"next",value:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}},{key:"eat",value:function(qa){var ba=this.string.charAt(this.pos);if("string"===typeof qa?ba==qa:ba&&(qa.test?qa.test(ba):qa(ba)))return++this.pos,ba}},{key:"eatWhile",value:function(qa){for(var ba=this.pos;this.eat(qa););return this.pos>ba}},{key:"eatSpace",value:function(){for(var qa=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>qa}},{key:"skipToEnd",
  value:function(){this.pos=this.string.length}},{key:"skipTo",value:function(qa){qa=this.string.indexOf(qa,this.pos);if(-1<qa)return this.pos=qa,!0}},{key:"backUp",value:function(qa){this.pos-=qa}},{key:"column",value:function(){this.lastColumnPos<this.start&&(this.lastColumnValue=Gd.countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue-(this.lineStart?Gd.countColumn(this.string,this.lineStart,this.tabSize):
  0)}},{key:"indentation",value:function(){return Gd.countColumn(this.string,null,this.tabSize)-(this.lineStart?Gd.countColumn(this.string,this.lineStart,this.tabSize):0)}},{key:"match",value:function(qa,ba,cb){if("string"===typeof qa){var za=function(gb){return cb?gb.toLowerCase():gb},Wa=this.string.substr(this.pos,qa.length);if(za(Wa)==za(qa))return!1!==ba&&(this.pos+=qa.length),!0}else{if((qa=this.string.slice(this.pos).match(qa))&&0<qa.index)return null;qa&&!1!==ba&&(this.pos+=qa[0].length);return qa}}},
  {key:"current",value:function(){return this.string.slice(this.start,this.pos)}},{key:"hideFirstChars",value:function(qa,ba){this.lineStart+=qa;try{return ba()}finally{this.lineStart-=qa}}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"StringStream"}}],yb,{pathInPackage:function(){return"editor-modes.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",
  version:"0.1.0"}}},{start:10526,end:13053})})(void 0);ce=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",
  ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:"cpp c++ cc cxx hpp h++ hh hxx".split(" "),alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",
  mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",
  mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"],contentTest:function(hb){return hb.match(/^diff --.* a\//m)}},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",
  mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",
  mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",
  ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",
  ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},
  {name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"json",
  ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",
  mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",
  ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},
  {name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:"php php3 php4 php5 php7 phtml".split(" ")},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:"txt text conf def list log".split(" ")},
  {name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",
  ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",
  mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD|\.bash(rc|_profile)|\.profile$/,contentTest:function(hb){return hb.match(/#!\//m)}},{name:"Sieve",mime:"application/sieve",
  mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",
  mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",
  mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:"123456789".split("")},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn",
  "ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",
  mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",
  ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];Gd.modeInfo=ce;Gd.modeInfo=ce;Gd.modeInfo=ce;for(var Af=0;Af<Gd.modeInfo.length;Af++)Gd.info=
  Gd.modeInfo[Af],Gd.info.mimes&&(Gd.info.mime=Gd.info.mimes[0]);Gd.defineMode("null",function(){return{token:function(hb){return hb.skipToEnd()}}});Gd.defineMIME("text/plain","null");Gd.findModeByMIME=dd;Gd.findModeByMIME=dd;Gd.findModeByExtension=Ub;Gd.findModeByExtension=Ub;Gd.findModeByFileName=Ne;Gd.findModeByFileName=Ne;Gd.findModeByName=gc;Gd.findModeByName=gc;var Ce=lively.FreezerRuntime.recorderFor("lively.ide/text/completion.js");Ce.Color=Vb;Ce.Rectangle=wc;Ce.pt=Ud;Ce.morph=Kd;Ce.ShadowObject=
  he;Ce.StyleSheet=xd;Ce.connect=gd;Ce.arr=Wc;Ce.string=Ld;Ce.FilterableList=Pd;Ce.Range=af;Af=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/text/completion.js"),lb=yb.hasOwnProperty("Completer")&&"function"===typeof yb.Completer?yb.Completer:yb.Completer=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"compute",value:function(){return[]}}],[{key:Symbol.for("__LivelyClassName__"),
  get:function(){return"Completer"}}],yb,{pathInPackage:function(){return"text/completion.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:347,end:394})}(void 0);Ce.Completer=Af;Ce.Completer=Af;Ce.Completer=Af;Af=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/text/completion.js"),lb=yb.hasOwnProperty("WordCompleter")&&
  "function"===typeof yb.WordCompleter?yb.WordCompleter:yb.WordCompleter=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"compute",value:function(qa,ba){var cb=[],za=[],Wa=qa.document.lineStrings;qa=qa.cursorPosition.row;for(var gb=qa-1;0<=gb;gb--)for(var ac=$jscomp.makeIterator(Wa[gb].split(/[^0-9a-z@_]+/i)),fc=ac.next();!fc.done;fc=ac.next())(fc=fc.value)&&!cb.includes(fc)&&fc!==ba&&(cb.push(fc),
  za.push({priority:1E3-(qa-gb),completion:fc}));for(gb=qa+1;gb<Wa.length;gb++)for(ac=$jscomp.makeIterator(Wa[gb].split(/[^0-9a-z_@]+/i)),fc=ac.next();!fc.done;fc=ac.next())(fc=fc.value)&&!cb.includes(fc)&&fc!==ba&&(cb.push(fc),za.push({priority:1E3-(gb-qa),completion:fc}));return za}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"WordCompleter"}}],yb,{pathInPackage:function(){return"text/completion.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:403,end:1274})}(void 0);Ce.WordCompleter=Af;Ce.WordCompleter=Af;Ce.WordCompleter=Af;Af=[new Ce.WordCompleter];Ce.defaultCompleters=Af;Ce.defaultCompleters=Af;Ce.defaultCompleters=Af;Af=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/text/completion.js"),lb=yb.hasOwnProperty("CompletionController")&&"function"===typeof yb.CompletionController?yb.CompletionController:yb.CompletionController=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||
  this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(qa,ba){ba=void 0===ba?[]:ba;this.textMorph=qa;this.completers=ba=qa.pluginCollect("getCompleters",ba)}},{key:"computeCompletions",value:function(qa){var ba=this,cb,za,Wa,gb,ac,fc,xc,ed,kd,Qd,Ge,cf,ne,qf,pf,ff;return $jscomp.asyncExecutePromiseGeneratorProgram(function(vf){switch(vf.nextAddress){case 1:cb=[],za=$jscomp.makeIterator(ba.completers),Wa=za.next();
  case 2:if(Wa.done){vf.jumpTo(4);break}gb=Wa.value;vf.setCatchFinallyBlocks(5);ac=cb;fc=ac.concat;return vf.yield(gb.compute(ba.textMorph,qa),7);case 7:cb=fc.call(ac,vf.yieldResult);vf.leaveTryBlock(3);break;case 5:xc=vf.enterCatchBlock(),console.warn("Error in completer "+gb+": "+(xc.stack||xc));case 3:Wa=za.next();vf.jumpTo(2);break;case 4:ed=new Map;cb.forEach(function(xg){var dh=ed.get(xg.completion);dh||(dh=[],ed.set(xg.completion,dh));dh.push(xg)});kd=[];Qd=$jscomp.makeIterator(ed.values());
  for(Ge=Qd.next();!Ge.done;Ge=Qd.next())cf=Ge.value,kd.push(Ce.arr.last(Ce.arr.sortByKey(cf,"priority")));ne=0;qf=Ce.arr.sortByKey(kd,"priority").reverse();pf=qf.length&&qf[0].priority||0;ff=qf.map(function(xg){xg.highestPriority=pf;var dh=xg.completion.replace(/\n/g,""),nh=String((xg.info||"").replace(/\n/g,""));ne=Math.max(ne,dh.length+nh.length);return{isListItem:!0,string:dh,annotation:nh,value:xg}});return vf.return({items:ff,maxCol:ne})}})}},{key:"computeSortedCompletions",value:function(qa,
  ba){ba=void 0===ba?!1:ba;var cb=this,za,Wa,gb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ac){if(1==ac.nextAddress)return za={tokens:[qa],lowercasedTokens:[qa],input:qa},ac.yield(cb.computeCompletions(qa),2);Wa=ac.yieldResult;gb=Ce.arr.sortBy(Wa.items.filter(function(fc){return cb.filterFunction(za,fc,ba)}),function(fc){return cb.sortFunction(za,fc)});return ac.return(gb)})}},{key:"_printCompletions",value:function(qa){var ba=this,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){if(1==
  za.nextAddress)return za.yield(ba.computeSortedCompletions(qa),2);cb=za.yieldResult.map(function(Wa){return{completion:Wa.value.completion,priority:Wa.value.priority,maxP:Wa.value.highestPriority,sortVal:Wa._cache[qa].sortVal,lev:JSON.stringify(Wa._cache[qa].levenshtein)}});return za.return(Ce.string.printTable(lively.lang.grid.tableFromObjects(cb)))})}},{key:"prefix",value:function(){var qa=this.textMorph,ba=qa.selection;return(ba.isEmpty()?qa.getLine(ba.lead.row).slice(0,ba.lead.column):ba.text).match(/[a-z0-9@_]*$/i)[0]}},
  {key:"filterFunction",value:function(qa,ba,cb){cb=void 0===cb?!1:cb;ba._cache||(ba._cache={});var za=qa.tokens,Wa=qa.lowercasedTokens,gb=qa.input;gb=ba._cache[gb]||(ba._cache[gb]={});if(gb.hasOwnProperty("filtered"))return gb.filtered;ba=ba.value.completion.replace(/\([^\)]*\)$/,"");var ac=ba.toLowerCase();if(cb&&za[0]&&!ba.startsWith(za[0]))return gb.filtered=!1;if(Wa.every(function(xc){return ac.includes(xc)}))return!0;var fc=gb.levenshtein||(gb.levenshtein={});qa=cb||3>=Ce.arr.sum(qa.lowercasedTokens.map(function(xc){return fc[xc]||
  (fc[xc]=Ce.string.levenshtein(ac,xc))}));return gb.filtered=qa}},{key:"sortFunction",value:function(qa,ba){ba._cache||(ba._cache={});var cb=ba._cache[qa.input]||(ba._cache[qa.input]={});if(cb.hasOwnProperty("sortVal"))return cb.sortVal;cb=ba._cache[qa.input]={};var za=ba.value;ba=za.highestPriority;var Wa=za.completion;za=za.priority;Wa=Wa.replace(/\([^\)]*\)$/,"").toLowerCase();var gb=0;qa.lowercasedTokens.forEach(function(fc){Wa.startsWith(fc)?gb+=12:3<=fc.length&&Wa.includes(fc)&&(gb+=5)});ba=
  -((za||(gb?ba:0))/Math.pow(10,String(ba).length-2))-gb;var ac=cb.levenshtein||(cb.levenshtein={});qa=Ce.arr.sum(qa.lowercasedTokens.map(function(fc){return ac[fc]||(ac[fc]=Ce.string.levenshtein(Wa,fc))}));gb&&(qa/=2);return cb.sortVal=qa+ba}},{key:"positionForMenu",value:function(){var qa=this.textMorph,ba=qa.charBoundsFromTextPosition(qa.cursorPosition);return qa.getGlobalTransform().transformRectToRect(ba).topLeft().addXY(-qa.scroll.x,-qa.scroll.y).addPt(Ce.pt(qa.borderWidth+4,qa.borderWidth+4))}},
  {key:"completionListSpec",value:function(){var qa=this,ba,cb,za,Wa,gb,ac,fc,xc,ed,kd,Qd,Ge,cf,ne,qf,pf,ff,vf,xg,dh;return $jscomp.asyncExecutePromiseGeneratorProgram(function(nh){if(1==nh.nextAddress)return cb=ba=qa.textMorph,za=cb.fontSize,Wa=cb.fontFamily,gb=qa.positionForMenu(),ac=qa.prefix(),nh.yield(qa.computeCompletions(ac),2);fc=nh.yieldResult;xc=fc.items;ed=fc.maxCol;kd=ba.env.fontMetric.sizeFor(Wa,za,"M");Qd=kd.width*ed;Ge=ba.document.getLine(0).height;cf=Math.max(120,Qd<ba.width?Qd:ba.width);
  ne=Ge*xc.length+Ge+10;qf=Math.max(70,Math.min(700,ne));pf=gb.extent(Ce.pt(cf,qf));if(ff=ba.world())vf=ff.visibleBounds().insetBy(5),pf.bottom()>vf.bottom()&&(xg=pf.bottom()-vf.bottom(),xg>pf.height-50&&(xg=pf.height-50),pf.height-=xg),pf.right()>vf.right()&&(dh=pf.right()-vf.right(),pf.width=120>pf.width-dh?120:pf.width-dh),vf.containsRect(pf)||(pf=pf.withTopLeft(vf.translateForInclusion(pf).topLeft())),pf=pf.translatedBy(vf.insetBy(0).topLeft().negated());return nh.return({master:{auto:"styleguide://SystemWidgets/autocomplete list"},
  hasFixedPosition:!0,epiMorph:!0,fontSize:za,position:pf.topLeft(),extent:pf.extent(),items:xc,input:ac,name:"text completion menu",historyId:"lively.morphic-text completion",filterFunction:qa.filterFunction,sortFunction:qa.sortFunction})})}},{key:"removeMenuOnBlur",value:function(qa){var ba=qa.menu;setTimeout(function(){ba.withAllSubmorphsDetect(function(cb){return cb.isFocused()})?ba.inputMorph.focus():ba.remove()})}},{key:"openCompletionList",value:function(){var qa=this,ba,cb,za,Wa,gb,ac,fc,xc,
  ed,kd;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Qd){if(1==Qd.nextAddress)return ba=qa.textMorph.selection.start,Qd.yield(qa.completionListSpec(),2);if(3!=Qd.nextAddress)return cb=Qd.yieldResult,qa.textMorph.pluginFind(function(Ge){return Ge.theme}),za=new Ce.FilterableList(cb),Wa=new Ce.Range({start:ba,end:qa.textMorph.selection.start}),gb=qa.textMorph.textInRange(Wa),ac=za.inputMorph,fc=za.listMorph,xc=cb.input,ed=za.addMorph({name:"prefix mask",fill:Ce.Color.transparent,bounds:ac.textBounds()},
  ac),fc.master=null,Wa.isEmpty()||(qa.textMorph.deleteText(Wa),ac.input=gb,ac.gotoDocumentEnd()),ac.fontColor=qa.textMorph.fontColor,Ce.connect(ac,"textString",ed,"setBounds",{converter:"() => input.textBounds()",varMapping:{input:ac}}),Ce.connect(za,"accepted",qa,"insertCompletion",{updater:"function($upd) {\n        let textToInsert, customInsertionFn = null, completion = this.sourceObj.selection;\n        if (completion) {\n          if (completion.prefix) prefix = completion.prefix;\n          textToInsert = completion.completion;\n          customInsertionFn = completion.customInsertionFn;\n        } else {\n          textToInsert = this.sourceObj.inputMorph.textString;\n        }\n        $upd(textToInsert, prefix, customInsertionFn);\n      }",
  varMapping:{prefix:xc}}),Ce.connect(za,"accepted",za,"remove"),Ce.connect(za,"canceled",za,"remove"),Ce.connect(za,"remove",qa.textMorph,"focus"),Ce.connect(za.inputMorph,"onBlur",qa,"removeMenuOnBlur",{converter:"evt => ({menu, evt})",varMapping:{menu:za}}),kd=qa.textMorph.world(),fc.addStyleClass("hiddenScrollbar"),za.paddingMorph.height=2,ac.height=fc.itemHeight,ac.clipMode="visible",ac.fill=qa.textMorph.fill,ac.fixedHeight=!0,ac.fixedWidth=!1,ac.fontSize=fc.fontSize,za.relayout(),za.selectedIndex=
  0,za.master.applyIfNeeded(!0),ac.focus(),Qd.yield(za.master.whenApplied(),3);xc.length&&(ac.gotoDocumentEnd(),za.moveBy(Ce.pt(-ac.textBounds().width,0)));kd.addMorph(za);za.inputPadding=Ce.Rectangle.inset(0,0,0,0);return Qd.return(za)})}},{key:"autoInsertBestMatchingCompletion",value:function(qa,ba,cb){ba=void 0===ba?!0:ba;var za=this,Wa,gb,ac,fc;return $jscomp.asyncExecutePromiseGeneratorProgram(function(xc){if(1==xc.nextAddress)return Wa=$jscomp,gb=Wa.makeIterator,xc.yield(za.computeSortedCompletions(qa,
  ba),2);ac=gb.call(Wa,xc.yieldResult);(fc=ac.next().value)&&za.insertCompletion(fc.value.completion,qa,cb);xc.jumpToEnd()})}},{key:"insertCompletion",value:function(qa,ba,cb){var za=this.textMorph,Wa=za.document,gb=za.selection.isMultiSelection?za.selection.selections:[za.selection];za.undoManager.group();gb.forEach(function(ac){ac.collapseToEnd();var fc=ac.lead,xc=ba?Wa.indexToPosition(Wa.positionToIndex(fc)-ba.length):fc;"function"===typeof cb?cb(qa,ba,za,{start:xc,end:fc},ac):za.replace({start:xc,
  end:fc},qa)});za.undoManager.group()}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"CompletionController"}}],yb,{pathInPackage:function(){return"text/completion.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:1402,end:13044})}(void 0);Ce.CompletionController=Af;Ce.CompletionController=Af;Ce.CompletionController=Af;
  Af=[{name:"text completion",handlesCount:!0,multiSelectAction:"single",exec:function(hb,yb,lb){var qa;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ba){return 1==ba.nextAddress?(qa=new Ce.CompletionController(hb,Ce.defaultCompleters),ba.yield(qa.openCompletionList(),2)):ba.return(!0)})}},{name:"text completion first match",handlesCount:!0,multiSelectAction:"single",exec:function(hb,yb,lb){var qa;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ba){return 1==ba.nextAddress?
  (qa=new Ce.CompletionController(hb,Ce.defaultCompleters),ba.yield(qa.autoInsertBestMatchingCompletion(qa.prefix()),2)):ba.return(!0)})}}];Ce.completionCommands=Af;Ce.completionCommands=Af;Ce.completionCommands=Af;var zf=lively.FreezerRuntime.recorderFor("lively.ide/text/multi-select-commands.js");zf.chain=bf;zf.arr=Wc;zf.obj=Ve;zf.string=Ld;var C=[{name:"[multi select] add cursor above",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.start;0<yb.row&&(yb=hb.getPositionAboveOrBelow(1,
  yb,!0,0,hb.charBoundsFromTextPosition(yb).x),hb.selection.addRange({start:yb,end:yb}));return!0}},{name:"[multi select] add cursor below",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.start;yb.row<hb.documentEndPosition.row&&(yb=hb.getPositionAboveOrBelow(-1,yb,!0,0,hb.charBoundsFromTextPosition(yb).x),hb.selection.addRange({start:yb,end:yb}));return!0}},{name:"[multi select] all like this",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.selections[hb.selection.selections.length-
  1];if(yb.isEmpty())return!0;hb.searchForAll(yb.text,{start:{column:0,row:0}}).forEach(function(lb){return hb.selection.addRange(lb.range,!1)});hb.selection.mergeSelections();zf.arr.remove(hb.selection.selections,yb);hb.selection.selections.push(yb);return!0}},{name:"[multi select] more like this forward",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.selections.length-1,lb=hb.selection.selections[yb];if(lb.isEmpty())return!0;var qa=hb.search(lb.text,{start:lb.end,backwards:!1});
  qa&&(lb=hb.selection.selections.findIndex(function(ba){return ba.range.equals(qa.range)}),-1<lb?zf.arr.swap(hb.selection.selections,lb,yb):hb.selection.addRange(qa.range));return!0}},{name:"[multi select] more like this backward",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.selections.length-1,lb=hb.selection.selections[yb];if(lb.isEmpty())return!0;var qa=lb.start,ba=hb.search(lb.text,{start:{row:qa.row,column:qa.column-(lb.text.length-1)},backwards:!0});ba&&(lb=hb.selection.selections.findIndex(function(cb){return cb.range.equals(ba.range)}),
  -1<lb?zf.arr.swap(hb.selection.selections,lb,yb):hb.selection.addRange(ba.range));return!0}},{name:"[multi select] remove focused cursor",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.selections.length;1<yb&&hb.selection.removeSelections(yb-1);return!0}},{name:"[multi select] goto previous focused cursor",multiSelectAction:"single",exec:function(hb){hb.selection.selections=lively.lang.arr.rotate(hb.selection.selections,-1);return!0}},{name:"[multi select] goto next focused cursor",
  multiSelectAction:"single",exec:function(hb){hb.selection.selections=lively.lang.arr.rotate(hb.selection.selections,1);return!0}},{name:"[multi select] align cursors",multiSelectAction:"single",exec:function(hb){var yb=hb.selection.selections;if(1>=yb.length)return!0;var lb=zf.arr.groupBy(yb,function(ba){return ba.range.start.row});yb=lb.keys().map(function(ba){ba=lb[ba];var cb=zf.arr.max(ba,function(za){return za.range.start.column});zf.arr.without(ba,cb).forEach(function(za){return za.range=cb.range});
  return cb});var qa=zf.arr.max(yb,function(ba){return ba.range.start.column}).range.start.column;yb.forEach(function(ba){var cb=ba.range.start;ba=cb.row;cb=cb.column;hb.insertText(" ".repeat(qa-cb),{row:ba,column:cb})});return!0}},{name:"[multi select] create rectangular selection",multiSelectAction:"single",exec:function(hb){hb.selection.disableMultiSelect();if(hb.selection.isEmpty())var yb=hb.lastSavedMark&&hb.lastSavedMark.position||(void 0).lineRange().start,lb=hb.cursorPosition;else yb=hb.selection,
  lb=yb.lead,yb=yb.anchor;hb.selection.collapse();var qa=yb.column,ba=lb.column;zf.arr.range(yb.row,lb.row).forEach(function(cb){return hb.getLine(cb).length>Math.min(ba,qa)&&hb.selection.addRange({end:{row:cb,column:ba},start:{row:cb,column:qa}},!1)});hb.selection.mergeSelections();return!0}},{name:"[multi select] count",multiSelectAction:"single",handlesCount:!0,exec:function(hb,yb,lb){lb=void 0===lb?1:lb;hb.undoManager.group();hb.selection.selections.forEach(function(qa,ba){return qa.text=String(ba+
  lb)});hb.undoManager.group();return!0}}];zf.multiSelectCommands=C;zf.multiSelectCommands=C;zf.multiSelectCommands=C;var uf=lively.FreezerRuntime.recorderFor("lively.ide/text/code-navigation-commands.js");uf.pToI=function(hb,yb){return hb.positionToIndex(yb)};uf.iToP=function(hb,yb){return hb.indexToPosition(yb)};uf.execCodeNavigator=function(hb){return function(yb,lb,qa){var ba=yb.pluginInvokeFirst("getNavigator");if(!ba)return!0;yb.saveMark();qa=qa||1;for(var cb=0;cb<qa;cb++)ba[hb](yb,lb);return!0}};
  uf.once=Ad;var Cf=[{name:"forwardSexp",bindKey:"Ctrl-Alt-f|Ctrl-Alt-Right",exec:uf.execCodeNavigator("forwardSexp"),multiSelectAction:"forEach",readOnly:!0},{name:"backwardSexp",bindKey:"Ctrl-Alt-b|Ctrl-Alt-Left",exec:uf.execCodeNavigator("backwardSexp"),multiSelectAction:"forEach",readOnly:!0},{name:"backwardUpSexp",bindKey:"Ctrl-Alt-u|Ctrl-Alt-Up",exec:uf.execCodeNavigator("backwardUpSexp"),multiSelectAction:"forEach",readOnly:!0},{name:"forwardDownSexp",bindKey:"Ctrl-Alt-d|Ctrl-Alt-Down",exec:uf.execCodeNavigator("forwardDownSexp"),
  multiSelectAction:"forEach",readOnly:!0},{name:"markDefun",bindKey:"Ctrl-Alt-h",exec:uf.execCodeNavigator("markDefun"),multiSelectAction:"forEach",readOnly:!0},{name:"expandRegion",bindKey:{win:"Shift-Ctrl-E|Ctrl-Shift-Space",mac:"Shift-Command-Space|Ctrl-Shift-Space"},exec:function(hb,yb){function lb(){var cb=hb.$expandRegionState,za=uf.pToI(hb,hb.cursorPosition);if(cb&&(cb.range[0]===za||cb.range[1]===za))return cb;cb=hb.selection.range;return hb.$expandRegionState={range:[uf.pToI(hb,cb.start),
  uf.pToI(hb,cb.end)]}}yb=yb||{};var qa=hb.pluginInvokeFirst("getNavigator");if(!qa)return!0;var ba=yb.start;yb=yb.end;if("number"===typeof ba&&"number"===typeof yb)lb(),qa={range:[ba,yb],prev:lb()};else{ba=qa.ensureAST(hb);if(!ba)return;qa=qa.expandRegion(hb,hb.textString,ba,lb())}qa&&qa.range&&(hb.selection={start:uf.iToP(hb,qa.range[0]),end:uf.iToP(hb,qa.range[1])},hb.$expandRegionState=qa);uf.once(hb,"selectionChange",function(){return hb.$expandRegionState=null},"call");return!0},multiSelectAction:"forEach",
  readOnly:!0},{name:"contractRegion",bindKey:{win:"Shift-Ctrl-S|Ctrl-Alt-Space",mac:"Ctrl-Command-space|Ctrl-Alt-Space"},exec:function(hb){if(hb.selection.isEmpty())return!0;var yb=hb.pluginInvokeFirst("getNavigator");if(!yb)return!0;var lb=yb.ensureAST(hb);if(!lb)return!0;var qa=hb.$expandRegionState;if(!qa)return!0;(yb=yb.contractRegion(hb,hb.textString,lb,qa))&&yb.range&&(hb.selection={start:uf.iToP(hb,yb.range[0]),end:uf.iToP(hb,yb.range[1])},hb.$expandRegionState=yb);uf.once(hb,"selectionChange",
  function(){return hb.$expandRegionState=null},"call");return!0},multiSelectAction:"forEach",readOnly:!0}];uf.commands=Cf;uf.commands=Cf;uf.commands=Cf;var fh=lively.FreezerRuntime.recorderFor("lively.ide/text/generic-code-commands.js");fh.arr=Wc;fh.chain=bf;fh.string=Ld;var mg=[{name:"toggle comment",exec:function(hb){var yb=hb.pluginInvokeFirst("getComment");if(!yb)return!0;if(!yb.lineCommentStart)return yb.blockCommentStart?hb.execCommand("toggle block comment"):!0;var lb=yb.lineCommentStart,qa=
  new RegExp("^(\\s*)("+lb+"\\s?)(.*)");yb=hb.document;var ba=hb.selection;ba.isEmpty()||0!==ba.end.column||ba.growRight(-1);var cb=ba.start.row;yb=yb.lineStrings.slice(ba.start.row,ba.end.row+1);yb=yb.some(function(gb){return!!gb.trim()})?fh.arr.dropWhile(yb,function(gb){return gb.trim()?!1:++cb&&!0}):yb;var za=yb.every(function(gb){return gb.trim()&&gb.match(qa)});hb.undoManager.group();if(za)yb.forEach(function(gb,ac){if(gb=gb.match(qa)){gb=$jscomp.makeIterator(gb);gb.next();var fc=gb.next().value,
  xc=gb.next().value;gb.next();hb.deleteText({start:{row:cb+ac,column:fc.length},end:{row:cb+ac,column:fc.length+xc.length}})}});else{var Wa=yb.reduce(function(gb,ac,fc){return ac.trim()||ba.isEmpty()&&ba.start.row===ba.end.row?Math.min(gb,ac.match(/^\s*/)[0].length):gb},Infinity);Wa=Infinity===Wa?0:Wa;yb.forEach(function(gb,ac){gb=$jscomp.makeIterator(gb.match(/^(\s*)(.*)/));gb.next();gb.next();gb.next();hb.insertText(lb+" ",{row:cb+ac,column:Wa})})}hb.undoManager.group();return!0}},{name:"toggle block comment",
  exec:function(hb){var yb=hb.pluginInvokeFirst("getComment");if(!yb)return!0;if(!yb.blockCommentStart)return yb.lineCommentStart?hb.execCommand("toggle comment"):!0;if(!yb||!yb.blockCommentStart)return!0;var lb=yb.blockCommentStart;yb=yb.blockCommentEnd;var qa=new RegExp("^"+lb.replace(/\*/g,"\\*")),ba=new RegExp(yb.replace(/\*/g,"\\*")+"$"),cb=hb.tokenAt(hb.cursorPosition);if(cb&&"comment"===cb.token){var za=hb.textInRange(cb);if(za.match(qa)&&za.match(ba))return hb.undoManager.group(),hb.replace(cb,
  za.slice(lb.length,-yb.length)),hb.undoManager.group(),!0}hb.undoManager.group();hb.insertText(lb,hb.selection.start);hb.insertText(yb,hb.selection.end);hb.undoManager.group();lb=!hb.selection.isEmpty();hb.selection.growLeft(yb.length);lb||hb.selection.collapse();return!0}},{name:"comment box",exec:function(hb,yb,lb){yb=hb.undoManager.ensureNewGroup(hb,"comment box");if(hb.selection.isEmpty())return hb.insertText("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"),hb.execCommand("toggle comment"),
  hb.undoManager.group(yb),!0;var qa=hb.selection.range,ba=hb.withSelectedLinesDo(function(za){return za}),cb=fh.arr.min([qa.start.column].concat(fh.chain(ba).map(function(za){return za.match(/^\s*/)}).flatten().compact().pluck("length").value()));ba=fh.arr.max(ba.map(function(za){return za.length}))-cb;ba=Array(Math.ceil(ba/2)+1).join("-=")+"-";hb.execCommand("toggle comment");hb.collapseSelection();hb.cursorPosition={row:qa.start.row,column:0};lb?hb.insertText(fh.string.indent("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n",
  " ",cb)):hb.insertText(fh.string.indent(ba+"\n"," ",cb));hb.selection.goUp();hb.execCommand("toggle comment");hb.cursorPosition={row:qa.end.row+2,column:0};hb.insertText(fh.string.indent(ba+"\n"," ",cb));hb.selection.goUp();hb.execCommand("toggle comment");hb.selection.range={start:{row:qa.start.row,column:0},end:hb.cursorPosition};hb.undoManager.group(yb);return!0},multiSelectAction:"forEach",handlesCount:!0}];fh.commands=mg;fh.commands=mg;fh.commands=mg;var we=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js");
  we.printSymbol=function(hb){if(Symbol.keyFor(hb))return'Symbol.for("'+Symbol.keyFor(hb)+'")';if(we.knownSymbols.get(hb))return we.knownSymbols.get(hb);String(hb).match(we.symMatcher);return String(hb)};we.defaultSort=function(hb,yb){if(hb.hasOwnProperty("priority")||yb.hasOwnProperty("priority")){var lb=hb.priority||0,qa=yb.priority||0;if(lb<qa)return-1;if(lb>qa)return 1}hb=(hb.keyString||hb.key).toLowerCase();yb=(yb.keyString||yb.key).toLowerCase();return hb<yb?-1:hb===yb?0:1};we.safeToString=Tb;
  we.propertyNamesOf=function(hb,yb){if(!hb)return[];if(Array.isArray(hb)){var lb=yb?yb.offset:0;return we.arr.range(lb,lb+(yb?yb.partitionSize:hb.length-1))}return we.arr.sortBy(Object.keys(hb),function(qa){return qa.toLowerCase()})};we.isMultiValue=Ya;we.printValue=ha;we.partitionedChildren=function(hb,yb){var lb=void 0===yb?{}:yb;yb=void 0===lb.originalValue?hb:lb.originalValue;var qa=void 0===lb.offset?0:lb.offset;lb=void 0===lb.partitionSize?hb.length||Object.values(hb).length:lb.partitionSize;
  if(we.obj.isArray(hb)){hb=we.num.roundTo(Math.max(we.MIN_PARTITION_SIZE,lb/50),.1);lb/=hb;for(var ba=[],cb=0;cb<lb;cb++){var za="["+(qa+cb*hb)+"-"+(qa+(cb+1)*hb)+"]";ba.push({partition:{originalValue:yb,offset:qa+cb*hb,partitionSize:hb},value:[],key:za,keyString:za,valueString:"...",isCollapsed:!0})}return ba}hb=we.num.roundTo(Math.max(we.MIN_PARTITION_SIZE,lb/50),.1);lb/=hb;ba=[];cb=we.obj.keys(yb).sort();for(za=0;za<lb;za++){var Wa=qa+za*hb,gb=qa+(za+1)*hb,ac=we.obj.select(yb,cb.slice(Wa,gb));Wa=
  "["+cb[Wa].slice(0,4)+"-"+(cb[gb]||we.arr.last(cb)).slice(0,4)+"]";ba.push({partition:{originalValue:ac,offset:qa+za*hb,partitionSize:hb},value:[],key:Wa,keyString:Wa,valueString:"...",isCollapsed:!0})}return ba};we.propertiesOf=function(hb){var yb=hb.partition?hb.target:hb.value;if(!yb)return[];var lb={_rev:!0},qa=[],ba="function"===typeof yb.livelyCustomInspect?yb.livelyCustomInspect():{},cb=Object.assign({},we.defaultPropertyOptions,{},ba);if(ba.properties){ba=$jscomp.makeIterator(ba.properties);
  for(var za=ba.next();!za.done;za=ba.next()){var Wa=za.value;za=Wa.key;var gb=Wa.hidden,ac=Wa.priority,fc=Wa.keyString,xc=Wa.value;Wa=Wa.valueString;lb[za]=!0;gb||qa.push(hb.getSubNode({priority:ac,key:za,keyString:fc||we.safeToString(za),value:xc,valueString:Wa,isCollapsed:!0}))}}if(cb.includeDefault){ba=we.propertyNamesOf(yb,hb.partition);if(ba.length>we.MAX_NODE_THRESHOLD)for(lb=$jscomp.makeIterator(we.partitionedChildren(yb,hb.partition)),ba=lb.next();!ba.done;ba=lb.next())qa.push(hb.getSubNode(ba.value));
  else for(gb=$jscomp.makeIterator(ba),ba=gb.next();!ba.done;ba=gb.next())ac=ba.value,ac in lb||(ba=yb[ac],za=we.printValue(ba),ba={keyString:ac,key:ac,value:ba,valueString:za,isCollapsed:!0},qa.push(hb.getSubNode(ba)));if(cb.includeSymbols)for(lb=$jscomp.makeIterator(Object.getOwnPropertySymbols(yb)),ba=lb.next();!ba.done;ba=lb.next())gb=ba.value,ac=we.safeToString(gb),ba=yb[gb],za=we.printValue(ba),ba={key:gb,keyString:ac,value:ba,valueString:za,isCollapsed:!0},qa.push(hb.getSubNode(ba))}cb.sort&&
  (qa=cb.sortFunction(yb,qa));return qa};we.obj=Ve;we.num=xe;we.arr=Wc;we.string=Ld;we.connect=gd;we.signal=qc;we.TreeData=td;we.newUUID=be;we.localInterface=Ma;we.MAX_NODE_THRESHOLD=1E3;we.MIN_PARTITION_SIZE=250;we.defaultPropertyOptions={includeDefault:!0,includeSymbols:!0,sort:!0,sortFunction:function(hb,yb){return Array.isArray(hb)?yb:yb.sort(we.defaultSort)}};we.symMatcher=/^Symbol\((.*)\)$/;we.knownSymbols=function(){return Object.getOwnPropertyNames(Symbol).filter(function(hb){return"symbol"===
  typeof Symbol[hb]}).reduce(function(hb,yb){return hb.set(Symbol[yb],"Symbol."+yb)},new Map)}();we.isMultiValue=Ya;we.isMultiValue=Ya;we.printValue=ha;we.printValue=ha;var $f=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js"),lb=yb.hasOwnProperty("InspectionTree")&&"function"===typeof yb.InspectionTree?yb.InspectionTree:yb.InspectionTree=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};
  return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(qa){jc._get(Object.getPrototypeOf(lb.prototype),Symbol.for("lively-instance-initialize"),this).call(this,qa);this.inspector=qa.inspector;this.root.isInspectionNode||(this.root=we.InspectionNode.for(this.root,this))}},{key:"__only_serialize__",get:function(){return["root"]}},{key:"asListWithIndexAndDepth",value:function(qa){qa=void 0===qa?!0:qa;return jc._get(Object.getPrototypeOf(lb.prototype),"asListWithIndexAndDepth",
  this).call(this,function(ba){ba=ba.node;return qa?ba.visible:!0})}},{key:"getContextFor",value:function(qa){return qa==this.root?this.root.value.inspectee:qa.value}},{key:"dispose",value:function(){}},{key:"filter",value:function(qa){var ba=void 0===qa.maxDepth?1:qa.maxDepth,cb=qa.iterator,za=qa.showUnknown,Wa=qa.showInternal,gb=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ac){if(1==ac.nextAddress)return ac.yield(gb.uncollapseAll(function(fc,xc){return ba>xc&&(fc==gb.root||fc.value.submorphs)}),
  2);gb.asListWithIndexAndDepth(!1).forEach(function(fc){var xc=fc.node;return 0==fc.depth?xc.visible=!0:!za&&xc.keyString&&xc.keyString.includes("UNKNOWN PROPERTY")||!Wa&&xc.keyString&&xc.keyString.includes("internal")?xc.visible=!1:xc.value&&xc.value.submorphs?xc.visible=!0:xc.visible=cb(xc)});ac.jumpToEnd()})}},{key:"getChildren",value:function(qa){return qa.children}},{key:"display",value:function(qa){return qa.display(this.inspector)}},{key:"isCollapsed",value:function(qa){return qa.isCollapsed}},
  {key:"isLeaf",value:function(qa){return we.obj.isPrimitive(qa.value)}},{key:"collapse",value:function(qa,ba){var cb=this;qa.isCollapsed=ba;ba||this.isLeaf(qa)||qa.children.length||(qa.children=we.propertiesOf(qa).map(function(za){cb.parentMap.set(za,qa);return za}))}},{key:"retrieveForRemoteProxy",value:function(qa){qa.uuid||(qa.uuid=we.newUUID(),this.idToNodeMap[qa.uuid]=qa);return{uuid:qa.uuid,value:this.isLeaf(qa)?qa.value:{},keyString:qa.keyString,key:qa.keyString,valueString:we.safeToString(qa.value),
  isCollapsed:!0,children:[]}}},{key:"systemInterface",get:function(){return we.localInterface}},{key:"getNodeViaId",value:function(qa){return this.idToNodeMap[qa]}},{key:"asRemoteDelegate",value:function(qa){this.idToNodeMap={};this.isRemoteDelegate=!0;System.get("@lively-env").remoteInspectionContext||(System.get("@lively-env").remoteInspectionContext={});System.get("@lively-env").remoteInspectionContext[qa]=this;return this.retrieveForRemoteProxy(this.root)}}],[{key:Symbol.for("__LivelyClassName__"),
  get:function(){return"InspectionTree"}},{key:"forObject",value:function(qa,ba){return new this({key:"inspectee",value:{inspectee:qa},isCollapsed:!0,inspector:ba})}}],yb,{pathInPackage:function(){return"js/inspector/context.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:5969,end:8683})}(we.TreeData);we.InspectionTree=$f;we.InspectionTree=
  $f;we.InspectionTree=$f;var dg=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js"),lb=yb.hasOwnProperty("RemoteInspectionTree")&&"function"===typeof yb.RemoteInspectionTree?yb.RemoteInspectionTree:yb.RemoteInspectionTree=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"systemInterface",get:function(){return this.evalEnvironment.systemInterface}},{key:Symbol.for("lively-instance-initialize"),
  value:function(qa){this.parentMap=new WeakMap;this.root=qa.proxy;this.evalEnvironment=qa.evalEnvironment;this.inspector=qa.inspector;this.delegateId=qa.delegateId}},{key:"getContextFor",value:function(qa){return"System.get('@lively-env').remoteInspectionContext[\""+this.delegateId+'"].getNodeViaId("'+qa.uuid+'").value'}},{key:"dispose",value:function(){var qa=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ba){return ba.yield(qa.evalEnvironment.systemInterface.runEval("\n      delete System.get('@lively-env').remoteInspectionContext['"+
  qa.delegateId+"']\n    ",qa.evalEnvironment),0)})}},{key:"display",value:function(qa){return qa.keyString+": "+qa.valueString}},{key:"collapse",value:function(qa,ba){var cb=this,za;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Wa){if(1==Wa.nextAddress)return(qa.isCollapsed=ba)||cb.isLeaf(qa)?Wa.return():qa.children.length?Wa.jumpTo(0):Wa.yield(cb.evalEnvironment.systemInterface.runEval('\n         const node = this.getNodeViaId("'+qa.uuid+'");\n         try {\n           this.collapse(node, false);\n         } catch (e) {\n\n         }\n         node.children.map(n => this.retrieveForRemoteProxy(n));\n      ',
  {targetModule:"/lively.ide/js/inspector/context.js",context:"System.get('@lively-env').remoteInspectionContext[\""+cb.delegateId+'"]'}),3);za=Wa.yieldResult;qa.children=za.isError?[]:za.value;Wa.jumpToEnd()})}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"RemoteInspectionTree"}},{key:"forObject",value:function(qa,ba){var cb=this,za,Wa,gb,ac;return $jscomp.asyncExecutePromiseGeneratorProgram(function(fc){if(1==fc.nextAddress)return fc.yield(cb.createRemoteContext(qa,ba),2);za=fc.yieldResult;
  Wa=za.proxy;gb=za.delegateId;ac=za.evalEnvironment;return fc.return(new cb({key:"inspectee",proxy:Wa,delegateId:gb,evalEnvironment:ac,inspector:ba}))})}},{key:"createRemoteContext",value:function(qa,ba){var cb=qa.code,za=qa.evalEnvironment,Wa=qa.delegateId,gb,ac;return $jscomp.asyncExecutePromiseGeneratorProgram(function(fc){if(1==fc.nextAddress)return Wa="lively://inspector-"+ba.id,fc.yield(za.systemInterface.runEval('\n       const { InspectionTree } = await System.import("lively.ide/js/inspector/context.js");\n       const t = (() => '+
  cb+')();\n       const tree = InspectionTree.forObject(t);\n       tree.asRemoteDelegate("'+Wa+'");\n    ',za),2);gb=fc.yieldResult;ac=gb.value;return fc.return({delegateId:Wa,evalEnvironment:za,proxy:ac})})}}],yb,{pathInPackage:function(){return"js/inspector/context.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:8692,end:11045})}(we.InspectionTree);
  we.RemoteInspectionTree=dg;we.RemoteInspectionTree=dg;we.RemoteInspectionTree=dg;(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js"),lb=yb.hasOwnProperty("InspectionNode")&&"function"===typeof yb.InspectionNode?yb.InspectionNode:yb.InspectionNode=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(qa){var ba=
  qa.root,cb=qa.priority,za=qa.key,Wa=qa.keyString,gb=qa.value,ac=qa.valueString,fc=qa.isCollapsed,xc=void 0===qa.children?[]:qa.children,ed=void 0===qa.isSelected?!1:qa.isSelected,kd=void 0===qa.visible?!0:qa.visible;this.partition=qa.partition;this.priority=cb;this.key=za;this.keyString=String(Wa||za);this.value=gb;this.valueString=ac||we.printValue(gb);this.isCollapsed=fc;this.children=xc;this.isSelected=ed;this.visible=kd;this.root=ba}},{key:"__only_serialize__",get:function(){return[]}},{key:"isInspectionNode",
  get:function(){return!0}},{key:"getSubNode",value:function(qa){if(qa.value&&qa.value.isMorph)return new we.MorphNode(Object.assign({root:this.root},qa));var ba=qa.key,cb=qa.keyString,za=this.value,Wa=qa.partition;Wa&&(za=Wa.originalValue,cb=ba);return new we.PropertyNode(Object.assign({},qa,{keyString:cb,key:ba,target:za,partition:Wa,root:this.root,spec:{}}))}},{key:"display",value:function(qa){var ba=this.keyString,cb=this.valueString;if(!this.interactive)return ba+": "+cb;this._propertyWidget||
  (this._propertyWidget=qa.renderDraggableTreeLabel({value:ba+": "+cb}));this._propertyWidget.isSelected=this.isSelected;return this._propertyWidget}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"InspectionNode"}},{key:"for",value:function(qa,ba){ba=void 0===ba?null:ba;return qa.value&&qa.value.isMorph?new we.MorphNode(Object.assign({root:ba},qa)):new we.InspectionNode(Object.assign({root:ba},qa))}}],yb,{pathInPackage:function(){return"js/inspector/context.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},
  subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:11047,end:13612})})(void 0);(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js"),lb=yb.hasOwnProperty("MorphNode")&&"function"===typeof yb.MorphNode?yb.MorphNode:yb.MorphNode=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,
  [{key:Symbol.for("lively-instance-initialize"),value:function(qa){jc._get(Object.getPrototypeOf(lb.prototype),Symbol.for("lively-instance-initialize"),this).call(this,qa);this.target=this.value;this.propertyInfo=this.target.propertiesAndPropertySettings().properties}},{key:"getSubNode",value:function(qa){var ba=this.propertyInfo[qa.key]||{};return qa.value&&qa.value.isMorph?new we.MorphNode(Object.assign({},qa,{root:this.root})):new we.PropertyNode(Object.assign({},qa,{root:this.root,target:this.target,
  spec:ba}))}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"MorphNode"}}],yb,{pathInPackage:function(){return"js/inspector/context.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:13614,end:14763})})(we.InspectionNode);(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js"),lb=yb.hasOwnProperty("PropertyNode")&&
  "function"===typeof yb.PropertyNode?yb.PropertyNode:yb.PropertyNode=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(qa){jc._get(Object.getPrototypeOf(lb.prototype),Symbol.for("lively-instance-initialize"),this).call(this,qa);var ba=qa.spec,cb=qa.target;this.partition=qa.partition;this.target=cb;this.spec=ba;this.foldedNodes={}}},{key:"__deserialize__",
  value:function(qa,ba){this.spec={}}},{key:"interactive",get:function(){return this._interactive}},{key:"interactive",set:function(qa){this._interactive=qa}},{key:"isFoldable",get:function(){return!!this.spec.foldable}},{key:"isInternalProperty",get:function(){return"id"==this.keyString||this.keyString.includes("internal")}},{key:"getSubNode",value:function(qa){return this.isFoldable?this.getFoldedContext(qa):jc._get(Object.getPrototypeOf(lb.prototype),"getSubNode",this).call(this,qa)}},{key:"getFoldedContext",
  value:function(qa){return this.foldedNodes[qa.key]=new we.FoldedNode(Object.assign({},qa,{root:this.root,target:this.target,foldableNode:this,spec:we.obj.dissoc(this.spec,["foldable"])}))}},{key:"rerender",value:function(){this.root.inspector.refreshSelectedLine()}},{key:"refreshProperty",value:function(qa,ba){(ba=void 0===ba?!1:ba)&&(this.target[this.key]=qa);this.value=this.target[this.key];this.valueString=we.printValue(this.value);this.interactive&&(ba||this._propertyWidget.highlight());if(this.isFoldable)for(var cb in this.foldedNodes)this.foldedNodes[cb].value=
  this.value[cb],this.foldedNodes[cb].valueString=we.printValue(this.value[cb]),this.foldedNodes[cb]._propertyWidget&&we.signal(this.foldedNodes[cb]._propertyWidget,"update",this.value[cb])}},{key:"display",value:function(qa){var ba=this,cb=this._propertyWidget,za=this.keyString,Wa=this.valueString,gb=this.target,ac=this.value,fc=this.spec;if(!(this.interactive||fc.foldable&&we.isMultiValue(ac,fc.foldable)))return qa.renderPropertyControl({target:gb,keyString:za,valueString:Wa,tree:qa.ui.propertyTree,
  value:ac,spec:fc,node:this,fastRender:!0});if(cb)return cb.keyString=za,cb.valueString=Wa,cb.isSelected=this.isSelected,cb.control&&(cb.control.isSelected=this.isSelected),cb;cb=this._propertyWidget=qa.renderPropertyControl({target:gb,keyString:za,valueString:Wa,value:ac,spec:fc,node:this,isSelected:this.isSelected,fontColor:qa.ui.propertyTree.fontColor});this.isInternalProperty||fc.readOnly||(we.connect(cb,"propertyValue",this,"refreshProperty",{updater:function(xc,ed){return xc(ed,!0)}}),we.connect(cb,
  "openWidget",this.root,"onWidgetOpened",{converter:function(xc){return{widget:xc,node:ba.sourceObj}}}));return cb}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"PropertyNode"}}],yb,{pathInPackage:function(){return"js/inspector/context.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:14765,end:18244})})(we.InspectionNode);
  (function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector/context.js"),lb=yb.hasOwnProperty("FoldedNode")&&"function"===typeof yb.FoldedNode?yb.FoldedNode:yb.FoldedNode=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(qa){jc._get(Object.getPrototypeOf(lb.prototype),Symbol.for("lively-instance-initialize"),this).call(this,
  qa);this.foldableNode=qa=qa.foldableNode;this.foldedProp=qa.key+we.string.capitalize(this.key)}},{key:"refreshProperty",value:function(qa,ba){ba=void 0===ba?!1:ba;var cb={};this.foldableNode.refreshProperty(Object.assign({},this.target[this.foldableNode.key],(cb[this.key]=qa,cb)),ba)}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"FoldedNode"}}],yb,{pathInPackage:function(){return"js/inspector/context.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:18246,end:18928})})(we.PropertyNode);var tg=lively.FreezerRuntime.recorderFor("lively.ide/themes/dark.js");tg.Color=Vb;var Ah=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/themes/dark.js"),lb=yb.hasOwnProperty("DarkTheme")&&"function"===typeof yb.DarkTheme?yb.DarkTheme:yb.DarkTheme=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};
  return jc(lb,hb,[{key:"background",get:function(){return tg.Color.rgb(44,62,80)}},{key:"cursorColor",get:function(){return tg.Color.gray}},{key:"default",get:function(){return{fontColor:"#abb2bf"}}},{key:"header",get:function(){return{fontSize:"110%",fontColor:"#6b94ee"}}},{key:"header-1",get:function(){return{fontSize:"135%",fontColor:"#6b94ee"}}},{key:"header-2",get:function(){return{fontSize:"125%",fontColor:"#6b94be"}}},{key:"header-3",get:function(){return{fontSize:"120%",fontColor:"#6b94be"}}},
  {key:"quote",get:function(){return{fontColor:"#090"}}},{key:"negative",get:function(){return{fontColor:"#d44"}}},{key:"positive",get:function(){return{fontColor:"#292"}}},{key:"strong",get:function(){return{fontWeight:"bold"}}},{key:"em",get:function(){return{fontStyle:"italic"}}},{key:"link",get:function(){return{textDecoration:"underline"}}},{key:"strikethrough",get:function(){return{textDecoration:"line-through"}}},{key:"hr",get:function(){return{fontColor:"#999"}}},{key:"link",get:function(){return{textDecoration:"underline",
  fontColor:"#2c2cff"}}},{key:"url",get:function(){return{textDecoration:"underline",fontColor:"#2c2cff"}}},{key:"keyword",get:function(){return{fontColor:tg.Color.rgb(204,109,243)}}},{key:"atom",get:function(){return{fontColor:"#d19a66"}}},{key:"number",get:function(){return{fontColor:tg.Color.orange}}},{key:"def",get:function(){return{fontColor:"#e5c07b"}}},{key:"variable",get:function(){return{fontColor:"#d19a66"}}},{key:"punctuation",get:function(){return{fontColor:"#05a"}}},{key:"property",get:function(){return{fontColor:tg.Color.rgb(33,
  150,243)}}},{key:"operator",get:function(){return{fontColor:"#abb2bf"}}},{key:"variable-2",get:function(){return{fontColor:"#e06c75"}}},{key:"variable-3",get:function(){return{fontColor:"#085"}}},{key:"comment",get:function(){return{fontColor:"#7F848E"}}},{key:"string",get:function(){return{fontColor:"#98c378"}}},{key:"string-2",get:function(){return{fontColor:"#98c378"}}},{key:"meta",get:function(){return{fontColor:"#555"}}},{key:"qualifier",get:function(){return{fontColor:"#d19a66"}}},{key:"builtin",
  get:function(){return{fontColor:"#30a"}}},{key:"bracket",get:function(){return{fontColor:"#515a6b"}}},{key:"brace",get:function(){return{fontColor:"#abb2bf"}}},{key:"tag",get:function(){return{fontColor:"#170"}}},{key:"attribute",get:function(){return{fontColor:"#d19a66"}}},{key:"error",get:function(){return{backgroundColor:"#ff4c4c"}}},{key:"invalidchar",get:function(){return{backgroundColor:"#ff4c4c"}}},{key:"diff-file-header",get:function(){return{fontColor:tg.Color.white,fontWeight:"bold",backgroundColor:tg.Color.rgba(136,
  136,136,.7)}}},{key:"diff-hunk-header",get:function(){return{backgroundColor:tg.Color.rgba(204,204,204,.4),fontWeight:"bold"}}},{key:"coord",get:function(){return{backgroundColor:tg.Color.rgba(204,204,204,.4),fontWeight:"bold"}}},{key:"inserted",get:function(){return{backgroundColor:"rgba(108,255,108, .3)"}}},{key:"deleted",get:function(){return{backgroundColor:"rgba(255,108,108, .3)"}}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"DarkTheme"}},{key:"instance",get:function(){return this._instance||
  (this._instance=new this)}}],yb,{pathInPackage:function(){return"themes/dark.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:42,end:3009})}(void 0),Ze=Ah=tg.DarkTheme;tg.default=Ah;var ld=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js");ld.inspect=Pa;ld.remoteInspect=nb;ld.generateReferenceExpression=cc;ld.onNumberDragStart=
  function(hb,yb){yb.initPos=hb.position;yb.factorLabel=(new ld.Tooltip({description:"1x"})).openInWorld(hb.hand.position.addXY(10,10))};ld.onNumberDrag=function(hb,yb){var lb=ld.getScaleAndOffset(hb,yb),qa=lb.scale;lb=lb.offset;yb.factorLabel.position=hb.hand.position.addXY(10,10);yb.factorLabel.description=qa+"x";return ld.getCurrentValue(lb,qa,yb)};ld.onNumberDragEnd=function(hb,yb){var lb=ld.getScaleAndOffset(hb,yb);hb=lb.offset;lb=lb.scale;yb.factorLabel.softRemove();return ld.getCurrentValue(hb,
  lb,yb)};ld.getScaleAndOffset=function(hb,yb){var lb=hb.position.subPt(yb.initPos);hb=lb.x;yb=ld.num.roundTo(Math.exp(-lb.y/$world.height*6),.01)*yb.baseFactor;return{offset:hb,scale:yb}};ld.getCurrentValue=function(hb,yb,lb){return Math.max(lb.min,Math.min(lb.max,lb.scrubbedValue+(lb.floatingPoint?hb*yb:Math.round(hb*yb))))};ld.Color=Vb;ld.rect=Bd;ld.pt=Ud;ld.obj=Ve;ld.num=xe;ld.Path=pe;ld.arr=Wc;ld.promise=Se;ld.connect=gd;ld.noUpdate=nc;ld.disconnect=$c;ld.once=Ad;ld.Morph=ge;ld.GridLayout=ad;ld.Tooltip=
  ie;ld.VerticalLayout=Yb;ld.HorizontalLayout=zb;ld.morph=Kd;ld.Label=Rc;ld.Icon=Mc;ld.config=tc;ld.Tree=Tc;ld.LoadingIndicator=fb;ld.DropDownList=uc;ld.DropDownSelector=Rb;ld.SearchField=Fc;ld.LabeledCheckBox=Uc;ld.MorphHighlighter=vc;ld.InteractiveMorphSelector=Oc;ld.printValue=ha;ld.RemoteInspectionTree=dg;ld.InspectionTree=$f;ld.isMultiValue=Ya;ld.valueWidgets=pc;ld.popovers=bb;ld.DarkTheme=Ze;ld.DefaultTheme=Ie;ld.syncEval=vd;ld.inspectorCommands=[{name:"focus codeEditor",exec:function(hb){hb.get("codeEditor").show();
  hb.get("codeEditor").focus();return!0}},{name:"focus propertyTree",exec:function(hb){hb.get("propertyTree").show();hb.get("propertyTree").focus();return!0}}];(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js"),lb=yb.hasOwnProperty("DraggedProp")&&"function"===typeof yb.DraggedProp?yb.DraggedProp:yb.DraggedProp=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"applyToTarget",
  value:function(qa){var ba=this.currentTarget,cb=this.control;this.remove();ld.MorphHighlighter.removeHighlighters(qa.world);if(ba)if(ba.isText&&"js"===ba.editorModeName){var za=ba.evalEnvironment.context;qa=ba.textPositionFromPoint(ba.localize(qa.position));za=ld.generateReferenceExpression(this.sourceObject,{fromMorph:za});cb.keyString&&(za+="."+cb.keyString);ba.insertTextAndSelect(za,qa);ba.focus()}else"propertyValue"in cb&&(ba[cb.keyString]=cb.propertyValue)}},{key:"update",value:function(qa){qa=
  qa.hand.globalPosition;var ba=this.morphBeneath(qa);if(ba){for(ba==this.morphHighlighter&&(ba=ba.morphBeneath(qa));[ba].concat($jscomp.arrayFromIterable(ba.ownerChain())).find(function(cb){return!cb.visible});)ba=ba.morphBeneath(qa);if(ba!=this.currentTarget){this.currentTarget=ba;this.morphHighlighter&&this.morphHighlighter.deactivate();if(ba.isWorld)return;this.morphHighlighter=ld.MorphHighlighter.for($world,ba);this.morphHighlighter.show()}this.position=qa}}}],[{key:Symbol.for("__LivelyClassName__"),
  get:function(){return"DraggedProp"}},{key:"properties",get:function(){return{control:{},sourceObject:{},borderColor:{defaultValue:ld.Color.rgb(169,204,227)},fill:{defaultValue:ld.Color.rgb(235,245,251).withA(.8)},borderWidth:{defaultValue:2},borderRadius:{defaultValue:4},submorphs:{after:["control"],initialize:function(){var qa=this.control;if(!qa)return this.submorphs=[];this.height=22;this.submorphs=[qa];qa.top=0;qa.fontSize=14;"function"===typeof qa.relayout&&qa.relayout();this.width=qa.width+
  20;this.adjustOrigin(ld.pt(10,10))}}}}}],yb,{pathInPackage:function(){return"js/inspector.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:1245,end:3687})})(ld.Morph);(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js"),lb=yb.hasOwnProperty("DraggableTreeLabel")&&"function"===typeof yb.DraggableTreeLabel?
  yb.DraggableTreeLabel:yb.DraggableTreeLabel=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"inspector",get:function(){return this.owner.owner}},{key:"onDragStart",value:function(qa){this.draggedProp=new ld.DraggedProp({sourceObject:this.inspector.targetObject,control:this.copy()});this.draggedProp.openInWorld();ld.connect(qa.hand,"update",this.draggedProp,"update")}},{key:"onDrag",value:function(qa){}},
  {key:"onDragEnd",value:function(qa){ld.disconnect(qa.hand,"update",this.draggedProp,"update");this.draggedProp.applyToTarget(qa)}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"DraggableTreeLabel"}},{key:"properties",get:function(){return{styleClasses:{defaultValue:["TreeLabel"]},draggable:{defaultValue:!0},nativeCursor:{defaultValue:"-webkit-grab"},keyString:{},valueString:{},fontFamily:{defaultValue:ld.config.codeEditor.defaultStyle.fontFamily},fill:{defaultValue:ld.Color.transparent},
  padding:{defaultValue:ld.rect(0,1,10,-1)},isSelected:{after:["submorphs"],set:function(qa){this.setProperty("isSelected",qa);qa?(this.removeStyleClass("deselected"),this.addStyleClass("selected")):(this.addStyleClass("deselected"),this.removeStyleClass("selected"));this.control&&(this.control.isSelected=qa)}}}}}],yb,{pathInPackage:function(){return"js/inspector.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:3689,end:5028})})(ld.Label);$f=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js"),lb=yb.hasOwnProperty("PropertyControl")&&"function"===typeof yb.PropertyControl?yb.PropertyControl:yb.PropertyControl=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"menuItems",value:function(){return this._targetMenuItems||
  []}},{key:"renderValueSelector",value:function(qa,ba,cb){qa.control=new ld.DropDownSelector({opacity:.8,fill:ld.Color.white.withA(.5),name:"valueString",styleClasses:["TreeLabel"],selectedValue:ba,padding:0,values:cb});ld.connect(qa.control,"update",qa,"propertyValue",{updater:function(za,Wa){this.targetObj.propertyValue!=Wa&&za(Wa)}});ld.connect(qa,"update",qa.control,"selectedValue",{updater:function(za,Wa){Wa=Wa&&Wa.valueOf?Wa.valueOf():Wa;this.targetObj.propertyValue!=Wa&&za(Wa)}});return qa}},
  {key:"toggleMultiValuePlaceholder",value:function(qa){this.multiValuePlaceholder=this.multiValuePlaceholder||this.addMorph({fill:ld.Color.transparent,layout:new ld.HorizontalLayout({spacing:3}),name:"multi value placeholder",nativeCursor:"pointer",submorphs:ld.arr.range(0,2).map(function(ba){return{type:"ellipse",fill:ld.Color.gray.withA(.5),reactsToPointer:!1,extent:ld.pt(7,7)}})});qa?(ld.connect(this.multiValuePlaceholder,"onMouseDown",this,"propertyValue",{converter:function(){return this.targetObj.propertyValue.valueOf()}}),
  this.control.opacity=0,this.multiValuePlaceholder.visible=!0):(ld.disconnect(this.multiValuePlaceholder,"onMouseDown",this,"propertyValue"),this.control.opacity=1,this.multiValuePlaceholder.visible=!1)}},{key:"toggleFoldableValue",value:function(qa){this.foldableProperties&&this.toggleMultiValuePlaceholder(ld.isMultiValue(qa,this.foldableProperties))}},{key:"asFoldable",value:function(qa){this.foldableProperties=qa;ld.connect(this,"update",this,"toggleFoldableValue")}},{key:"relayout",value:function(){this.fit();
  this.control&&(this.control.topLeft=this.textBounds().topRight().addXY(-2,1),this.width=this.textBounds().width+this.control.bounds().width);this.height=18;this.multiValuePlaceholder&&(this.multiValuePlaceholder.leftCenter=this.textBounds().rightCenter())}},{key:"toString",value:function(){return this.keyString+": "+this.valueString}},{key:"highlight",value:function(){this.highlighter&&this.highlighter.remove();var qa=this.highlighter=this.addMorph({type:"label",name:"valueString",value:this.keyString});
  qa.isLayoutable=!1;qa.fontWeight="bold";qa.fontColor=ld.Color.orange;qa.reactsToPointer=!1;qa.fadeOut(2E3)}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"PropertyControl"}},{key:"properties",get:function(){return{root:{},keyString:{},valueString:{},propertyValue:{},control:{after:["submorphs"],derived:!0,get:function(){return this.submorphs[0]||!1},set:function(qa){this.submorphs=[qa]}},submorphs:{initialize:function(){this.value=this.keyString+":";this.submorphs=[];ld.connect(this,
  "extent",this,"relayout")}}}}},{key:"inferType",value:function(qa){return(qa=qa.value)&&(qa.isColor||qa.isGradient)?"Color":qa&&qa.isPoint?"Point":ld.obj.isBoolean(qa)?"Boolean":ld.obj.isNumber(qa)?"Number":ld.obj.isString(qa)?"String":qa&&qa.isRectangle?"Rectangle":!1}},{key:"render",value:function(qa){qa.spec.type||(qa.spec=Object.assign({},qa.spec,{isFloat:!Number.isInteger(qa.value),type:this.inferType(qa)}));switch(qa.spec.type){case "Color":var ba=this.renderColorControl(qa);break;case "ColorGradient":ba=
  this.renderColorControl(Object.assign({},qa,{gradientEnabled:!0}));break;case "Number":ba=this.renderNumberControl(qa);break;case "String":ba=this.renderStringControl(qa);break;case "RichText":ba=this.renderStringControl(qa);break;case "Layout":ba=this.renderLayoutControl(qa);break;case "Enum":ba=this.renderEnumControl(qa);break;case "Shadow":ba=this.renderShadowControl(qa);break;case "Point":ba=this.renderPointControl(qa);break;case "Rectangle":ba=this.renderRectangleControl(qa);break;case "Boolean":ba=
  this.renderBooleanControl(qa);break;default:ba=this.renderItSomehow(qa)}ba.control&&(ld.connect(ba.control,"openWidget",ba,"openWidget"),ba.toggleFoldableValue(qa.value));return ba}},{key:"baseControl",value:function(qa){var ba=qa.spec;qa=new this({keyString:qa.keyString,valueString:qa.valueString,isSelected:!1,propertyValue:qa.value});ba.foldable&&qa.asFoldable(ba.foldable);return qa}},{key:"renderGrabbableKey",value:function(qa){var ba=this,cb=qa.target;return[qa.keyString+":",{nativeCursor:"-webkit-grab",
  onDragStart:function(za){za.state.draggedProp=new ld.DraggedProp({sourceObject:cb,control:ba.baseControl(qa)});za.state.draggedProp.openInWorld();ld.connect(za.hand,"update",za.state.draggedProp,"update")},onDrag:function(za){},onDragEnd:function(za){ld.disconnect(za.hand,"update",za.state.draggedProp,"update");za.state.draggedProp.applyToTarget(za)}}]}},{key:"renderEnumControl",value:function(qa){var ba=qa.value,cb=qa.spec.values,za=qa.keyString,Wa=qa.target,gb=qa.node,ac=function(fc,xc){return $jscomp.asyncExecutePromiseGeneratorProgram(function(ed){Wa.world().openWorldMenu(fc,
  cb.map(function(kd){return{string:kd.toString(),action:function(){Wa[za]=kd;gb.rerender()}}}));ed.jumpToEnd()})};return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),[" "+(ba?ba.valueOf?ba.valueOf():ba:"Not set"),{nativeCursor:"pointer",onMouseDown:ac}],$jscomp.arrayFromIterable(ld.Icon.textAttribute("angle-down",{paddingTop:"4px",paddingLeft:"4px",opacity:.7,onMouseDown:ac})))}},{key:"renderStringControl",value:function(qa){var ba=qa.value;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),
  [" "+(200<ba.length?ba.slice(0,20)+"...":ba),{fontColor:ld.Color.blue,paddingTop:"0px"}])}},{key:"renderRectangleControl",value:function(qa){var ba=qa.value,cb=qa.keyString,za=qa.valueString,Wa=qa.target,gb=qa.node;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),[" "+za,{fontColor:ld.Color.black,nativeCursor:"pointer",onMouseDown:function(ac){var fc;return $jscomp.asyncExecutePromiseGeneratorProgram(function(xc){if(1==xc.nextAddress)return fc=new ld.popovers.RectanglePopover({hasFixedPosition:!0,
  rectangle:ba}),fc.relayout(),xc.yield(fc.fadeIntoWorld(ac.positionIn(Wa.world())),2);ld.connect(fc,"rectangle",function(ed){Wa[cb]=ed;gb.rerender()});xc.jumpToEnd()})}}])}},{key:"renderBooleanControl",value:function(qa){var ba=qa.value,cb=qa.keyString,za=qa.valueString,Wa=qa.target,gb=qa.node;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),[" "+za,{nativeCursor:"pointer",fontColor:ba?ld.Color.green:ld.Color.red,onMouseDown:function(ac){Wa[cb]=!Wa[cb];gb.rerender()}}])}},{key:"renderNumberControl",
  value:function(qa){var ba=qa.value,cb=qa.spec,za=qa.keyString,Wa=qa.valueString,gb=qa.node,ac=qa.target,fc=qa.tree,xc=void 0===gb._numberControls?new fi:gb._numberControls,ed=$jscomp.makeIterator(xc.submorphs),kd=ed.next().value,Qd=ed.next().value;xc.fontColor=fc.fontColor;var Ge=gb._numberControls=xc;"max"in cb&&"min"in cb&&-Infinity!=cb.min&&Infinity!=cb.max?(Ge.baseFactor=(cb.max-cb.min)/100,Ge.floatingPoint=cb.isFloat,Ge.max=cb.max,Ge.min=cb.min):(Ge.floatingPoint=cb.isFloat,Ge.baseFactor=.5,
  Ge.min=void 0!=cb.min?cb.min:-Infinity,Ge.max=void 0!=cb.max?cb.max:Infinity);var cf=ld.valueWidgets.NumberWidget.properties.fontColor.defaultValue;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),$jscomp.arrayFromIterable(gb._inputMorph?[gb._inputMorph,{}]:[" "+(void 0!=ba&&(ba.valueOf?ba.valueOf():ba).toFixed(cb.isFloat?Math.max(4,ld.num.precision(ba)):0))+" ",{fontColor:cf,onMouseUp:function(ne){gb._inputMorph=ld.morph({type:"input",fill:null,fontColor:cf,fontFamily:"IBM Plex Mono",
  fontSize:14,padding:ld.rect(8,2,-6,2),height:23,cursorColor:ld.Color.white,value:ba.valueOf?ba.valueOf():Wa});ac[za]=ba;gb._inputMorph.focus();ld.once(gb._inputMorph,"inputAccepted",function(qf){delete gb._inputMorph;ac[za]=cb.isFloat?Number.parseFloat(qf):Number.parseInt(qf);gb.rerender()});ld.once(gb._inputMorph,"onBlur",function(qf){gb._inputMorph&&(delete gb._inputMorph,ac[za]=ba,gb.rerender())});gb.rerender()},onDragStart:function(ne){Ge.scrubbedValue=ba;ld.onNumberDragStart(ne,Ge)},onDrag:function(ne){ac[za]=
  ld.onNumberDrag(ne,Ge);gb.rerender()},onDragEnd:function(ne){return ld.onNumberDragEnd(ne,Ge)}},xc,{onMouseUp:function(){kd.fill=Qd.fill=null},onMouseDown:function(ne){if(ne.targetMorph===kd){kd.fill=ld.Color.white.withA(.2);if("max"in cb&&ac[za]>=cb.max)return;ac[za]+=1}if(ne.targetMorph===Qd){Qd.fill=ld.Color.white.withA(.2);if("min"in cb&&ac[za]<=cb.min)return;--ac[za]}gb.rerender()}}]))}},{key:"renderShadowControl",value:function(qa){var ba=qa.keyString,cb=qa.value,za=qa.target,Wa=qa.node;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),
  [""+(cb?cb.toFilterCss():"No Shadow"),{nativeCursor:"pointer",onMouseDown:function(gb){var ac;return $jscomp.asyncExecutePromiseGeneratorProgram(function(fc){if(1==fc.nextAddress)return ac=new ld.popovers.ShadowPopover({shadowValue:za[ba],hasFixedPosition:!0}),fc.yield(ac.fadeIntoWorld(gb.positionIn(za.world())),2);ld.connect(ac,"shadowValue",function(xc){za[ba]=xc;Wa.rerender()});fc.jumpToEnd()})}}])}},{key:"renderPointControl",value:function(qa){var ba=qa.keyString,cb=qa.value,za=qa.target,Wa=qa.node,
  gb=ld.valueWidgets.NumberWidget.properties.fontColor.defaultValue,ac={nativeCursor:"pointer",onMouseDown:function(fc){var xc;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ed){if(1==ed.nextAddress)return xc=new ld.popovers.PointPopover({pointValue:za[ba],hasFixedPosition:!0}),ed.yield(xc.fadeIntoWorld(fc.positionIn(za.world())),2);ld.connect(xc,"pointValue",function(kd){za[ba]=kd;Wa.rerender()});ed.jumpToEnd()})}};return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),
  [" pt(",Object.assign({},ac),""+cb.x.toFixed(),Object.assign({fontColor:gb},ac),",",Object.assign({},ac),""+cb.y.toFixed(),Object.assign({fontColor:gb},ac),")",Object.assign({},ac)])}},{key:"renderLayoutControl",value:function(qa){var ba=qa.valueString,cb=qa.value;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),[" "+(cb?ba:"No Layout"),{onMouseDown:function(za){}}])}},{key:"renderColorControl",value:function(qa){var ba=qa.node,cb=qa.gradientEnabled,za=qa.valueString,Wa=qa.keyString,
  gb=qa.value,ac=qa.target;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),[ld.morph({fill:gb.valueOf?gb.valueOf():gb,extent:ld.pt(15,15),borderColor:ld.Color.gray,borderWidth:1}),{paddingLeft:"5px",paddingTop:"4px",paddingRight:"5px"},""+(gb?gb.valueOf?gb.valueOf():za:"No Color"),{nativeCursor:"pointer",onMouseDown:function(fc){var xc;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ed){if(1==ed.nextAddress)return xc=new ld.popovers.FillPopover({hasFixedPosition:!0,
  handleMorph:ac,fillValue:gb,title:"Fill Control",gradientEnabled:cb}),ed.yield(xc.fadeIntoWorld(fc.positionIn(ac.world())),2);ld.connect(xc,"fillValue",function(kd){ac[Wa]=kd;ba.rerender()});ed.jumpToEnd()})}}])}},{key:"renderItSomehow",value:function(qa){var ba=qa.valueString;return[].concat($jscomp.arrayFromIterable(this.renderGrabbableKey(qa)),[" "+ba,{}])}}],yb,{pathInPackage:function(){return"js/inspector.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:5037,end:20330})}(ld.DraggableTreeLabel);ld.PropertyControl=$f;ld.PropertyControl=$f;ld.PropertyControl=$f;ld.inspect=Pa;ld.inspect=Pa;ld.remoteInspect=nb;ld.remoteInspect=nb;ld.generateReferenceExpression=cc;ld.generateReferenceExpression=cc;var fi=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js"),lb=yb.hasOwnProperty("NumberControls")&&"function"===typeof yb.NumberControls?yb.NumberControls:yb.NumberControls=
  function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,void 0,[{key:Symbol.for("__LivelyClassName__"),get:function(){return"NumberControls"}},{key:"properties",get:function(){return{layout:{initialize:function(){this.layout=new ld.VerticalLayout({spacing:0,orderByIndex:!0})}},fill:{defaultValue:ld.Color.transparent},width:{defaultValue:15},fontColor:{derived:!0,set:function(qa){this.submorphs.map(function(ba){return ba.fontColor=
  qa})}},submorphs:{initialize:function(){this.submorphs=[ld.Icon.makeLabel("sort-up",{autofit:!0,opacity:.6,nativeCursor:"pointer",padding:ld.rect(5,2,0,-6),fontSize:12}),ld.Icon.makeLabel("sort-up",{top:10,rotation:Math.PI,autofit:!0,padding:ld.rect(5,4,0,-9),opacity:.6,nativeCursor:"pointer",fontSize:12})]}}}}}],yb,{pathInPackage:function(){return"js/inspector.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:23003,end:24048})}(ld.Morph);(function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js"),lb=yb.hasOwnProperty("PropertyTree")&&"function"===typeof yb.PropertyTree?yb.PropertyTree:yb.PropertyTree=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"onDrag",value:function(qa){this._onDragHandler&&this._onDragHandler(qa)}}],
  [{key:Symbol.for("__LivelyClassName__"),get:function(){return"PropertyTree"}}],yb,{pathInPackage:function(){return"js/inspector.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:25213,end:25324})})(ld.Tree);$f=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/js/inspector.js"),lb=yb.hasOwnProperty("Inspector")&&"function"===
  typeof yb.Inspector?yb.Inspector:yb.Inspector=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:"onWindowClose",value:function(){this.stopStepping();this.ui.propertyTree.treeData.dispose();this.openWidget&&this.closeOpenWidget()}},{key:"onMouseMove",value:function(qa){}},{key:"__after_deserialize__",value:function(qa,ba,cb){var za=this,Wa=new ld.PropertyTree(Object.assign({name:"propertyTree"},this.treeStyle,
  {treeData:ld.InspectionTree.forObject(null,this)}));this.addMorph(Wa,this.getSubmorphNamed("terminal toggler"));jc._get(Object.getPrototypeOf(lb.prototype),"__after_deserialize__",this).call(this,qa,ba,cb);!this.isComponent&&this.master.whenApplied().then(function(){za.layout.col(0).row(1).group.morph=Wa;za.targetObject&&(za.targetObject=za.targetObject)})}},{key:"__additionally_serialize__",value:function(qa,ba,cb,za){qa=qa.props.submorphs.value;for(ba=qa.length;ba--;)cb.refForId(qa[ba].id).realObj==
  this.ui.propertyTree&&ld.arr.removeAt(qa,ba)}},{key:"renderDraggableTreeLabel",value:function(qa){return new ld.DraggableTreeLabel(qa)}},{key:"renderPropertyControl",value:function(qa){return ld.PropertyControl.render(qa)}},{key:"onLoad",value:function(){var qa=this.ui,ba=qa.codeEditor,cb=qa.thisBindingSelector,za=qa.propertyTree;ba.changeEditorMode("js").then(function(){return ba.evalEnvironment={targetModule:"lively://lively.morphic/inspector",get context(){return"selection"==cb.selection?ba.owner.selectedContext:
  ba.owner.targetObject},get systemInterface(){return ld.Path("treeData.systemInterface").get(za)},format:"esm"}}).catch(function(Wa){return $world.logError(Wa)})}},{key:Symbol.for("lively-instance-initialize"),value:function(qa){jc._get(Object.getPrototypeOf(lb.prototype),Symbol.for("lively-instance-initialize"),this).call(this,qa);qa=this.ui;var ba=qa.targetPicker,cb=qa.propertyTree,za=qa.resizer,Wa=qa.terminalToggler,gb=qa.unknowns,ac=qa.internals,fc=qa.searchField,xc=qa.codeEditor,ed=qa.fixImportButton,
  kd=qa.thisBindingSelector;xc.changeEditorMode("js").then(function(){return xc.evalEnvironment={targetModule:"lively://lively.morphic/inspector",get context(){return"selection"==kd.selection?xc.owner.selectedContext:xc.owner.targetObject},get systemInterface(){return cb.treeData.systemInterface},format:"esm"}}).catch(function(Qd){return $world.logError(Qd)});ld.connect(ba,"onMouseUp",this,"selectTarget");ld.connect(cb,"onScroll",this,"repositionOpenWidget");ld.connect(za,"onDrag",this,"adjustProportions");
  ld.connect(Wa,"onMouseDown",this,"toggleCodeEditor");ld.connect(gb,"trigger",this,"filterProperties");ld.connect(ac,"trigger",this,"filterProperties");ld.connect(fc,"searchInput",this,"filterProperties");ld.connect(cb,"nodeCollapseChanged",this,"filterProperties");ld.connect(this,"extent",this,"relayout");ld.connect(kd,"selection",this,"bindCodeEditorThis");ld.connect(ed,"fire",xc,"execCommand",{updater:function(Qd){return Qd("[javascript] fix undeclared variables",{autoApplyIfSingleChoice:!0})}})}},
  {key:"refreshSelectedLine",value:function(){var qa=this.ui.propertyTree.selectedIndex-1,ba=this.ui.propertyTree.selectedNode;this.ui.propertyTree.selectedNode.refreshProperty();ba=this.ui.propertyTree.document.getLine(qa).textAndAttributes.slice(0,4).concat(ba.display(this));qa=this.ui.propertyTree.lineRange(qa,!1);this.ui.propertyTree.replace(qa,ba,!1,!1,!1);this.ui.propertyTree.selectedNode=this.ui.propertyTree.selectedNode}},{key:"refreshAllProperties",value:function(){this.world()||this.stopStepping();
  if(this.targetObject&&this.targetObject.isMorph)if(this.targetObject._styleSheetProps!=this.lastStyleSheetProps)this.refreshTreeView(),this.lastStyleSheetProps=this.targetObject._styleSheetProps;else{var qa=ld.arr.last(this.targetObject.env.changeManager.changesFor(this.targetObject));if(qa!=this.lastChange||this.lastSubmorphs!=ld.printValue(this.targetObject&&this.targetObject.submorphs))this.focusedNode&&this.focusedNode.keyString==qa.prop&&this.repositionOpenWidget(),this.lastChange=qa,this.lastSubmorphs=
  ld.printValue(this.targetObject&&this.targetObject.submorphs),this.refreshTreeView()}else this.stopStepping()}},{key:"refreshTreeView",value:function(){var qa;this.originalTreeData&&this.originalTreeData.asListWithIndexAndDepth(!1).forEach(function(ba){ba=ba.node;ba.target&&(qa=ba.foldableNode?ba.target[ba.foldableNode.key][ba.key]:ba.target[ba.key],!ld.obj.equals(qa,ba.value)&&ba.refreshProperty&&ba.refreshProperty(qa))});this.ui.propertyTree.update(!0);this.ui.propertyTree.doNotAcceptDropsForThisAndSubmorphs()}},
  {key:"isInspector",get:function(){return!0}},{key:"prepareForNewTargetObject",value:function(qa,ba){ba=void 0===ba?!1:ba;var cb=this,za,Wa,gb,ac,fc,xc,ed,kd,Qd,Ge,cf,ne,qf,pf,ff;return $jscomp.asyncExecutePromiseGeneratorProgram(function(vf){switch(vf.nextAddress){case 1:if(!cb.isUpdating()){vf.jumpTo(2);break}return vf.yield(cb.whenUpdated(),2);case 2:za=ld.promise.deferred();Wa=za.promise;gb=!!cb.target;cb.updateInProgress=Wa;vf.setCatchFinallyBlocks(4);ba&&(ac=ld.LoadingIndicator.open("connecting to remote..."));
  if(!ba){fc=ld.InspectionTree.forObject(qa,cb);vf.jumpTo(6);break}return vf.yield(ld.RemoteInspectionTree.forObject(qa,cb),7);case 7:fc=vf.yieldResult;case 6:return xc=fc,ed=cb.ui.propertyTree,vf.yield(xc.collapse(xc.root,!1),8);case 8:if(!xc.root.children){vf.jumpTo(9);break}return vf.yield(xc.collapse(xc.root.children[0],!1),9);case 9:if(kd=cb.originalTreeData&&cb.originalTreeData.diff(xc)){Qd=$jscomp.makeIterator(kd);for(Ge=Qd.next();!Ge.done;Ge=Qd.next())cf=Ge.value,ne=$jscomp.makeIterator(cf),
  qf=ne.next().value,pf=ne.next().value,qf.refreshProperty(pf.value);vf.jumpTo(11);break}ed.treeData=xc;return vf.yield(cb.filterProperties(),12);case 12:if(!ed.treeData.root.isCollapsed){vf.jumpTo(13);break}return vf.yield(ed.onNodeCollapseChanged({node:xc.root,isCollapsed:!1}),14);case 14:ed.selectedIndex=1;case 13:return vf.yield(ed.execCommand("uncollapse selected node"),11);case 11:cb.toggleWindowStyle(gb);ac&&ac.remove();vf.leaveTryBlock(5);break;case 4:ff=vf.enterCatchBlock(),cb.showError(ff);
  case 5:cb.startStepping(1E3,"refreshAllProperties"),cb.updateInProgress=null,vf.jumpToEnd()}})}},{key:"toggleWindowStyle",value:function(qa){qa=void 0===qa?!0:qa;var ba=this,cb,za,Wa,gb,ac;return $jscomp.asyncExecutePromiseGeneratorProgram(function(fc){if(1==fc.nextAddress)return cb=300,gb=ba.ui.codeEditor.pluginFind(function(xc){return xc.runEval}),ac=ba.getWindow(),fc.yield(gb.runEval("System.get('@system-env').node"),2);fc.yieldResult.value?(Wa=[].concat($jscomp.arrayFromIterable(ld.arr.without(ac.styleClasses,
  "local")),["node"]),za=ld.DarkTheme.instance):(Wa=["local"].concat($jscomp.arrayFromIterable(ac?ld.arr.without(ac.styleClasses,"node"):[])),za=ld.DefaultTheme.instance);gb.theme=za;qa?(ac&&ac.animate({duration:cb,styleClasses:Wa}),ba.ui.codeEditor.animate({fill:za.background,duration:cb})):ac&&(ac.styleClasses=Wa);ba.ui.codeEditor.textString=ba.ui.codeEditor.textString;gb.highlight();fc.jumpToEnd()})}},{key:"isUpdating",value:function(){return!!this.updateInProgress}},{key:"whenUpdated",value:function(){return this.updateInProgress||
  Promise.resolve()}},{key:"focus",value:function(){this.ui.codeEditor.focus()}},{key:"build",value:function(){var qa=this,ba=Object.assign({type:"text",borderWidth:1,borderColor:ld.Color.gray,lineWrapping:"by-chars"},ld.config.codeEditor.defaultStyle,{textString:""}),cb=ld.Icon.textAttribute("long-arrow-alt-right",{textStyleClasses:["fas"]});ld.rect(0,0,this.width,30);var za=new ld.SearchField({styleClasses:["idle"],name:"searchField"});cb[1].paddingTop="2px";this.submorphs=[{name:"searchBar",submorphs:[za,
  {type:"button",name:"targetPicker",padding:ld.rect(2,2,0,0),borderRadius:15,master:{auto:"styleguide://System/buttons/light"},tooltip:"Change Inspection Target",label:ld.Icon.textAttribute("crosshairs")},new ld.LabeledCheckBox({label:"Internals",name:"internals"}),new ld.LabeledCheckBox({label:"Unknowns",name:"unknowns"})]},new ld.PropertyTree(Object.assign({name:"propertyTree"},this.treeStyle,{treeData:ld.InspectionTree.forObject(null,this)})),za=ld.Icon.makeLabel("keyboard",{name:"terminal toggler"}),
  {name:"resizer"},Object.assign({name:"codeEditor"},ba),{name:"fix import button",type:"button",visible:!1,label:"fix undeclared vars"},{name:"this binding selector",type:ld.DropDownList,visible:!1,listAlign:"top",items:[{isListItem:!0,value:"target",label:["this ",null].concat($jscomp.arrayFromIterable(cb),[" target",null])},{isListItem:!0,value:"selection",label:["this ",null].concat($jscomp.arrayFromIterable(cb),[" selection",null])}]}];ld.connect(za,"position",function(){debugger});this.ui.thisBindingSelector.listMorph.dropShadow=
  !0;this.ui.thisBindingSelector.listMorph.borderRadius=3;this.ui.thisBindingSelector.whenRendered().then(function(){qa.ui.thisBindingSelector.selection="target"})}},{key:"selectTarget",value:function(){var qa=this,ba,cb,za,Wa;return $jscomp.asyncExecutePromiseGeneratorProgram(function(gb){switch(gb.nextAddress){case 1:if(qa.env.eventDispatcher.isKeyPressed("Shift"))return cb=$jscomp,za=cb.makeIterator,gb.yield($world.execCommand("select morph",{justReturn:!0}),5);qa.toggleSelectionInstructions(!0);
  return gb.yield(ld.InteractiveMorphSelector.selectMorph(),4);case 4:ba=gb.yieldResult;qa.toggleSelectionInstructions(!1);gb.jumpTo(3);break;case 5:Wa=za.call(cb,gb.yieldResult),ba=Wa.next().value;case 3:ba&&(qa.targetObject=ba),gb.jumpToEnd()}})}},{key:"toggleSelectionInstructions",value:function(qa){if(qa&&!this.instructionWidget){var ba=ld.morph({type:"label",name:"escapeKey",value:"esc"});ba.whenRendered().then(function(){return ba.fit()});this.instructionWidget=this.addMorph({type:"text",opacity:0,
  center:this.extent.scaleBy(.5),width:120,fixedWidth:!0,lineWrapping:!0,name:"selectionInstruction",textAndAttributes:["Select a new morph to inspect by hovering over it and clicking left. You can exit this mode by pressing ",{},ba,{}]});this.instructionWidget.animate({opacity:1,duration:200})}else this.instructionWidget.fadeOut(200),this.instructionWidget=null}},{key:"closeOpenWidget",value:function(){this.openWidget.close()}},{key:"onWidgetOpened",value:function(qa){qa=qa.widget;this.openWidget&&
  this.openWidget.fadeOut();this.focusedNode=this.ui.propertyTree.selectedNode;qa.epiMorph=!0;this.openWidget=qa;ld.once(qa,"close",this,"closeOpenWidget");ld.once(this.ui.propertyTree,"onMouseDown",this,"closeOpenWidget")}},{key:"getWidgetPosition",value:function(){var qa=this.ui.propertyTree,ba=qa.textLayout.boundsFor(qa,{column:0,row:qa.selectedIndex-1});ba=qa.worldPoint(ld.pt(ba.x,ba.y+ba.height/2)).addPt(qa.scroll.negated());qa=qa.globalBounds();ba.x=this.globalBounds().center().x;ba.y<qa.top()?
  ba=qa.topCenter():qa.bottom()-20<ba.y&&(ba=qa.bottomCenter().addXY(0,-20));return ba}},{key:"repositionOpenWidget",value:function(){this.openWidget&&this.focusedNode&&(this.openWidget.topCenter=this.getWidgetPosition())}},{key:"adjustProportions",value:function(qa){this.layout.row(1).height+=qa.state.dragDelta.y;this.relayout()}},{key:"isEditorVisible",value:function(){return 10<this.ui.codeEditor.height}},{key:"makeEditorVisible",value:function(qa){var ba=this;if(qa!==this.isEditorVisible()){var cb=
  this.extent,za=this.layout,Wa=this.ui,gb=Wa.terminalToggler,ac=Wa.codeEditor,fc=Wa.thisBindingSelector;Wa=Wa.fixImportButton;za.disable();qa?(gb.fontColor=ld.Color.rgbHex("00e0ff"),za.row(3).height=this.codeEditorHeight||180,za.row(2).height=5,Wa.animate({visible:!0,duration:200}),fc.animate({visible:!0,duration:200})):(this.codeEditorHeight=za.row(3).height,gb.fontColor=ld.Color.white,za.row(3).height=za.row(2).height=0,Wa.animate({visible:!1,duration:200}),fc.animate({visible:!1,duration:200}));
  za.enable({duration:200}).then(function(){ba.extent=cb});this.relayout({duration:200});ac.focus();ac.animate({opacity:qa?1:0,duration:200})}}},{key:"toggleCodeEditor",value:function(){var qa=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ba){qa.makeEditorVisible(!qa.isEditorVisible());ba.jumpToEnd()})}},{key:"filterProperties",value:function(){var qa=this,ba,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){if(1==za.nextAddress)return ba=qa.ui.searchField,cb=qa.ui.propertyTree,
  qa.originalTreeData||(qa.originalTreeData=cb.treeData),ld.disconnect(cb.treeData,"onWidgetOpened",qa,"onWidgetOpened"),za.yield(cb.treeData.filter({maxDepth:2,showUnknown:qa.ui.unknowns.checked,showInternal:qa.ui.internals.checked,iterator:function(Wa){return ba.matches(Wa.key)}}),2);cb.update();ld.connect(cb.treeData,"onWidgetOpened",qa,"onWidgetOpened");za.jumpToEnd()})}},{key:"__handleVdomCSSLayoutIssue__",value:function(qa){!this.world()&&this.layout.renderViaCSS?(this.layout.renderViaCSS=!1,
  this._revertToCSS=!0):this._revertToCSS&&qa.duration&&(this.layout.renderViaCSS=!0,delete this._revertToCss)}},{key:"relayout",value:function(qa){qa=void 0===qa?{}:qa;var ba=this,cb,za,Wa,gb,ac,fc,xc,ed,kd;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Qd){ba.__handleVdomCSSLayoutIssue__(qa);ba.layout&&ba.layout.forceLayout();cb=ba;za=cb.ui;Wa=za.fixImportButton;gb=za.terminalToggler;ac=za.propertyTree;fc=za.thisBindingSelector;xc=ac.bounds().insetBy(5).bottomLeft();ed=ac.bounds().insetBy(5).bottomRight();
  kd=ed.subXY(Wa.width+10,0);fc.width=115;fc.listMorph.itemHeight=20;qa.duration?(gb.animate(Object.assign({bottomLeft:xc},qa)),Wa.animate(Object.assign({bottomRight:ed},qa)),fc.animate(Object.assign({bottomRight:kd},qa))):(gb.bottomLeft=xc,console.log(xc),Wa.bottomRight=ed,fc.bottomRight=kd);Qd.jumpToEnd()})}},{key:"keybindings",get:function(){return[{keys:"Alt-Up",command:"focus propertyTree"},{keys:"Alt-Down",command:"focus codeEditor"},{keys:"F1",command:"focus propertyTree"},{keys:"F2",command:"focus codeEditor"}].concat(jc._get(Object.getPrototypeOf(lb.prototype),
  "keybindings",this))}},{key:"commands",get:function(){return ld.inspectorCommands}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"Inspector"}},{key:"openInWindow",value:function(qa){if(System._testsRunning)return console.log(qa.targetObject);qa=new this(qa);qa.openInWindow().doNotAcceptDropsForThisAndSubmorphs();return qa}},{key:"properties",get:function(){return{extent:{defaultValue:ld.pt(400,500)},fill:{defaultValue:ld.Color.transparent},name:{defaultValue:"inspector"},_serializableTarget:{defaultValue:null},
  remoteTarget:{after:["submorphs"],set:function(qa){this.setProperty("remoteTarget",qa);this.ui.propertyTree&&(this.originalTreeData=null,this.prepareForNewTargetObject(qa,!0))}},targetObject:{after:["submorphs"],set:function(qa){this._serializableTarget=qa&&qa.isMorph?qa.id:qa;this.setProperty("targetObject",qa);this.ui.propertyTree&&(this.originalTreeData=null,this.prepareForNewTargetObject(qa))}},originalTreeData:{serialize:!1},selectedContext:{readOnly:!0,derived:!0,get:function(){var qa=this.ui.propertyTree,
  ba=qa.treeData;return ba.getContextFor(qa.selectedNode||ba.root)}},submorphs:{initialize:function(){this.build()}},ui:{readOnly:!0,derived:!0,after:["submorphs"],get:function(){return{codeEditor:this.getSubmorphNamed("codeEditor"),terminalToggler:this.getSubmorphNamed("terminal toggler"),fixImportButton:this.getSubmorphNamed("fix import button"),thisBindingSelector:this.getSubmorphNamed("this binding selector"),propertyTree:this.getSubmorphNamed("propertyTree"),unknowns:this.getSubmorphNamed("unknowns"),
  internals:this.getSubmorphNamed("internals"),targetPicker:this.getSubmorphNamed("targetPicker"),searchBar:this.getSubmorphNamed("searchBar"),searchField:this.getSubmorphNamed("searchField"),resizer:this.getSubmorphNamed("resizer")}}},updateInProgress:{defaultValue:!1,serialize:!1},treeStyle:{defaultValue:{draggable:!0,borderWidth:1,borderColor:ld.Color.gray,fontSize:14,fontFamily:ld.config.codeEditor.defaultStyle.fontFamily}},master:{initialize:function(){this.master={auto:"styleguide://SystemWidgets/inspector/light"}}}}}}],
  yb,{pathInPackage:function(){return"js/inspector.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:25341,end:46327})}(ld.Morph);$f=ld.Inspector;dg=$a("I",$f);ld.default=$f;var Vd=lively.FreezerRuntime.recorderFor("lively.ide/text/code-evaluation-commands.js");Vd.Inspector=dg;Vd.string=Ld;Vd.Morph=ge;Vd.pt=Ud;Vd.Color=Vb;$f=[{name:"doit",
  doc:"Evaluates the selecte code or the current line and report the result",exec:function(hb,yb,lb){lb=void 0===lb?1:lb;var qa,ba,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){switch(za.nextAddress){case 1:return hb.maybeSelectCommentOrLine(),za.setCatchFinallyBlocks(2),yb=Object.assign({},yb,{logDoit:!0,inspect:!0,inspectDepth:lb}),za.yield(hb.doEval(void 0,yb),4);case 4:qa=za.yieldResult;ba=qa.error?qa.error:qa.isError?qa.value:null;za.leaveTryBlock(3);break;case 2:ba=cb=za.enterCatchBlock();
  case 3:return ba?hb.showError(ba):hb.setStatusMessage(Vd.string.truncate(qa.value,1E3)),za.return(qa)}})}},{name:"eval all",doc:"Evaluates the entire text contents",scrollCursorIntoView:!1,exec:function(hb,yb){var lb,qa,ba;return $jscomp.asyncExecutePromiseGeneratorProgram(function(cb){switch(cb.nextAddress){case 1:return cb.setCatchFinallyBlocks(2),cb.yield(hb.doEval({start:{row:0,column:0},end:hb.documentEndPosition},Object.assign({},yb,{logDoit:!0})),4);case 4:lb=cb.yieldResult;qa=lb.error?lb.error:
  lb.isError?lb.value:null;cb.leaveTryBlock(3);break;case 2:qa=ba=cb.enterCatchBlock();case 3:return qa?hb.showError(qa):hb.setStatusMessage(String(lb.value)),cb.return(lb)}})}},{name:"printit",doc:"Evaluates selected code or the current line and inserts the result in a printed representation",exec:function(hb,yb){var lb,qa,ba,cb,za,Wa,gb,ac;return $jscomp.asyncExecutePromiseGeneratorProgram(function(fc){switch(fc.nextAddress){case 1:return hb.maybeSelectCommentOrLine(),fc.setCatchFinallyBlocks(2),
  yb=Object.assign({},yb,{asString:!1,logDoit:!0}),fc.yield(hb.doEval(void 0,yb),4);case 4:lb=fc.yieldResult;qa=lb.error?lb.error:lb.isError?lb.value:null;fc.leaveTryBlock(3);break;case 2:qa=ba=fc.enterCatchBlock();case 3:hb.selection.collapseToEnd();if(cb=lb.value&&lb.value.isColor)return hb.selection.text=String(lb.value),za=new Vd.Morph({fill:Vd.Color.transparent,extent:Vd.pt(hb.fontSize+2,hb.fontSize+2),submorphs:[{fill:lb.value,center:Vd.pt(hb.fontSize+2,hb.fontSize+2).scaleBy(.5)}]}),Wa=hb.selection.start,
  gb=Wa.column,ac=Wa.row,hb.insertText([za,{}],hb.selection.start),hb.selection.start={column:gb,row:ac},hb.focus(),fc.return(lb);hb.insertTextAndSelect(qa?String(qa)+(qa.stack?"\n"+qa.stack:""):String(lb.value));hb.focus();return fc.return(lb)}})}},{name:"editit",doc:"Evaluates the expression and opens an object editor on the resulting object.",exec:function(hb,yb){var lb,qa,ba,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){switch(za.nextAddress){case 1:hb.maybeSelectCommentOrLine();
  qa=hb.textInRange(hb.selection);ba=hb.evalEnvironment||{};cb=hb.pluginFind(function(Wa){return Wa.isEditorPlugin&&"function"===typeof Wa.runEval});ba.systemInterface||(ba.systemInterface=cb.systemInterface(yb));if("local"!==ba.systemInterface.name){za.jumpTo(2);break}za.setCatchFinallyBlocks(3);return za.yield(hb.doEval(void 0,yb),5);case 5:lb=za.yieldResult;qa=lb.value;za.leaveTryBlock(2);break;case 3:za.enterCatchBlock();case 2:return hb.world().execCommand("open object editor",{target:qa,evalEnvironment:ba}),
  za.return(lb)}})}},{name:"inspectit",doc:"Evaluates the expression and opens an inspector widget on the resulting object.",exec:function(hb,yb){var lb,qa,ba,cb,za,Wa;return $jscomp.asyncExecutePromiseGeneratorProgram(function(gb){switch(gb.nextAddress){case 1:hb.maybeSelectCommentOrLine();ba=hb.textInRange(hb.selection);cb=hb.evalEnvironment||{};za=hb.pluginFind(function(ac){return ac.isEditorPlugin&&"function"===typeof ac.runEval});cb.systemInterface||(cb.systemInterface=za.systemInterface(yb));
  if("local"!==cb.systemInterface.name){Vd.Inspector.openInWindow({remoteTarget:{code:ba,evalEnvironment:cb}});gb.jumpTo(2);break}gb.setCatchFinallyBlocks(3);return gb.yield(hb.doEval(void 0,yb),5);case 5:lb=gb.yieldResult;qa=lb.error?lb.error:lb.isError?lb.value:null;ba=lb.value;gb.leaveTryBlock(4);break;case 3:qa=Wa=gb.enterCatchBlock();case 4:Vd.Inspector.openInWindow({targetObject:qa||ba});case 2:return gb.return(lb)}})}},{name:"print inspectit",doc:"Prints a representation of the object showing it's properties. The count argument defines how deep (recursively) objects will be printed.",
  handlesCount:!0,exec:function(hb,yb,lb){lb=void 0===lb?1:lb;var qa;return $jscomp.asyncExecutePromiseGeneratorProgram(function(ba){switch(ba.nextAddress){case 1:return hb.maybeSelectCommentOrLine(),ba.setCatchFinallyBlocks(2),yb=Object.assign({},yb,{inspect:!0,inspectDepth:lb,logDoit:!0}),ba.yield(hb.doEval(void 0,yb),4);case 4:qa=ba.yieldResult;ba.leaveTryBlock(3);break;case 2:ba.enterCatchBlock();case 3:return hb.selection.collapseToEnd(),hb.insertTextAndSelect(qa.value),ba.return(qa)}})}}];Vd.codeEvaluationCommands=
  $f;Vd.codeEvaluationCommands=$f;Vd.codeEvaluationCommands=$f;var si=lively.FreezerRuntime.recorderFor("lively.ide/text/rich-text-commands.js");si.changeAttributeInSelectionOrMorph=function(hb,yb,lb){var qa=hb.selection;hb.keepPosAtSameScrollOffsetWhile(function(){qa.isEmpty()?hb[yb]="function"===typeof lb?lb(hb[yb]):lb:hb.undoManager&&(hb.undoManager.group(),hb.changeStyleProperty(yb,function(ba){return"function"===typeof lb?lb(ba):lb}),hb.undoManager.group())})};dg=[{name:"increase font size",scrollCursorIntoView:!1,
  exec:function(hb){var yb=hb.fontSize;si.changeAttributeInSelectionOrMorph(hb,"fontSize",function(lb){lb=lb||yb;return lb+(18<=lb?2:1)});return!0}},{name:"decrease font size",scrollCursorIntoView:!1,exec:function(hb){var yb=hb.fontSize;si.changeAttributeInSelectionOrMorph(hb,"fontSize",function(lb){lb=lb||yb;return lb-(18>=lb?1:2)});return!0}},{name:"change font",scrollCursorIntoView:!1,exec:function(hb){var yb,lb,qa,ba,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){if(1==za.nextAddress){yb=
  ["serif","sans-serif","monospace"];if(lb=localStorage["lively.morpic/text-change-font-additional-fonts"])lb=JSON.parse(lb),yb.push.apply(yb,$jscomp.arrayFromIterable(lb));yb.map(function(Wa){return Wa.toLowerCase()}).includes(hb.fontFamily.toLowerCase())||(yb.push(hb.fontFamily),lb=[].concat($jscomp.arrayFromIterable(lb||[]),[hb.fontFamily]),localStorage["lively.morpic/text-change-font-additional-fonts"]=JSON.stringify(lb));return za.yield($world.editListPrompt("choose font",yb,{requester:hb,preselect:yb.indexOf(hb.fontFamily),
  historyId:"lively.morpic/text-change-font-hist"}),2)}qa=za.yieldResult;ba=$jscomp.makeIterator(qa.selections);if(cb=ba.next().value)hb.fontFamily=cb;return za.return(!0)})}},{name:"set link of selection",scrollCursorIntoView:!1,exec:function(hb,yb){yb=void 0===yb?{}:yb;var lb,qa,ba,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){if(1==za.nextAddress){if(yb.hasOwnProperty("link"))return za.jumpTo(2);qa=hb.selection;ba=hb.getStyleInRange(qa);cb=ba.link;return za.yield(hb.world().prompt("Set link",
  {input:cb||"https://",historyId:"lively.morphic-rich-text-link-hist"}),3)}if(2!=za.nextAddress&&(lb=za.yieldResult,!lb))return za.return();hb.undoManager.group();hb.setStyleInRange({link:lb||void 0},qa);hb.undoManager.group();za.jumpToEnd()})}},{name:"set doit of selection",scrollCursorIntoView:!1,exec:function(hb,yb){var lb,qa,ba,cb;return $jscomp.asyncExecutePromiseGeneratorProgram(function(za){if(1==za.nextAddress)return lb=hb.selection,qa=hb.getStyleInRange(lb),ba=qa.doit,za.yield(hb.world().editPrompt("Enter doit code (runs on clicking the text)",
  {requester:hb,input:ba?ba.code:"// empty doit",historyId:"lively.morphic-rich-text-doit-hist",mode:"js",evalEnvironment:hb.evalEnvForDoit(ba||{})}),2);cb=za.yieldResult;hb.undoManager.group();cb?hb.addTextAttribute({doit:{code:cb},nativeCursor:"pointer",textDecoration:"underline"},lb):hb.removeTextAttribute({doit:null,nativeCursor:"",textDecoration:""},lb);hb.undoManager.group();za.jumpToEnd()})}},{name:"reset text style",scrollCursorIntoView:!1,exec:function(hb,yb){yb=void 0===yb?{}:yb;hb.undoManager.group();
  yb=!yb.onlySelection&&hb.selection.isEmpty()?hb.documentRange:hb.selection.range;hb.setStyleInRange(null,yb);hb.undoManager.group();return!0}},{name:"open text attribute controls",exec:function(hb){var yb,lb,qa,ba;return $jscomp.asyncExecutePromiseGeneratorProgram(function(cb){if(1==cb.nextAddress)return cb.yield(System.import("lively.modules"),2);if(3!=cb.nextAddress)return yb=cb.yieldResult,lb=yb.module,cb.yield(lb("lively.ide/text/ui.js").load(),3);qa=cb.yieldResult;ba=qa.RichTextControl;return cb.return(ba.openFor(hb))})}}];
  si.commands=dg;si.commands=dg;si.commands=dg;var wd=lively.FreezerRuntime.recorderFor("lively.ide/editor-plugin.js");wd.guessTextModeName=Lc;wd.rangedToken=function(hb,yb,lb,qa,ba){return{start:{row:hb,column:yb},end:{row:hb,column:lb},token:qa,mode:ba}};wd.fun=Xd;wd.arr=Wc;wd.connect=gd;wd.disconnect=$c;wd.DefaultTheme=Ie;wd.tokenizeDocument=Td;wd.modeInfo=ce;wd.visitDocumentTokens=bc;wd.getMode=Ca;wd.completionCommands=Af;wd.multiSelectCommands=C;wd.navCommands=Cf;wd.codeCommands=mg;wd.codeEvaluationCommands=
  $f;wd.richTextCommands=dg;wd.Color=Vb;wd.Range=af;wd.guessTextModeName=Lc;wd.guessTextModeName=Lc;Ie=function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/editor-plugin.js"),lb=yb.hasOwnProperty("EditorPlugin")&&"function"===typeof yb.EditorPlugin?yb.EditorPlugin:yb.EditorPlugin=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(){this.theme=
  wd.DefaultTheme.instance;this._ast=this.checker=null;this._tokens=[];this._tokenizerValidBefore=null;this.__dont_serialize__=["mode","_ast","_tokens","_tokenizerValidBefore"]}},{key:"isEditorPlugin",get:function(){return!0}},{key:"shortName",get:function(){return null}},{key:"longName",get:function(){return this.shortName}},{key:"attach",value:function(qa){var ba=this;this.textMorph=qa;wd.connect(qa,"textChange",this,"onTextChange");wd.connect(qa,"viewChange",this,"onViewChange");this.textMorph.whenRendered().then(function(){return ba.highlight()})}},
  {key:"detach",value:function(qa){wd.disconnect(qa,"textChange",this,"onTextChange");wd.disconnect(qa,"viewChange",this,"onViewChange");this.textMorph=null}},{key:"onViewChange",value:function(){this.requestHighlight()}},{key:"onTextChange",value:function(qa){this._ast=null;if(qa){var ba=this._tokenizerValidBefore;if("replace"===qa.selector){var cb=qa.args[0].start;qa=cb.row;cb=cb.column}else cb=qa=0;if(!ba||qa<ba.row||qa===ba.row&&cb<ba.column)qa=Math.max(0,qa),this._tokenizerValidBefore={row:qa,
  column:cb}}this.requestHighlight()}},{key:"requestHighlight",value:function(qa){var ba=this;(void 0===qa?0:qa)?this.highlight():wd.fun.debounceNamed(this.textMorph.id+"-requestHighlight",300,function(){ba.highlight()})()}},{key:"highlight",value:function(){var qa=this.textMorph,ba=this.theme,cb=this.mode,za=this._tokenizerValidBefore;if(ba&&qa&&qa.document&&cb){qa.fill=ba.background;qa.cursorColor=ba.cursorColor||qa.fontColor;var Wa=qa.viewState,gb={};za=wd.tokenizeDocument(cb,qa.document,Wa.firstVisibleRow,
  Wa.lastVisibleRow,za);cb=za.lines;za=za.tokens;if(cb.length){Wa=cb[0].row;for(var ac=[],fc=0;fc<za.length;Wa++,fc++)for(var xc=za[fc],ed=0;ed<xc.length;ed+=5){var kd=xc[ed],Qd=xc[ed+1],Ge=ba[xc[ed+2]]||ba.default;Ge&&ac.push({start:{row:Wa,column:kd},end:{row:Wa,column:Qd}},Ge)}qa.embeddedMorphs.forEach(function(cf){var ne=qa.embeddedMorphMap.get(cf).anchor;gb[cf.id]=qa.textAttributeAt(ne.position)});qa.setTextAttributesWithSortedRanges(ac);qa.embeddedMorphs.forEach(function(cf){var ne=qa.embeddedMorphMap.get(cf).anchor;
  ne=wd.Range.at(ne.position);ne.end.column+=1;qa.replace(ne,[cf,gb[cf.id]],!1)});this._tokenizerValidBefore={row:wd.arr.last(cb).row+1,column:0}}if(this.checker)this.checker.onDocumentChange({},qa,this)}}},{key:"visitTokensInRange",value:function(qa,ba){var cb=qa.start,za=qa.end,Wa=cb.row-1;wd.visitDocumentTokens(this.mode,this.textMorph.document,cb.row,za.row,null,function(gb){return Wa++},function(gb,ac,fc,xc,ed,kd,Qd){if(Wa===cb.row&&0<cb.column){if(cb.column>=xc)return;fc<cb.column&&cb.column<
  xc&&(fc=cb.column)}if(Wa===za.row){if(za.column<=fc)return;fc<za.column&&za.column<xc&&(xc=za.column)}ba(gb,ac,Wa,fc,xc,ed,kd,Qd)})}},{key:"tokensInRange",value:function(qa){var ba=[];this.visitTokensInRange(qa,function(cb,za,Wa,gb,ac,fc,xc,ed){return ba.push(wd.rangedToken(Wa,gb,ac,cb,ed))});return ba}},{key:"tokensOfRow",value:function(qa){var ba=this.textMorph.getLine(qa).length;return this.tokensInRange({start:{row:qa,column:0},end:{row:qa,column:ba}})}},{key:"tokenAt",value:function(qa){for(var ba=
  this.tokensOfRow(qa.row),cb=ba.length;cb--;){var za=ba[cb];if(za.token&&za.start.column<=qa.column&&qa.column<=za.end.column)return za}return null}},{key:"getCommands",value:function(qa){return[].concat($jscomp.arrayFromIterable(qa),$jscomp.arrayFromIterable(wd.completionCommands),$jscomp.arrayFromIterable(wd.multiSelectCommands),$jscomp.arrayFromIterable(wd.navCommands),$jscomp.arrayFromIterable(wd.codeCommands),$jscomp.arrayFromIterable(wd.codeEvaluationCommands),$jscomp.arrayFromIterable(wd.richTextCommands))}},
  {key:"getComment",value:function(){if(!this.mode)return null;var qa=this.mode,ba=qa.lineComment,cb=qa.blockCommentStart;qa=qa.blockCommentEnd;var za={};ba&&(za.lineCommentStart=ba);cb&&(za.blockCommentStart=cb);qa&&(za.blockCommentEnd=qa);return za}},{key:"toString",value:function(){return this.constructor.name+"("+this.textMorph+")"}},{key:"cmd_newline",value:function(qa,ba,cb){var za=this.textMorph,Wa=qa.row,gb=qa.column;qa=ba[gb-1];ba=ba[gb];za.selection.text="\n";za.selection.collapseToEnd();
  "{"===qa&&"}"===ba&&(za.selection.text="\n"+" ".repeat(cb),za.selection.collapse());za.execCommand("indent according to mode",{undo:!1,ignoreFollowingText:!1,firstRow:Wa+1,lastRow:Wa+1});return!0}},{key:"openPairs",get:function(){return{"{":"}","[":"]","(":")",'"':'"',"'":"'","`":"`"}}},{key:"closePairs",get:function(){return{"}":"{","]":"[",")":"(",'"':'"',"'":"'","`":"`"}}},{key:"cmd_delete_backwards",value:function(){var qa=this.textMorph,ba=this.openPairs,cb=qa.selection,za=qa.getLine(cb.end.row),
  Wa=za[cb.end.column-1];za=za[cb.end.column];qa.autoInsertPairs&&cb.isEmpty()&&Wa in ba&&za===ba[Wa]&&(cb.growRight(1),cb.growLeft(1));return!1}},{key:"cmd_insertstring",value:function(qa){var ba=this.openPairs,cb=this.closePairs,za=this.textMorph,Wa=za.selection,gb=za.autoInsertPairs&&qa in ba,ac=za.autoInsertPairs&&qa in cb;if(!gb&&!ac)return!1;var fc=za.getLine(Wa.end.row)[Wa.end.column];if(!Wa.isEmpty()){if(!gb)return!1;cb=za.undoManager.ensureNewGroup(za);za.insertText(ba[qa],Wa.end);za.insertText(qa,
  Wa.start);za.undoManager.group(cb);Wa.growRight(-1);return!0}if(fc in cb&&qa===fc)return Wa.goRight(1),!0;if(ac&&!gb)return!1;cb=za.undoManager.ensureNewGroup(za);za.insertText(qa+ba[qa]);za.undoManager.group(cb);Wa.goLeft(1);return!0}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"EditorPlugin"}}],yb,{pathInPackage:function(){return"editor-plugin.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:3148,end:12030})}(void 0);ce=Ie=wd.EditorPlugin;Af=$a("C",function(hb){var yb=lively.FreezerRuntime.recorderFor("lively.ide/editor-plugin.js"),lb=yb.hasOwnProperty("CodeMirrorEnabledEditorPlugin")&&"function"===typeof yb.CodeMirrorEnabledEditorPlugin?yb.CodeMirrorEnabledEditorPlugin:yb.CodeMirrorEnabledEditorPlugin=function(qa){qa&&qa[Symbol.for("lively-instance-restorer")]||this[Symbol.for("lively-instance-initialize")].apply(this,
  arguments)};return jc(lb,hb,[{key:Symbol.for("lively-instance-initialize"),value:function(){jc._get(Object.getPrototypeOf(lb.prototype),Symbol.for("lively-instance-initialize"),this).call(this);this.mode=null}},{key:"attach",value:function(qa){this.mode=this.codeMirrorMode(qa);return jc._get(Object.getPrototypeOf(lb.prototype),"attach",this).call(this,qa)}},{key:"__deserialize__",value:function(){this.mode=this.textMorph?this.codeMirrorMode(this.textMorph):null}},{key:"defaultCodeMirrorModeConfig",
  value:function(qa){return{indentWithTabs:!qa.useSoftTabs,indentUnit:qa.tabWidth,tabSize:4}}},{key:"codeMirrorMode",value:function(qa){qa=this.defaultCodeMirrorModeConfig(qa);return wd.getMode(qa,{name:this.longName})}}],[{key:Symbol.for("__LivelyClassName__"),get:function(){return"CodeMirrorEnabledEditorPlugin"}}],yb,{pathInPackage:function(){return"editor-plugin.js"},unsubscribeFromToplevelDefinitionChanges:function(){return function(){}},subscribeToToplevelDefinitionChanges:function(){return function(){}},
  package:function(){return{name:"lively.ide",version:"0.1.0"}}},{start:12041,end:12735})}(wd.EditorPlugin));wd.CodeMirrorEnabledEditorPlugin=Af;wd.CodeMirrorEnabledEditorPlugin=Af;wd.CodeMirrorEnabledEditorPlugin=Af;wd.default=Ie;Ie=Object.freeze({__proto__:null,guessTextModeName:Lc,"default":ce,CodeMirrorEnabledEditorPlugin:Af});$a("e",Ie)}}});